- 0
- 0
- 约8.2千字
- 约 10页
- 2017-08-26 发布于湖北
- 举报
实验五 消息和命令
一 实验目的
熟悉利用 VC 集成化环境建立对 Windows 下的消息和命令响应的方法
掌握窗口间消息的传递方法
掌握用户自定义消息及响应方法
了解利用 SendMessage 或 PostMessage 进行窗口间数据传递方法
二 实验要求
1、利用 MFC 中 CWnd 类的时间函数,完成具有“定时”功能的任务,如画一个不停变换直径的园。当鼠标左键单击时,圆心由鼠标位置开始由小到大变换,利用鼠标右键单击停止画园等。
提示: CWnd 中的时间函数:
SetTimer : Installs a system timer that sends a WM_TIMER message when triggered.
KillTimer: Kills a system timer.
Example // This example shows how to use CWnd::SetTimer, CWnd::KillTimer, and how to handle WM_TIMER messages. A timer is set up to send a WM_TIMER message to the main frame window every 2 seconds in OnStartTimer(). OnStopTimer will stop th
原创力文档

文档评论(0)