Answer the question
In order to leave comments, you need to log in
How to determine the position of someone else's window in .net?
There is a win function "GetWindowRect" which, in fact, should return the position of the window by the process number, but in real life it returns numbers that are far from reality.
[DllImport("user32.dll", CharSet = CharSet.Unicode)]
private static extern bool GetWindowRect(IntPtr hwnd, ref RECT rectangle);
[StructLayout(LayoutKind.Sequential)]
public struct RECT
{
public int X;
public intY;
public int Width;
public int Height;
}
or so
[StructLayout(LayoutKind.Sequential)]
public struct RECT
{
public int Left;
public int Top;
public int Right;
public int Bottom;
}
How else can you find out the real position of the window?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question