1. settimer (hwnd, uint, uint, timerproc); the first parameter is set as the window handle to capture the scheduled message, and the second parameter is the timer ID, the third parameter is the timer length in milliseconds, and the last parameter is set to null. The callback function of the window can process the wm_timer message. In general, settimer is called when the window is created; the wm_timer response is added to the callback function. Then, when the window is destroyed, killtimer (hwnd, uint) is destroyed. The parameters are the window handle and timer ID.
2. settimer (hwnd, uint, uint, timerproc); the only difference from the first method is that the last parameter is not null, but a self-defined callback function. In this way, the wm_timer message will be retrieved and processed by the custom callback function. Killtimer (hwnd, uint) should also be used at the end );
3. idtimer = settimer (hwnd, uint, uint, timerproc); set the first parameter to null, and the second parameter to 0, the settings of the third and fourth parameters are the same as those of the second method. When a timer is created, a timer ID is returned and killtimer (null, idtimer) is called when the timer is destroyed ). This method is suitable for the frequent obfuscation of timer IDs.ProgramBecause its return value is used to manage the timer ID, instead of managing it by yourself.