known the external window size, it Hwnd and the x/y coordinates of the button to press, I am trying this code, like seen on the web:
but nothing happens, both if the external window is in foreground, NOT in foreground or minimized...Code:<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _ Private Shared Function PostMessage(ByVal hWnd As IntPtr, _ ByVal Msg As UInteger, ByVal wParam As IntPtr, ByVal lParam As IntPtr) As Boolean End Function Const WM_LBUTTONDOWN As UInteger = &H201 'button X coordinates, tried both X => respect to it window coordinates 'and X respect to Screen coordinates (when the window is not minimized) Dim X as Integer = .... 'button Y coordinates, tried both Y => respect to it window coordinates 'and Y respect to Screen coordinates (when the window is not minimized) Dim Y as Integer = .... Dim Hwnd as IntPtr = ... ' external window handle PostMessage(Hwnd, WM_LBUTTONDOWN, IntPtr.Zero, MakeLParam(X, Y)) Private Function MakeLParam(ByVal LoWord As Integer, ByVal HiWord As Integer) As IntPtr Return New IntPtr((HiWord << 16) Or (LoWord And &HFFFF)) End Function
what's wrong?
ty




Reply With Quote