I have a win32 form, and a button on it. But I have 1 problem, how do I know when the user clicks the button?
I have this code so far:
Look at the case WM_COMMAND case. That works perfectly, I can tell what button is pressed and do actions acordingly. But I am wondering is that correct? Slow? And is there a better more effecient way?
LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
switch (message) /* handle the messages */
if ((HWND) lParam == hwnd2)
DeleteFile("Copy of Test.txt");
PostQuitMessage (0); /* send a WM_QUIT to the message queue */
default: /* for messages that we don't deal with */
return DefWindowProc (hwnd, message, wParam, lParam);
Also the topic title says BN_CLICKED, but that doesn't work and msdn says it sends BN_CLICKED in the form of WM_COMMAND.