Click here to Skip to main content
15,898,036 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: SetTimer Pin
Erudite_Eric1-Nov-11 3:30
Erudite_Eric1-Nov-11 3:30 
GeneralRe: SetTimer Pin
Chuck O'Toole1-Nov-11 3:44
Chuck O'Toole1-Nov-11 3:44 
GeneralRe: SetTimer Pin
Erudite_Eric1-Nov-11 4:48
Erudite_Eric1-Nov-11 4:48 
GeneralRe: SetTimer Pin
Chuck O'Toole1-Nov-11 5:11
Chuck O'Toole1-Nov-11 5:11 
GeneralRe: SetTimer Pin
Erudite_Eric1-Nov-11 6:43
Erudite_Eric1-Nov-11 6:43 
GeneralRe: SetTimer Pin
Chuck O'Toole1-Nov-11 7:51
Chuck O'Toole1-Nov-11 7:51 
GeneralRe: MSDN:Preventing Hangs in Windows Applications Pin
Goto_Label_1-Nov-11 9:17
Goto_Label_1-Nov-11 9:17 
GeneralRe: MSDN:Preventing Hangs in Windows Applications Pin
Chuck O'Toole1-Nov-11 10:14
Chuck O'Toole1-Nov-11 10:14 
And don't forget this, which is what I've been saying

Using Messages and Message Queues[^]

SQL
Occasionally, an application needs to examine the contents of a thread's message queue from outside the thread's message loop. For example, if an application's window procedure performs a lengthy drawing operation, you may want the user to be able to interrupt the operation. Unless your application periodically examines the message queue during the operation for mouse and keyboard messages, it will not respond to user input until after the operation has completed. The reason for this is that the DispatchMessage function in the thread's message loop does not return until the window procedure finishes processing a message.

You can use the PeekMessage function to examine a message queue during a lengthy operation. PeekMessage is similar to the GetMessage function; both check a message queue for a message that matches the filter criteria and then copy the message to an MSG structure. The main difference between the two functions is that GetMessage does not return until a message matching the filter criteria is placed in the queue, whereas PeekMessage returns immediately regardless of whether a message is in the queue.

The following example shows how to use PeekMessage to examine a message queue for mouse clicks and keyboard input during a lengthy operation.

GeneralRe: MSDN:Preventing Hangs in Windows Applications Pin
Erudite_Eric2-Nov-11 7:02
Erudite_Eric2-Nov-11 7:02 
GeneralRe: MSDN:Preventing Hangs in Windows Applications Pin
Chuck O'Toole2-Nov-11 9:16
Chuck O'Toole2-Nov-11 9:16 
GeneralRe: MSDN:Preventing Hangs in Windows Applications Pin
Erudite_Eric2-Nov-11 11:25
Erudite_Eric2-Nov-11 11:25 
Generale: SetTimer Pin
Erudite_Eric1-Nov-11 22:06
Erudite_Eric1-Nov-11 22:06 
GeneralRe: SetTimer Pin
David Crow1-Nov-11 9:29
David Crow1-Nov-11 9:29 
GeneralRe: SetTimer Pin
Chuck O'Toole1-Nov-11 10:16
Chuck O'Toole1-Nov-11 10:16 
AnswerRe: SetTimer Pin
Mark Salsbery31-Oct-11 12:32
Mark Salsbery31-Oct-11 12:32 
GeneralRe: SetTimer Pin
Chuck O'Toole31-Oct-11 12:59
Chuck O'Toole31-Oct-11 12:59 
GeneralRe: SetTimer Pin
Mark Salsbery31-Oct-11 14:48
Mark Salsbery31-Oct-11 14:48 
GeneralRe: SetTimer Pin
Chuck O'Toole31-Oct-11 15:00
Chuck O'Toole31-Oct-11 15:00 
GeneralRe: SetTimer Pin
Erudite_Eric31-Oct-11 21:08
Erudite_Eric31-Oct-11 21:08 
GeneralRe: Thanks!!! Pin
columbos1492731-Oct-11 21:44
columbos1492731-Oct-11 21:44 
AnswerRe: example code with PumpMessages() Pin
App_1-Nov-11 8:53
App_1-Nov-11 8:53 
Questionalternative function for MCIWndCreate API Pin
VCProgrammer31-Oct-11 1:17
VCProgrammer31-Oct-11 1:17 
AnswerRe: alternative function for MCIWndCreate API Pin
Code-o-mat31-Oct-11 2:02
Code-o-mat31-Oct-11 2:02 
Question[SOLVED] Inline assembly syntax error.. Pin
CodingLover30-Oct-11 21:59
CodingLover30-Oct-11 21:59 
AnswerRe: Inline assembly syntax error.. Pin
Malli_S30-Oct-11 22:39
Malli_S30-Oct-11 22:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.