在原有SDK5(note上)里的代码上添加了
timer的消息
LRESULT OnCreate(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {OutputDebugString(_T("[11syy]WM_CREATE\n"));//创建一个计时器SetTimer(hwnd, 1, 1000, nullptr);return TRUE;
}LRESULT OnClese(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {OutputDebugString(_T("[11syy]WM_ClOSE\n"));DestroyWindow(hwnd);return TRUE;
}LRESULT OnDestroy(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{PostMessage(hwnd, WM_QUIT, 0, NULL);OutputDebugString(_T("[11syy]WM_DESTROY\n"));//销毁一个定时器KillTimer(hwnd, 1);return TRUE;
}
每一秒发送一个timer的消息
控件消息
// 创建子窗口(控件)HWND hBtutton1 = CreateWindowEx(0,"BUTTON","取消",WS_CHILD|WS_VISIBLE,0,0,100,50,hwnd,NULL,hInstance,NULL);