Hey all im a little confused as the effect of this BM_CLICK issue.
Here is my code:
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)
The debug output is:
findwindow: 856318
OK: 1052904
Clicked: 0
Now i have no idea why it doesnt find nor click on the OK button.
The Spy++ for that button looks like this:
Any help would be great!