Retrieving events from window controls
Archives Forums/Win32 Discussion/Retrieving events from window controls
| ||
I'm having a bit of trouble gettings events from child windows controls. For example, if I create a window and then create a button directly on the window then the button sends a WM_COMMAND message to the window and I can retrieve it easily enough. However, if I create a static container control on the window, and then create a button on the static container, the WM_COMMAND message gets sent to the static container instead of the window, and I have no idea how to retrieve the event from there. Thanks, Chris |
| ||
Look for WM_LBUTTONUP or WM_KEYDOWN instead. |
| ||
ermmmm... like you said, the container then becomes the button's parent instead of the window. So you'll get messages to the hwnd of the container. I'd have to see how you are checking before I could answer. Been quite a while since I've done low level winder messaging like that. Kanati |
| ||
One method is to set the proc handler of your static container using SetWindowLong and the GWL_WNDPROC option although there is possibly a simpler method where the container should be passing all unhandled events to it's parent. |
| ||
Hi skidracer, Yeah that's the method I've gone with. I done a lot of searching, and Subclassing appears to be the way to go. Thanks, Chris |
| ||
yea Falcon thats the way im going with i spent 2 weeks researching this and i think its the best way. |
| ||
Falcon if your working with api if you got msn we can talk about it or come on to #blitzbasic on mirc |