传它的指针嘛。
至于这里的callback函数,应该在你的程式中有一个函数,定义为全局或static
将它的地址传来就可以了。
这里的定时器,都是IDE自动搞定,不用费心思

解决方案 »

  1.   

    #define WIN32_LEAN_AND_MEAN#include <windows.h>#include <stdio.h>#include <conio.h> // A do-nothing TIMERPROC. Simply prints out the parametersVOID CALLBACK MyTimerProc( HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime ); int main(){// Set up a 50 millisecond timer which calls MyTimerProcSetTimer( 0, 0, 0x50, (TIMERPROC)MyTimerProc ); printf( "A timer proc has been set up. Press any key to call ""GetMessage/DispatchMessage\n" ); getch(); // Wait for user response. This gives enough time for at// least one timer cycle to have elapsed MSG msg = { 0, 0, 0, 0 }; // Get the message, and dispatch it. This causes MyTimerProc to be// invoked.if ( GetMessage(&msg, 0, 0, 0) )DispatchMessage( &msg );return 0;} VOID CALLBACK MyTimerProc( HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime ){printf( "In MyTimerProc: hwnd:%X uMsg:%X idEvent:%X dwTime:%X\n",hwnd, uMsg, idEvent, dwTime );}
      

  2.   

    TIMERPROC!!!!
    还有这么个类型,谢了!
    不过如果不用这个TIMERPROC该怎么写啊???
      

  3.   

    VOID (CALLBACK* MyTimerProc)(HWND, UINT, UINT, DWORD)应该不行吧!!