About the return value of SetTimer function

Return Value

If the function succeeds and the hWnd parameter is NULL, the return value is an integer identifying the new timer. An application can pass this value to the KillTimer function to destroy the timer.

If the function succeeds and the hWnd parameter is not NULL, then the return value is a nonzero integer. An application can pass the value of the nIDEvent parameter to the KillTimer function to destroy the timer.

If the function fails to create a timer, the return value is zero. To get extended error information, call GetLastError.

 

 

From : MSDN

 

PS : 当参数hWnd为NULL时,返回的非空整数代表什么意义呢?从实际编程来看,返回的是参数nIDEvent的值,所以只要返回值不是零,KillTimer 就可以使用SetTimer的返回值作为参数。

你可能感兴趣的:(编程,timer,function,null,Integer,application)