Detecting if one of the buttons was pressed?

Hey,

Here's what im having trouble with;

1
2
3
HWND ebutton;
HWND mbutton;
HWND pbutton;


1
2
3
pbutton = CreateWindow("Button", "Play", WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, 350, 500, 100, 25, hwnd, NULL, hInstance, 0);
	 ebutton = CreateWindow("Button", "Quit", WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, 500, 500, 100, 25, hwnd, NULL, hInstance, 0);
	 mbutton = CreateWindow("Button", "Multiplayer", WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, 200, 500, 100, 25, hwnd, NULL, hInstance, 0);


switch(test) works only with test = messagebox becasue i can assign a integral value to it. How can i detect if the button is pressed with this?

Thanks!!
Last edited on
You need to create a message loop and write a function to handle these messages
see this tutorial: http://www.winprog.org/tutorial/window_click.html
So, if i create the msg loop, can i detect if the person clicks Quit, play or Multiplayer?

EDIT: The msg loop didn't help, any other ideas?
Last edited on
Fixed
Last edited on
Topic archived. No new replies allowed.