怎样在热键呼出的同时带出原窗口的进程id,就像fpe一样?

解决方案 »

  1.   

    RegisterHotKey(m_hWnd,0Xa002,0, VK_F1);
    ::SetFocus(m_hWnd);**************************************************BOOL CMySysHotKeyDlg::PreTranslateMessage(MSG* pMsg) 
    {
    // TODO: Add your specialized code here and/or call the base class
    if (pMsg->message==WM_HOTKEY && pMsg->wParam==0Xa002)
    {
    DWORD dwProcessId = GetCurrentProcessId();
    CString strProcess;
    strProcess.Format(_T("Current Process Id : %ld"),dwProcessId);
    AfxMessageBox(strProcess);
    }
    return CDialog::PreTranslateMessage(pMsg);
    }LRESULT CMySysHotKeyDlg::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) 
    {
    // TODO: Add your specialized code here and/or call the base class
    if(message == WM_CLOSE)
    {
    ::UnregisterHotKey(m_hWnd,0Xa002);
    }
    return CDialog::WindowProc(message, wParam, lParam);
    }