首先 你可以在OnInitDialog里设置一个定时器
CDialog::OnInitDialog();
// Add "About..." menu item to system menu.
// IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);
CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
}
// Set the icon for this dialog. The framework does this automatically
// when the application's main window i
C++获取程序窗口外的鼠标坐标
最新推荐文章于 2024-04-20 10:16:15 发布
本文介绍如何在C++应用程序中使用OnInitDialog设置定时器,并通过OnTimer消息处理函数获取鼠标在屏幕上的实时坐标。通过GetCursorPos函数获取到鼠标位置后,更新对话框显示。
摘要由CSDN通过智能技术生成