如何让一个窗体一直获得焦点,或者让光标一直停留在此窗体内,不能跑到窗体外面去?
请问这个要怎么搞? 没有经验,想不出来

解决方案 »

  1.   

    HOOK,GetForegroundWindow()看看是否等于你的指定的窗口,如果不是就::SetForegroundWindow(HWND);
    ::SetFocus(HWND);
      

  2.   

    有时间看看hook方面的东西,经常听人说,还没用过
      

  3.   

    To  VisualEleven:    组织部长可有什么好的关于hook资料啊?有的话推荐一下,谢了!
      

  4.   

    SetCapture(
      HWND hWnd 
    ); ReleaseCapture();
      

  5.   

    限制光标的范围在指定的矩形区域内。BOOL ClipCursor(const RECT *lpRect);lpRect
    [in] Pointer to the RECT structure that contains the screen coordinates
     of the upper-left and lower-right corners of the confining rectangle. 
    If this parameter is NULL, the cursor is free to move anywhere on the screen.