I have a service that is running on a VM running Windows and I need to determine if the VM window is running full screen. Is this possible?
I have already tried investigating the following without success:
[DllImport("user32.dll")]
static extern IntPtr GetDesktopWindow();
[DllImport("user32.dll", SetLastError = true)]
static extern int GetWindowLong(IntPtr hWnd, int nIndex);
[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
static extern bool GetWindowRect(HandleRef hWnd, out RECT lpRect);
var expStyle = GetWindowLong((IntPtr)5160, (int)GWL.GWL_STYLE);
var result = GetWindowRect(new HandleRef(GetConsoleWindow(), GetDesktopWindow()), out rect);