Skip to main content
GameDev.net gamedev.net
🔒 Locked

win32 message proc

Started by Brobanx Aug 10, 2002 at 8:04 PM 3 replies 400+ views
Original Post
Brobanx
Brobanx
Ok, quick question. When I make a button by using the CreateWindow() function, I say that the classname is "BUTTON", and give a valid HWND as its parent. Do messages from the button get sent to the parent window''s message procedure? If not, what message procedure are they sent to? (since I can''t define a message procedure for a predefined windows class)
zealouselixir
zealouselixir
How are you defining the "BUTTON" window class? I''m assuming that''s your own thing, and if so, you give it the WndProc via the lpfnWndProc member of the window class object. Therefore, messages will be sent to the specified procedure with the hWnd param equal to the HWND returned by CreateWindow when you make your button.

Peace,
ZE.

//email me.//zealouselixir software.//msdn.//n00biez.//
miscellaneous links
[twitter]warrenm[/twitter]
Brobanx
Brobanx
In the Win32 SDK docs it says the BUTTON class is predefined (along with others like STATIC, RICHEDIT, etc...).
zealouselixir
zealouselixir
Yeah, see, that was my concern. I didn''t know that the button class was predefined. In that case, I don''t know. I''ll keep looking though (This is what MSDN coughed up).

One thing though: Is is definately "BUTTON", or could it just be BUTTON? MSDN doesn''t have quotes, which I found odd.

UPDATE: ButtonProc or OwnDrawProc, perhaps? I just don''t get how you specify the function, if you can.

G''luck,
ZE.

//email me.//zealouselixir software.//msdn.//n00biez.//
miscellaneous links
[twitter]warrenm[/twitter]
Oluseyi
Oluseyi
quote:
Original post by Brobanx
Do messages from the button get sent to the parent window''s message procedure?

Yes, and they''re handled via the WM_COMMAND message.

ZE: It''s "BUTTON". Some of the newer windowclasses that you gain with IE updates have their class names macro''d - REBARCLASS_NAME (or something like that) for "Win32_ReBarCtrl" (or something like that). All very inconsistent.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.