I've tried
[DllImport("User 32.dll")]
private static extern IntPtr SetFocus(Handle Ref hWnd);
And it's not wanting to work. I've tried passing both the process handle and the main window handle to the method with this code
SetFocus(new HandleRef(null, Process.MainWin dowHandle));
And it just won't do it. I know I have the right handle because I'm using GetWindowRect() to get the size and location of the window, so why can't I set it's focus?
[DllImport("User 32.dll")]
private static extern IntPtr SetFocus(Handle Ref hWnd);
And it's not wanting to work. I've tried passing both the process handle and the main window handle to the method with this code
SetFocus(new HandleRef(null, Process.MainWin dowHandle));
And it just won't do it. I know I have the right handle because I'm using GetWindowRect() to get the size and location of the window, so why can't I set it's focus?
Comment