Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

wah_on_2

What message will return when press button?

This topic is 6196 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i used CreateWindow("BUTTON"....); to create a button, but what message will return when i click it? And how can i know which button is clicked if i have 10 buttons in a window? Thanks!

Share this post


Link to post
Share on other sites
Advertisement
WM_COMMAND is the message that gets sent...
from the Win32 API Help File:

WM_COMMAND
wNotifyCode = HIWORD(wParam); // notification code
wID = LOWORD(wParam); // item, control, or accelerator
// identifier
hwndCtl = (HWND) lParam; // handle of control

wNotifyCode: Value of the high-order word of wParam. Specifies the notification code if the message is from a control. If the message is from an accelerator, this parameter is 1. If the message is from a menu, this parameter is 0.
wID: Value of the low-order word of wParam. Specifies the identifier of the menu item, control, or accelerator.
hwndCtl: Value of lParam. Identifies the control sending the message if the message is from a control. Otherwise, this parameter is NULL.

HTH...

--- krez (krezisback@aol.com)

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!