Click here to Skip to main content
15,920,030 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generaltrying to prevent enter key from making dlg vanish Pin
ns24-Sep-03 4:29
ns24-Sep-03 4:29 
GeneralRe: trying to prevent enter key from making dlg vanish Pin
Ravi Bhavnani24-Sep-03 4:31
professionalRavi Bhavnani24-Sep-03 4:31 
GeneralRe: thanks... Pin
ns24-Sep-03 4:44
ns24-Sep-03 4:44 
GeneralRe: thanks... Pin
Ravi Bhavnani24-Sep-03 4:52
professionalRavi Bhavnani24-Sep-03 4:52 
GeneralRe: thanks... Pin
ns24-Sep-03 9:57
ns24-Sep-03 9:57 
GeneralRe: trying to prevent enter key from making dlg vanish Pin
includeh1024-Sep-03 4:44
includeh1024-Sep-03 4:44 
QuestionWhat happens if thread is Slept() and WM_MESSAGE received? Pin
vgrigor24-Sep-03 4:28
vgrigor24-Sep-03 4:28 
AnswerRe: What happens if thread is Slept() and WM_MESSAGE received? Pin
Mike Dimmick24-Sep-03 9:30
Mike Dimmick24-Sep-03 9:30 
If you call Sleep, the thread is blocked. No messages will be processed until Sleep returns, once the duration has timed out. Execution will resume - on that thread - with the statement after Sleep (just like any other function call).

Message processing only occurs inside GetMessage, PeekMessage, or one of their siblings. If the thread is busy doing something, the messages queue up. If the message was sent from another thread (using SendMessage or one of its siblings), the message is processed entirely inside GetMessage. Otherwise, GetMessage returns the message in a MSG structure; it's up to the application to process it how it chooses. Typically that involves DispatchMessage to pass the message on to the window procedure for the window.

If you use SendMessage to send a message to a window on the same thread, SendMessage calls the window's window procedure directly.

The only way I've found to block for a period of time and still process window messages is to use the MsgWaitForMultipleObjects family of functions.
GeneralSTL Getting on my t*ts Pin
R Chin24-Sep-03 4:21
sussR Chin24-Sep-03 4:21 
GeneralRe: STL Getting on my t*ts Pin
jhwurmbach24-Sep-03 4:47
jhwurmbach24-Sep-03 4:47 
GeneralRe: STL Getting on my t*ts Pin
RChin24-Sep-03 4:56
RChin24-Sep-03 4:56 
GeneralRe: STL Getting on my t*ts Pin
RobJones24-Sep-03 5:11
RobJones24-Sep-03 5:11 
GeneralRe: STL Getting on my t*ts Pin
jhwurmbach24-Sep-03 5:25
jhwurmbach24-Sep-03 5:25 
GeneralRe: STL Getting on my t*ts Pin
RobJones24-Sep-03 5:42
RobJones24-Sep-03 5:42 
GeneralRe: STL Getting on my t*ts Pin
markkuk24-Sep-03 5:38
markkuk24-Sep-03 5:38 
GeneralRe: STL Getting on my t*ts Pin
RChin24-Sep-03 5:41
RChin24-Sep-03 5:41 
Questionhow to clear the txt froma file and rewrite? Pin
ns24-Sep-03 4:16
ns24-Sep-03 4:16 
AnswerRe: how to clear the txt froma file and rewrite? Pin
RChin24-Sep-03 4:25
RChin24-Sep-03 4:25 
GeneralStream OLE objects into a CRichEditCtrl Pin
CodeBrain24-Sep-03 2:39
CodeBrain24-Sep-03 2:39 
GeneralRe: Stream OLE objects into a CRichEditCtrl Pin
Joel Lucsy24-Sep-03 2:47
Joel Lucsy24-Sep-03 2:47 
GeneralRe: Stream OLE objects into a CRichEditCtrl Pin
CodeBrain24-Sep-03 3:13
CodeBrain24-Sep-03 3:13 
GeneralRe: Stream OLE objects into a CRichEditCtrl Pin
CodeBrain24-Sep-03 4:14
CodeBrain24-Sep-03 4:14 
Generalscale control in inches Pin
KKR24-Sep-03 2:15
KKR24-Sep-03 2:15 
Generalerror with deleting database record Pin
coda_x24-Sep-03 2:00
coda_x24-Sep-03 2:00 
GeneralRe: error with deleting database record Pin
Terry O'Nolley24-Sep-03 5:46
Terry O'Nolley24-Sep-03 5:46 

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.