How to setup a timer?

Answers were Sorted based on User's Feedback



How to setup a timer?..

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

How to setup a timer?..

Answer / kamal

SetTimer(1, 10000, NULL);

Enter this function OnInitDialog()

Is This Answer Correct ?    0 Yes 0 No

How to setup a timer?..

Answer / kishore kumar naik p

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

Post New Answer

More MFC Interview Questions

plzz tell me what we can do and dont in tally ERP & sap business one?

0 Answers  


What is the command routing in MFC framework?

3 Answers  


Given two processes, how can they share memory?

2 Answers   Microsoft,


if i modified data in 1 view how does the other view knows

2 Answers   Siemens,


Which MFC function is used to display output?

9 Answers   TCS,






how do u identify RTTI in vc++

4 Answers   Siemens,


Hi All, i am new for VC++ SDK. i want to get the IP Address of all the External device connected with my local machine.please give the code Regards, Praveer

1 Answers   TCS, Tech Mahindra,


What is stack size in win32 program?

1 Answers   HCL,


How to find the mouse entering an image?..while entering need to display next image...

4 Answers  


What function is used to retrieve the currently selected index in a list box?

2 Answers  


How can update edit control data of an executing application from other application?

3 Answers   HP,


19)how to set Back Ground Picture to a Dialog Box in MFC ?

1 Answers  


Categories