Click here to Skip to main content
16,006,006 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionWM_TIMER Pin
Hakan Bulut30-Dec-07 23:21
Hakan Bulut30-Dec-07 23:21 
GeneralRe: WM_TIMER Pin
CPallini30-Dec-07 23:33
mveCPallini30-Dec-07 23:33 
GeneralMessage Closed Pin
31-Dec-07 0:04
Hakan Bulut31-Dec-07 0:04 
GeneralRe: WM_TIMER Pin
CPallini31-Dec-07 0:05
mveCPallini31-Dec-07 0:05 
GeneralRe: WM_TIMER Pin
Hakan Bulut31-Dec-07 0:09
Hakan Bulut31-Dec-07 0:09 
GeneralRe: WM_TIMER Pin
Hakan Bulut31-Dec-07 0:18
Hakan Bulut31-Dec-07 0:18 
GeneralRe: WM_TIMER Pin
CPallini31-Dec-07 0:28
mveCPallini31-Dec-07 0:28 
GeneralRe: WM_TIMER Pin
CPallini31-Dec-07 0:23
mveCPallini31-Dec-07 0:23 
Oh, it isn't such a difficult topic.
If you need a timer, i.e. a message that OS periodically sends to your window then set a timer (using SetTimer method), specifying:
(1) The timer indentifier, i.e. a number that maybe useful if you app uses two or more timers (though I don't suggest you to use many timers).
(2) The timer elapse, i.e. the time interval separating two timer messages, expressed in ms. Hence, if you need that you timer message handler is called every second, use 1000 as elapse.
(3) an (optional) pointer to a timer callback routine (At the moment,ignore it: use NULL).


Inside OnTimer the message handler:
(1) Check if the timer identifier is the proper one (you may skip this point if you have only a timer in your app, but I don't recommend this behaviour).
(2) Do the timer related operations.

Thats all.

See, there is also an example http://msdn2.microsoft.com/en-us/library/49313fdf(VS.71).aspx[^]
there is also an example.

If you have any doubt, please be detailed about.

Smile | :)

If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.

[my articles]


GeneralOnKeyUp() Pin
Anu_Bala30-Dec-07 22:41
Anu_Bala30-Dec-07 22:41 
GeneralRe: OnKeyUp() Pin
CPallini30-Dec-07 22:58
mveCPallini30-Dec-07 22:58 
GeneralRe: OnKeyUp() Pin
Naveen30-Dec-07 23:07
Naveen30-Dec-07 23:07 
GeneralRe: OnKeyUp() Pin
Nishad S30-Dec-07 23:16
Nishad S30-Dec-07 23:16 
GeneralRe: OnKeyUp() Pin
Anu_Bala30-Dec-07 23:33
Anu_Bala30-Dec-07 23:33 
GeneralRe: OnKeyUp() Pin
Naveen30-Dec-07 23:44
Naveen30-Dec-07 23:44 
QuestionRe: OnKeyUp() Pin
Florin Crişan31-Dec-07 2:12
Florin Crişan31-Dec-07 2:12 
GeneralMouse Notifications Pin
Developer61130-Dec-07 22:39
Developer61130-Dec-07 22:39 
QuestionRe: Mouse Notifications Pin
CPallini30-Dec-07 22:46
mveCPallini30-Dec-07 22:46 
GeneralRe: Mouse Notifications Pin
Developer61130-Dec-07 22:55
Developer61130-Dec-07 22:55 
GeneralRe: Mouse Notifications Pin
CPallini30-Dec-07 23:02
mveCPallini30-Dec-07 23:02 
GeneralRe: Mouse Notifications Pin
Developer61130-Dec-07 23:08
Developer61130-Dec-07 23:08 
GeneralYou're welcome. Pin
CPallini30-Dec-07 23:16
mveCPallini30-Dec-07 23:16 
GeneralWindows Services Pin
Vaibhav Gade30-Dec-07 22:25
Vaibhav Gade30-Dec-07 22:25 
GeneralRe: Windows Services Pin
CPallini30-Dec-07 22:30
mveCPallini30-Dec-07 22:30 
GeneralQuestion here Pin
I&J30-Dec-07 20:47
I&J30-Dec-07 20:47 
QuestionRe: Question here Pin
CPallini30-Dec-07 21:03
mveCPallini30-Dec-07 21:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.