你好,关于你的问题,我也不太清楚原因,所以我也尝试着去写了一个程序验证一下,结果并没有出现你所说的情况。代码几乎跟你一样。而对于gww1bd 的回答,我则不同意,MSDN里有讲到如果第一个参数是空的,则第二个参数会被忽略。
而我又看到这么一段话:When you specify a TimerProc callback function, the default window procedure calls the callback function when it processes WM_TIMER. Therefore, you need to dispatch messages in the calling thread, even when you use TimerProc instead of processing WM_TIMER.
你可以尝试着去调用LRESULT DispatchMessage(
CONST MSG *lpmsg // message information
);
If the lpmsg parameter points to a WM_TIMER message and the lParam parameter of the WM_TIMER message is not NULL, lParam points to a function that is called instead of the window procedure.
你先试试 ,不行的话再联系我。