Hmm, by function to use it i am assuming you are asking how do you handle it when its pressed...
For starters you havnt assigned your button with an ID which you need to do to handle it.
Correct Way:
Code:
#define ID_BUTTON 2556
HWND hWndButton = CreateWindow("BUTTON", "My Button", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE,
10, 10, 65, 15, hWnd, (HMENU)ID_BUTTON, hInstance, 0);
Ok your button now has an ID, now you handle a message when its pressed, more specifically WM_COMMAND.
Do this in your main message loop:
Code:
case WM_COMMAND:
{
switch(wParam)
{
case ID_BUTTON:
{
//executed when your butttons pressed
MessageBox(hWnd, "Button was clicked!!!", "Event...", MB_OK);
}
}
}
Hope that helps,
TNT