Private Declare Function GetForegroundWindow Lib "user32" () As LongDim Ret As Long
Ret = GetForegroundWindow()
Ret即为系统当前拥有焦点的句柄

解决方案 »

  1.   

    getforegroundwindow()只能得到窗体的句柄,而我想要的的任何控件(比如文本框)
      

  2.   

    我知道,呵呵,看看
    http://www.wzjcw.net/vbgood/taishan/index.html
    的软键盘就知道
      

  3.   

    先用GetForegroundWindow 得到窗体的句柄
    再用FindWindowEx查找类名
      

  4.   

    我知道,呵呵,看看
    http://www.wzjcw.net/vbgood/taishan/index.html
    的软键盘就知道 
      

  5.   

    我现在是想得到其他应用程序的句柄,并不的我编的程序,比如WPS等。