readme.wzd
来自「MFC扩展编程实例」· WZD 代码 · 共 64 行
WZD
64 行
/////////////////////////////////////////////////////////////////////
// Modify any class.
/////////////////////////////////////////////////////////////////////
// 1) to have timer call a time-out function when timed out
SetTimer(
1, // event ID, passed to time out process
1000, // time out time in milliseconds
CWzdView::TimerProc //timeout process called
);
// 2) define the time-out function in the class's include file
static void CALLBACK EXPORT TimerProc(HWND hWnd, UINT nMsg, UINT nIDEvent, DWORD dwTime);
// 3) implement the time-out function
void CALLBACK EXPORT CWzdView::TimerProc(HWND hWnd, UINT nMsg, UINT nIDEvent, DWORD dwTime)
{
// hWnd will be this window
// nMsg will be WM_TIMER
// nIDEvent will be the event id specified in SetTimer
// dwTime will be the current system time
}
// 4) to kill a timer
UINT timerID=SetTimer(3,3000,NULL);
KillTimer(
timerID // timer id returned from SetTimer()
);
/////////////////////////////////////////////////////////////////////
// Modify any class that owns a window.
/////////////////////////////////////////////////////////////////////
// 1) to have timer send a WM_TIMER message to this window when done
SetTimer(
2, // event ID
2000, // time in milliseconds
NULL); // causes a WM_TIMER message to be sent to this window
// 2) use the ClassWizard to add a WM_TIMER handler to this class.
// 3) implement the handler
void CWzdView::OnTimer(UINT nIDEvent)
{
// nIDEvent will be the event id specified in SetTimer
CView::OnTimer(nIDEvent);
}
// 4) to kill a timer
UINT timerID=SetTimer(3,3000,NULL);
KillTimer(
timerID // timer id returned from SetTimer()
);
/////////////////////////////////////////////////////////////////////
// From: Visual C++ MFC Programming by Example by John E. Swanke
// Copyright (C) 1999 jeswanke. All rights reserved.
/////////////////////////////////////////////////////////////////////
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?