i have a button that is on a static window. how do i receive events such as when i press the button? is it something different than intercepting the event at the wm_command in the window proc? thanks smurf
Posted on 2001-06-05 19:55:00 by smurf
Smurf, Do you mean 'in a window' or 'on a window' i.e. who is the parent of the button. The parent will receive the WM_COMMAND message and the high word of wParam is BN_CLICKED. so if you made the static window the parent, it would be getting the message. If it's your window, you will get the message. umbongo
Posted on 2001-06-06 04:43:00 by umbongo
umbongo i created a normal window. on that window i created a tab control. on the tab control i created a static control. and finally on the static control i created a button. i have no clue how to get the receive the events from the button. ok the parent of my button is the static control. so where at in my code would i receive the event and could you show me a simple code snipet of what it may look like? thanks smurf This message was edited by smurf, on 6/6/2001 4:59:53 AM
Posted on 2001-06-06 04:57:00 by smurf
Smurf, Well, as we all know, there are two main bits with a window, the thing you can see on the screen, and the WndProc which does things to it, we all have our own WndProc for receiving messages, but only our direct children tell us what they are doing, otherwise we would get flooded with 100's of messages and it would be like having only one WndProc of all windows in the system - it would be HUGE!!! So you'll only get messages from the tab control, the tab control will only get messages from the static control, and the static control will get the button messages...... Unless you want to subslass the static control I'd suggest changing the hiearchy(sp?) of the windows. Make the button a child of the main window, that way you will get the button messages in your WndProc/DlgProc
Posted on 2001-06-06 06:17:00 by umbongo
i subclassed the parent of my button and it worked great. thanks smurf
Posted on 2001-06-06 19:37:00 by smurf