Retrieving events from window controls

Archives Forums/Win32 Discussion/Retrieving events from window controls

Odds On(Posted 2005) [#1]
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


Robert(Posted 2005) [#2]
Look for WM_LBUTTONUP or WM_KEYDOWN instead.


Kanati(Posted 2005) [#3]
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


skidracer(Posted 2005) [#4]
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.


Odds On(Posted 2005) [#5]
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


Sarge(Posted 2005) [#6]
yea Falcon thats the way im going with i spent 2 weeks researching this and i think its the best way.


Sarge(Posted 2005) [#7]
Falcon if your working with api if you got msn we can talk about it or come on to #blitzbasic on mirc