SetWindowPos(handle,HWND_TOP)

解决方案 »

  1.   

    窗体隐藏之后,就捕获不到击键事件了,你需要用API处理,网上有很多方法
      

  2.   

    对了,窗体在非活动时,即使是显示的,也捕获不到击键事件的,最好也用API
      

  3.   


    用API的话 用那个函数? 或者帮忙写个例子好吗?
      

  4.   

    注册热键RegisterHotKey在MSDN查找这个函数
    然后到网上搜索它
      

  5.   

    隐藏后两次显示要调用WIN32的API来实现
      

  6.   

    [DllImport("user32.dll", SetLastError=true)] 
    public static extern bool RegisterHotKey(
      IntPtr hWnd, // handle to window 
      int id, // hot key identifier 
      KeyModifiers fsModifiers, // key-modifier options 
      Keys vk // virtual-key code 
    );  [DllImport("user32.dll", SetLastError=true)] 
    public static extern bool UnregisterHotKey(
                IntPtr hWnd, // handle to window 
      int id // hot key identifier 
         );
      

  7.   

    挂个键盘钩子,然后监控按键,如果按键是操作键,那么就向你的窗体(句柄)发送最大化最小化命令,用SendMessage。API参数去网上查