0

嘿,我对这个 BM_CLICK 问题的影响有点困惑。

这是我的代码:

Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Integer, ByVal Msg As Integer, ByVal wParam As Integer, <MarshalAs(UnmanagedType.AsAny)> ByVal lParam As Object) As Integer

Dim hwndParent As Long = FindWindow(vbNullString, "Video Source")
  Debug.Print("findwindow: " & hwndParent)
Dim hwndButton As Long = FindWindowEx(hwndParent, IntPtr.Zero, "Button", "OK")
  Debug.Print("OK: " & hwndButton)
hwndButton = SendMessage(hwndButton, BM_CLICK, 0, 0)
  Debug.Print("Clicked: " & hwndButton)

调试输出为:

findwindow: 856318
        OK: 1052904
   Clicked: 0

现在我不知道为什么它没有找到也没有点击确定按钮。

该按钮的 Spy++ 如下所示:

在此处输入图像描述

任何帮助都会很棒!

4

0 回答 0