I couldn't able to find bounds of an application content.
I'm trying to move mouse to an exact location on the application content using java. For this purpose I need to find location on the application window. Used application for this process has 1024x768
bounds.
This is how I use GetWindowRect
:
User32 user32 = User32.INSTANCE;
HWND hWnd = user32.FindWindow(null, "A Random Application");
user32.ShowWindow(hWnd, User32.SW_SHOW);
user32.SetForegroundWindow(hWnd);
RECT bounds = new RECT();
User32.INSTANCE.GetWindowRect(hWnd, bounds);
However, I get following for the bounds
:
[(445,141)(1475,938)]
This means window has 1030x797
resolution and it includes border of the window. I need to find where the application content starts(not the window's start point)? How can I achieve that?
Note: When I use GetClientRect
I get [(0,0)(1024,768)]
. But I can't get x and y.