我写了个对话框程序一直在后台运行,我想通过一个热键,就把对话框显示出来,我试着用CHotKeyCtrl对象,可是CHotKeyCtrl::Create()里的参数不知道写些什么,有没有前辈教教我该怎么做啊?

解决方案 »

  1.   

    CHotKeyCtrl::Create
    BOOL Create( DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID );Return ValueNonzero, if initialization was successful; otherwise 0.ParametersdwStyleSpecifies the hot key control’s style. Apply any combination of control styles.rectSpecifies the hot key control’s size and position. It can be either a CRect object or a RECT structure.pParentWndSpecifies the hot key control’s parent window, usually a CDialog. It must not be NULL.nIDSpecifies the hot key control’s ID.对着填吧
      

  2.   

    可以直接用:
    ::RegisterHotKey(this->m_hWnd,0Xa006,MOD_CONTROL,'9');然后在PreTranslateMessage中处理该注册的热键:Ctrl+9;
    if(pMsg->message==WM_HOTKEY)
    if(pMsg->wParam==0Xa006)
                          //do sth