04-18-2015, 08:25 PM
Sorry to kick this topic up, but I do not understand something.
The settimer line:
The "gTimer SendMessage" line
If I disable the "gTimer SendMessage" line, the function seems to work exactly the same as with the "gTimer SendMessage" line enabled.
From:
https://msdn.microsoft.com/en-us/librar ... 85%29.aspx
nIDEvent [in]
Type: UINT_PTR
A nonzero timer identifier. If the hWnd parameter is NULL, and the nIDEvent does not match an existing timer then it is ignored and a new timer ID is generated. If the hWnd parameter is not NULL and the window specified by hWnd already has a timer with the value nIDEvent, then the existing timer is replaced by the new timer. When SetTimer replaces a timer, the timer is reset. Therefore, a message will be sent after the current time-out value elapses, but the previously set time-out value is ignored. If the call is not intended to replace an existing timer, nIDEvent should be 0 if the hWnd is NULL.
The timer identifier has already been set in:
So the below code always catches the timer id "1"
QUESTION:
Am I correct that I can safely remove the "gTimer SendMessage" line: SendMessage hDlg WM_TIMER 1 0 ?
The settimer line:
The "gTimer SendMessage" line
If I disable the "gTimer SendMessage" line, the function seems to work exactly the same as with the "gTimer SendMessage" line enabled.
From:
https://msdn.microsoft.com/en-us/librar ... 85%29.aspx
UINT_PTR WINAPI SetTimer(
_In_opt_ HWND hWnd,
_In_ UINT_PTR nIDEvent,
_In_ UINT uElapse,
_In_opt_ TIMERPROC lpTimerFunc
);
nIDEvent [in]
Type: UINT_PTR
A nonzero timer identifier. If the hWnd parameter is NULL, and the nIDEvent does not match an existing timer then it is ignored and a new timer ID is generated. If the hWnd parameter is not NULL and the window specified by hWnd already has a timer with the value nIDEvent, then the existing timer is replaced by the new timer. When SetTimer replaces a timer, the timer is reset. Therefore, a message will be sent after the current time-out value elapses, but the previously set time-out value is ignored. If the call is not intended to replace an existing timer, nIDEvent should be 0 if the hWnd is NULL.
The timer identifier has already been set in:
So the below code always catches the timer id "1"
QUESTION:
Am I correct that I can safely remove the "gTimer SendMessage" line: SendMessage hDlg WM_TIMER 1 0 ?