Click here to Skip to main content
16,011,947 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralMenu Pin
Eric MILLAUD25-Feb-01 21:45
Eric MILLAUD25-Feb-01 21:45 
GeneralUsing Events hooks... Pin
TomK25-Feb-01 21:25
TomK25-Feb-01 21:25 
Generalwin2k file protection Pin
25-Feb-01 19:31
suss25-Feb-01 19:31 
GeneralRe: win2k file protection Pin
l a u r e n26-Feb-01 5:58
l a u r e n26-Feb-01 5:58 
GeneralRe: win2k file protection Pin
26-Feb-01 6:43
suss26-Feb-01 6:43 
GeneralRe: win2k file protection Pin
l a u r e n26-Feb-01 10:32
l a u r e n26-Feb-01 10:32 
GeneralRe: win2k file protection Pin
Erik Funkenbusch26-Feb-01 12:37
Erik Funkenbusch26-Feb-01 12:37 
QuestionIs this simplified picture of message pumping correct? Pin
25-Feb-01 5:11
suss25-Feb-01 5:11 
Is this simplified picture of message pumping correct?

1. The user clicks a mouse button.

2. The mouse driver puts an item into the system input queue.

3. A system thread, which handles user input, retrieves this item and, using
coordinates recorded by the driver, determines to which window this message
should be posted. Mouse messages are always sent to the window under the
cursor (unless another window has captured mouse input).

Given the window handle the system detemines the thread to which this window
belongs and posts WM_LBUTTONDOWN and WM_LBUTTONUP messages to the
message queue of this thread. Note, the message is posted to only one message
queue since the system knowns to which thread the window belongs.

4. The application object, derived from CWinApp, will pickup the message from its thread message queue. Then route this message to the appropriate controls/windows.

5. Button window procedure receives WM_LBUTTONUP message and do the following:
(i) update the display of the button (depressed state and then the release state.)

//QUESTION: SendMessage( ) OR PostMessage( )??
(ii) sends WM_COMMAND/BN_CLICKED notification to "the parent window" or a "particular" control.
(iii) posts WM_COMMAND/BN_CLICKED notification to the application/thread message queue.

5. Message map can be "expanded" to a subroutine that searches the message map upon reciept of a message/notification, then route the message to "appropriate" message handler in response a mapped message.
(This brings up the issue of message routing. ie. Things like searching the view class maps, then the document class, then the frame windows, then the app...)

//Example of a handler:
void CMyDlg::OnButton1()
{
// TODO: Add your control notification handler code here

}

Thanks


GeneralVisual C++ Bug?! (bitwise operations). Pin
25-Feb-01 0:44
suss25-Feb-01 0:44 
GeneralRe: Visual C++ Bug?! (bitwise operations). Pin
Paul Wolfensberger25-Feb-01 4:02
Paul Wolfensberger25-Feb-01 4:02 
Questionhow to put combo box on menu bar Pin
24-Feb-01 15:48
suss24-Feb-01 15:48 
AnswerRe: how to put combo box on menu bar Pin
l a u r e n24-Feb-01 22:55
l a u r e n24-Feb-01 22:55 
GeneralRe: how to put combo box on menu bar Pin
25-Feb-01 10:36
suss25-Feb-01 10:36 
GeneralDynamically resizing a static control Pin
FranzAKlein24-Feb-01 3:01
FranzAKlein24-Feb-01 3:01 
GeneralRe: Dynamically resizing a static control Pin
l a u r e n24-Feb-01 4:07
l a u r e n24-Feb-01 4:07 
GeneralRuler Control Pin
FranzAKlein24-Feb-01 2:35
FranzAKlein24-Feb-01 2:35 
GeneralRe: Ruler Control Pin
l a u r e n24-Feb-01 4:02
l a u r e n24-Feb-01 4:02 
GeneralRe: Ruler Control Pin
26-Feb-01 8:24
suss26-Feb-01 8:24 
GeneralRe: Ruler Control Pin
l a u r e n26-Feb-01 10:41
l a u r e n26-Feb-01 10:41 
GeneralRe: Ruler Control Pin
26-Feb-01 22:56
suss26-Feb-01 22:56 
GeneralRe: Ruler Control Pin
Erik Funkenbusch26-Feb-01 12:43
Erik Funkenbusch26-Feb-01 12:43 
GeneralRe: Ruler Control Pin
26-Feb-01 23:26
suss26-Feb-01 23:26 
GeneralCasting thread functions Pin
Joe Moldovan23-Feb-01 23:53
Joe Moldovan23-Feb-01 23:53 
GeneralRe: Casting thread functions Pin
Tim Deveaux24-Feb-01 3:57
Tim Deveaux24-Feb-01 3:57 
GeneralRe: Casting thread functions Pin
Joe Moldovan24-Feb-01 9:32
Joe Moldovan24-Feb-01 9:32 

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.