• Advertisement
Sign in to follow this  

Win32 problem

This topic is 4051 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

Hello allz wasnt sure where to post this so i figured here would be good! Im creating a networked piece of game software and for the life of me i cant remmber how some of the windows api works since iv been doing for directX for awhile now. i just need to know how to handel button clicked flags int he message proc. under the WM_COMMAND !

Share this post


Link to post
Share on other sites
Advertisement
the same should be done i think.But the ideal is that you switch through the id of the controls and when id is pressed handle the action..


will give more details if needed.

Share this post


Link to post
Share on other sites

i just cant seem to remmber how to switch for the actual control being used !
say the handle to the control that was clicked was HWND Send;


case WM_COMMAND:
switch(LOWORD(wParam)) // This switch identifies the control
{

switch(HIWORD(wParam)) // Find out what message it was
{
case BN_CLICKED: // This means that the list is about to display
MessageBox(hwnd,"Test",NULL,MB_OK);
break;
}
break;
}
break;

Share this post


Link to post
Share on other sites
try this

case WM_COMMAND:
switch(LOWORD(wParam)) {
case IDM_FILE_SAVE:
break;
case IDM_FILE_CLOSE:
break;
}

where case xxx is the value of the button when created. The resouce identifier I beleive it is called. Should do what you want but have not tested it. The "Control notification message" is stored in HIGHWORK(wParam) it is specific to control and as said above i think you would put an extra case with value BN_CLICKED

MSDN http://msdn2.microsoft.com/en-us/library/ms647591.aspx

Share this post


Link to post
Share on other sites
You see im not useing a resource editor! im useing Visaul C++ express edition that dosent have a resource editor!

Share this post


Link to post
Share on other sites
When i try using the windows handle in the case i get this error

error C2051: case expression not constant

i created the button using CreateWindowEx

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement