How do I manipulate the WM_TIMER message in a console program? Here is my code:
I know there isn't much about timers in there, but if you all could just tell me how to manipulate WM_TIMER, I'd be grateful.PHP Code:#include <iostream.h>
#include <windows.h>
void sleep(int milliseconds);
void time();
int main()
{
HWND myhwnd;
myhwnd = FindWindow("ConsoleWindowClass", NULL);
SetTimer(myhwnd, 1, 1000, NULL);
cout << "Hello." << endl;
cout << "Exiting in 2 seconds.";
sleep(2000);
return 0;
}
void sleep(int milliseconds)
{
Sleep(milliseconds);
}
void time()
{
HWND myhwnd;
myhwnd = FindWindow("ConsoleWindowClass", NULL);
MessageBox(myhwnd, "Hello, this is a timer", "MOO!!", NULL);
}




Reply With Quote