Im trying to position a window with MoveWindow() API but it just keeps hiding the window and it has to be maximised to be able to see it.
The code im using is
Public Declare Function MoveWindow Lib "user32" _ (ByVal hwnd As Long, _ ByVal x As Long, _ ByVal y As Long, _ ByVal nWidth As Long, _ ByVal nHeight As Long, _ ByVal bRepaint As Long) _ As Long Dim p As System.Diagnostics.Process For Each p In System.Diagnostics.Process.GetProcesses() If p.MainWindowTitle = "MyProcess" Then GetWindowRect(p.MainWindowHandle, r) MsgBox("Left" & r.Left & vbNewLine & _ "Top" & r.Top & vbNewLine & _ "Bottom" & r.Bottom & vbNewLine & _ "Right" & r.Right) Call MoveWindow(p.MainWindowHandle, 110, 59, 1270, 957,False) Close() End If Next
i have tried with all different co-orindates and sixes and its always the same.
any help is appreciated