如何得到光标所在处的句柄啊!
不是窗口的句柄,是窗口内控件的句柄!

解决方案 »

  1.   

    Private Declare Function GetActiveWindow Lib "user32" Alias "GetActiveWindow" () As Long
      

  2.   

    Public Declare Function GetCursorPos Lib "user32" Alias "GetCursorPos" (lpPoint As POINTAPI) As Long
    Public Declare Function WindowFromPoint Lib "user32" Alias "WindowFromPoint" (ByVal xPoint As Long, ByVal yPoint As Long) As Long
      

  3.   

    Private Declare Function GetFocus Lib "user32" () As Long
    h& = GetFocus&()
      

  4.   

    能对游戏窗口吗?
    用SQY取句柄,整个游戏窗口只有一个句柄!
      

  5.   

    wangdeshui(阿水)的应该是对的啊
    楼主可以看看MSDN中GETFOCUS的说明
    The GetFocus function retrieves the handle to the window that has the keyboard focus, if the window is attached to the calling thread's message queue. 返回当前获得键盘焦点的窗口的句柄啊
      

  6.   

    Public Declare Function GetCursorPos Lib "user32" Alias "GetCursorPos" (lpPoint As POINTAPI) As Long
    Public Declare Function WindowFromPoint Lib "user32" Alias "WindowFromPoint" (ByVal xPoint As Long, ByVal yPoint As Long) As Long
      

  7.   

    游戏整个窗口就一个句柄!
    也就是说你在窗口里,点任何地方,得到的都是这个窗口的句柄!
    DirectX 是不是这个的关系!