How to setup a timer?
Answers were Sorted based on User's Feedback
Answer / arvin
The SetTimer function creates a timer with the specified
time-out value.
Syntax
UINT_PTR SetTimer(
HWND hWnd,
UINT_PTR nIDEvent,
UINT uElapse,
TIMERPROC lpTimerFunc
);
Example:
SetTimer(1, 200, 0);
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / kamal
SetTimer(1, 10000, NULL);
Enter this function OnInitDialog()
| Is This Answer Correct ? | 0 Yes | 0 No |
We can set the timer using SetTimer method, this method
posts WM_TIMER message after every 'X' seconds configured,
The message will be placed in the message queue of the
application and application takes little time to take the
message and process so these are not accurate.
For accurate timers we have Multimedia timers,
To start a multimedia timer we can use
MMRESULT timeSetEvent(
UINT uDelay,
UINT uResolution,
LPTIMECALLBACK lpTimeProc,
DWORD_PTR dwUser,
UINT fuEvent
);
To kill a multimedia timer
MMRESULT timeKillEvent(
UINT uTimerID
);
Refers MSDN for more
| Is This Answer Correct ? | 0 Yes | 0 No |
1)How to change the size of a button at run time ?
List out the parameters of WinMain Function.
1)how to Display the File Dialog Box, in MFC ?
what is message Testing ?
In SDI how many view's are attached to document object and in MDI how many view's are attached to Document object?
what is message loop how mfc does it internally?
How many types of dialog box are their
What function is called by a document class to notify views that the document has been changed?
How can we create thread in MFC framework?
How can update edit control data of an executing application from other application?
What is CSingleDocTemplate?
How to create a Modeless Dialog?