Main frame in my app is common: class CMainFrame : public CFrameWndEx.
In my code I am looking for a MainFrame position on the screen and if it is out, (for example when any monitor is swiched off or disconnected) I move the window on a valid area.
int VIRTSCR_Left = GetSystemMetrics(SM_XVIRTUALSCREEN);
int VIRTSCR_Top = GetSystemMetrics(SM_YVIRTUALSCREEN);
int VIRTSCR_Width = GetSystemMetrics(SM_CXVIRTUALSCREEN);
int VIRTSCR_Height = GetSystemMetrics(SM_CYVIRTUALSCREEN);
int VIRTSCR_Right = VIRTSCR_Left + VIRTSCR_Width;
int VIRTSCR_Bottom = VIRTSCR_Top + VIRTSCR_Height;
So in my case I get (for one screen) 0, 1920, 0, 1200.
CMainFrame size and position, when it is maximized:
CRect rc;
pMainFrame->GetWindowRect(rc);
Give to me -8, -8, 1928, 1168. (At bottom is 40px high Windows main taskbar).
So around the visible main frame is next invisible 8px wide margin.
Where I can find this value 8px?
Is it reacheble by GetSystemMetrics(...)?
Is the value 8px same for for other screen resoluttions (for example 2k, 3k monitors)?
Thank you for ideas and help :)
Lubomir