vb6 api 如何使用ChildWindowFromPoint或者ChildWindowFromPointEx获取已禁用的控件的句柄

如图所示,怎么获取该禁用控件的句柄用鼠标移动过去获取... 如图所示,怎么获取该禁用控件的句柄
用鼠标移动过去获取
展开
 我来答
哈喽魏无悔9N
推荐于2016-10-14 · TA获得超过2034个赞
知道小有建树答主
回答量:843
采纳率:0%
帮助的人:481万
展开全部
Private Declare Function GetForegroundWindow Lib "user32" () As Long
Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long) As Long
Private Declare Function GetFocus Lib "user32" () As Long
Private Declare Function AttachThreadInput Lib "user32" (ByVal idAttach As Long, ByVal idAttachTo As Long, ByVal fAttach As Long) As Long
Public Function GetHwnd() As Long
Dim hwnd As Long
Dim PID As Long
Dim TID As Long
Dim hWndFocus As Long

hwnd = GetForegroundWindow

If hwnd Then

TID = GetWindowThreadProcessId(hwnd, PID)

AttachThreadInput App.ThreadID, TID, True

GetHwnd = GetFocus

AttachThreadInput App.ThreadID, TID, False
End If

End Function
Private Sub Command1_Click()
GetHwnd
MsgBox hwnd
End Sub
Private Sub Form_Load()
Call Command1_Click
End Sub
本回答被提问者采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式