- Screen Resolution -
-
Hi How can i detect the current screen resolution (1024/768 or others) and how can i know how big (f.e. in pixels) the screen of an application is? Greetings Jens
hwnd desktop = GetDesktopWindow(VOID); RECT myrect; GetWindowRect(desktop, &myrect); This will load 'myrect' with the size of the desktop window. I'm not sure how it will behave on a multi-screen setup. You might get the size of the first display's desktop only, or maybe the size of the ENTIRE desktop. There are some functions to enumerate the actual displays, but I don't remember any of the details.
-
hwnd desktop = GetDesktopWindow(VOID); RECT myrect; GetWindowRect(desktop, &myrect); This will load 'myrect' with the size of the desktop window. I'm not sure how it will behave on a multi-screen setup. You might get the size of the first display's desktop only, or maybe the size of the ENTIRE desktop. There are some functions to enumerate the actual displays, but I don't remember any of the details.
-
Greg S. wrote: int x = GetSystemMetrics(SM_CXSCREEN) int y = GetSystemMetrics(SM_CYSCREEN) This might only give you the resolution of ONE screen, not your whole desktop.