Can any one please tell me how can i make my application wait for a few
seconds before it processes my instructions.Which API can be Used and How?
Posted on 2003-04-09 01:39:34 by telophase

The SetTimer function creates a timer with the specified time-out value.

UINT SetTimer(

HWND hWnd, // handle of window for timer messages
UINT nIDEvent, // timer identifier
UINT uElapse, // time-out value
TIMERPROC lpTimerFunc // address of timer procedure



Identifies the window to be associated with the timer. This window must be owned by the calling thread. If this parameter is NULL, no window is associated with the timer and the nIDEvent parameter is ignored.


Specifies a nonzero timer identifier. If the hWnd parameter is NULL, this parameter is ignored.


Specifies the time-out value, in milliseconds.


Points to the function to be notified when the time-out value elapses. For more information about the function, see TimerProc.
If lpTimerFunc is NULL, the system posts a WM_TIMER message to the application queue. The hwnd member of the message's MSG structure contains the value of the hWnd parameter.

Return Values

If the function succeeds, the return value is an integer identifying the new timer. An application can pass this value, or the string identifier, if it exists, to the KillTimer function to destroy the timer. If the function fails to create a timer, the return value is zero.


An application can process WM_TIMER messages by including a WM_TIMER case statement in the window procedure or by specifying a TimerProc callback function when creating the timer. When you specify a TimerProc callback function, the DispatchMessage function simply calls the callback function instead of the window procedure. Therefore, you need to dispatch messages in the calling thread, even when you use TimerProc instead of processing WM_TIMER.

The wParam parameter of the WM_TIMER message contains the value of the nIDEvent parameter.

Process the message WM_TIMER.
Posted on 2003-04-09 02:18:39 by roticv
Or if you just want to pause execution for a bit then use Sleep(). :alright:
Posted on 2003-04-09 02:21:04 by iblis
i hope this isnt bothering you but, i have searched for a timer on this board and havefound nothing that works,
could u explain to me how to make a timer and then put it into an edit box so it looks like a counter?

im sorry for pming u with such arbitrary things but i didnt want to waste space on the board with such a silly question,


Here is a working source... (RadASM project)
Posted on 2003-08-27 19:46:45 by NaN
I wrote a program that displays systemtime and system date on a form and updates every second, so you have a working clock on a form :grin:

written in radasm
Posted on 2003-08-27 22:49:39 by Ranma_at