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 |
What is the difference between hinsrtance and hprevinstance in WinMain function?
what is the updated verssion in vc++
how to give colour for dialog button or static buuto?any one explain full code ?pls pls
Tell me the different controls in MFC ?
1) Enable or disable a Cancel button at run time?
What is the base class for most MFC classes?
Whats is DDX & DDV in MFC?
1)How to change the size of a button at run time ?
How to convert the content of buffer into lower case character.
What is the initial function to be called in MFC and what it will do
what is the size of a process
2.create for 10 batch: Employee_Number Employee_name Employee_Dateofjoining Employee_address Employee_salary 1.select the employee name who deriving more than 10 thousand salary and joined before august 08. use structure and pointers