更新时间:2023-11-19 21:59:16
只需使用SetTimer
方法,并传递两个参数:计时器ID(任意数字)和超时(以毫秒为单位).然后编写OnTimer
实现,并在BEGIN_MESSAGE_MAP...END_MESSAGE_MAP
内写一个条目ON_WM_TIMER
.
Just use SetTimer
method, and pass two arguments: Timer ID (any number), and the timeout in milliseconds. Then write up OnTimer
implementation, and an entry ON_WM_TIMER
inside BEGIN_MESSAGE_MAP...END_MESSAGE_MAP
.
CWnd :: SetTimer 接受3个参数,但仅需要2个.将第三个参数传递为NULL.
CWnd::SetTimer takes 3 parameters, but only 2 are required. Pass third argument as NULL.