-
I have a question..does anyone know how to make a timer in C++? Could someone tell me the code, please? thanks! This isnt a windows app...it's dos with a windows message box in it. I am using Dev-C++ and i dont know what compiler. Dev-C++ is a free builder. It's at www.bloodshed.net. So, does anyone have a code for a non-windows app.?
-
It's quite difficult to make a timer if you're unable to use the Windows service functions like SetTimer and KillTimer. What compiler are you using?
-
If you are making windows app.
Code:
#include <windows.h>
const ID_TIME = 15;
SetTimer(hDlg,ID_TIME,1,NULL);
case WM_TIMER:
//code
break;
-
If you want, you could also have a separate procedure for the timer, by specifying the procedure in the last argument.