class A
{
public:
void static CALLBACK TimeProc(
HWND hwnd,
UINT message,
UINT idTimer,
DWORD dwTime);
};
int main()
{
SetTimer(NULL,1,1000,A::TimeProc);
MSG msg;
while(GetMessage(&msg,NULL,0,0))
{
if(msg.message==WM_TIMER)
{
DispatchMessage(&msg);
}
}
return 0;
}
void CALLBACK A::TimeProc(
HWND hwnd,
UINT message,
UINT idTimer,
DWORD dwTime)
{
cout<<"触发定时器!"<<endl;
}