Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Generating WM_TIMER messages

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
It's perhaps quite a simple question, but i'm triying to do the following:
I write a MFC application (with VC++6) and and know how to react to messages like WM_TIMER, WM_LDUTTONDOWN and so on; but the question is how can i make windows to generate a WM_TIMER message all 100 miliseconds...
Thanks for any help
 
you should alloc a timer:
SetTimer(hWnd,ID_TIMER,100,lpfnTimerProc);
hEnd is the windoe what receive timer messages. ID_TIMER is some number what will be in your program the timer ID. Is up to you what number to put. Once you put it, this number you will use as timer ID for kill it as example. The third parameter is number of milliseconds. The last can be null. In this case you will process timer messages in WndProc.
after using timer you should KillTimer(NULL,ID_TIMER). John Fill
1c.bmp


ivfmd@mail.md
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top