Location:
Search - ON_MESSAGE
Search list
Description: 使用方法:
1:
包含C++类CCADMgr头文件,如:#include \"CADMgr.h\"
2:
定义变量如:CCADMgr m_cadMgr
3: 设置Ctrl+Alt+Del消息通知窗口,如:m_cadMgr.SetTargetWnd(m_hWnd)
4: 禁用或启用,如:m_cadMgr.DisableCAD(m_bDisabled)
5: 响应消息:
声明函数:afx_msg void OnHotKey(WPARAM wParam, LPARAM lParam)
消息映射:ON_MESSAGE(WM_HOTKEY, OnHotKey)
函数实现:
void CTrapCADDlg::OnHotKey(WPARAM wParam, LPARAM lParam)
{
WORD wKey = HIWORD(lParam)
WORD wModifier = LOWORD(lParam)
BOOL bAltDown = ((wModifier & VK_MENU) != 0 ? TRUE : FALSE)
BOOL bCtrlDown = ((wModifier & VK_CONTROL) != 0 ? TRUE : FALSE)
//按下Ctrl + Alt + Del组合键
if(bCtrlDown && bAltDown && wKey == VK_DELETE)
AfxMessageBox(\"对不起, Ctrl+Alt+Delete组合键已经被禁用了!\", MB_OK|MB_IConERROR)
Platform: |
Size: 119281 |
Author: 王跃 |
Hits:
Description: 使用方法:
1:
包含C++类CCADMgr头文件,如:#include "CADMgr.h"
2:
定义变量如:CCADMgr m_cadMgr
3: 设置Ctrl+Alt+Del消息通知窗口,如:m_cadMgr.SetTargetWnd(m_hWnd)
4: 禁用或启用,如:m_cadMgr.DisableCAD(m_bDisabled)
5: 响应消息:
声明函数:afx_msg void OnHotKey(WPARAM wParam, LPARAM lParam)
消息映射:ON_MESSAGE(WM_HOTKEY, OnHotKey)
函数实现:
void CTrapCADDlg::OnHotKey(WPARAM wParam, LPARAM lParam)
{
WORD wKey = HIWORD(lParam)
WORD wModifier = LOWORD(lParam)
BOOL bAltDown = ((wModifier & VK_MENU) != 0 ? TRUE : FALSE)
BOOL bCtrlDown = ((wModifier & VK_CONTROL) != 0 ? TRUE : FALSE)
//按下Ctrl + Alt + Del组合键
if(bCtrlDown && bAltDown && wKey == VK_DELETE)
AfxMessageBox("对不起, Ctrl+Alt+Delete组合键已经被禁用了!", MB_OK|MB_IConERROR) -Usage: 1: contains C++ Category CCADMgr header files, such as:# Include
Platform: |
Size: 118784 |
Author: 王跃 |
Hits: