其实前后台我也不是分得很轻,先不管它,
我向问的是,假如我开了2个程序,都有窗体,
当窗体1有输入焦点,我按下一个键盘上的安键时,窗体2跳出来,
窗体1和2任意,
就向QQ里面的按下CLRT+ALT+Z可以弹出个冬冬一样。

解决方案 »

  1.   

    The RegisterHotKey function defines a system-wide hot key. BOOL RegisterHotKey(
      HWND hWnd,         // window to receive hot-key notification
      int id,            // identifier of hot key
      UINT fsModifiers,  // key-modifier flags
      UINT vk            // virtual-key code
    );
     
    Parameters
    hWnd 
    Handle to the window that will receive WM_HOTKEY messages generated by the hot key. If this parameter is NULL, WM_HOTKEY messages are posted to the message queue of the calling thread and must be processed in the message loop. 
    id 
    Specifies the identifier of the hot key. No other hot key in the calling thread should have the same identifier. An application must specify a value in the range 0x0000 through 0xBFFF. A shared dynamic-link library (DLL) must specify a value in the range 0xC000 through 0xFFFF (the range returned by theGlobalAddAtom function). To avoid conflicts with hot-key identifiers defined by other shared DLLs, a DLL should use the GlobalAddAtom function to obtain the hot-key identifier. 
    fsModifiers 
    Specifies keys that must be pressed in combination with the key specified by the nVirtKey parameter in order to generate the WM_HOTKEY message. The fsModifiers parameter can be a combination of the following values. Value Meaning 
    MOD_ALT Either alt key must be held down. 
    MOD_CONTROL Either ctrl key must be held down. 
    MOD_SHIFT Either shift key must be held down. 
    MOD_WIN Either WINDOWS key was held down. These keys are labeled with the Microsoft Windows logo. 
    vk 
    Specifies the virtual-key code of the hot key.