Jump to content
  • Advertisement
Sign in to follow this  
Jouei

Win32 problem

This topic is 4227 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
Have you tried looking through MSDN? It's an excellent resource for anything to do with windows development.

Share this post


Link to post
Share on other sites
Yes but all they have is stuff to do with Dialog boxs where as i am not using them !

Share this post


Link to post
Share on other sites
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
MSDN says WM_COMMAND's lparam for a control holds the handle to the control winodw in this case a handle to the button.

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
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!