VB.net 获取控件句柄

获取图片中,button1的句柄,代码如下:PrivateDeclareFunctionFindWindowLib"user32"Alias"FindWindowA"(B... 获取图片中,button1 的句柄,代码如下:Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Integer Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hwnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Integer Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim hwnd0 As Long Dim hwnd11 As Long hwnd0 = FindWindow(vbNullString, "Form11") hwnd11 = FindWindowEx(hwnd0, 0, "Button", "Button1") TextBox2.Text = hwnd11 运行后,获取的句柄总是为0 展开
 我来答
tianqing20wen

2017-03-07 · TA获得超过2.4万个赞
知道大有可为答主
回答量:8226
采纳率:88%
帮助的人:5097万
展开全部
Dim hwnd0 As Integer
Dim hwnd11 As Integer
第二个是你要生成EXE后 运行EXE
第三就是耐行逗没好像没有文本框控带尺件昌卖
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

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

类别

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

说明

0/200

提交
取消

辅 助

模 式