c++ - How to check if an other program is running in fullscreen mode, eg. a media player -


How can I check if another app is running in full screen mode; Top C + + MFC? If the media player or other players are running then I just want to disable all my auto-dials (like silent / gamer mode in Avast). How can I do this?

Thank you.

Using a combination of EnumWindows, GetWindowInfo and GetWindowRect moves.

  bool isTopMost {HWNH HWD} {WINDOWINFO info; GetWindowInfo (hwnd, more info); Return (info.dwExStyle and WS_EX_TOPMOST)? right wrong; } Bool IsFullScreenSize (HWNH HWD, Constant Intex CX, Constant Cy) {RECT R; :: GetWindowRect (hwnd, & amp; r); Return r.right - r.left == cx & amp; Amp; R.bottom - r.top == cy; } Bool IsFullscreenAndMaximized (hwnd) {if (IsTopMost (hwnd)) {const int cx = GetSystemMetrics (SM_CXSCREEN); Const int cy = GetSystemMetrics (SM_CYSCREEN); If true (IsFullScreenSize (HWD, CX, S)) returns; }   return false; } Bull callback checkmaximized (HWDD HWD, LAPRM LPARM) {if (Isflascreen and Maximized (HWND)) {* (Bonnell *) alpira = true; return false; // can only be one, so get out of here) return TRUE; } Bool bThereIsAFullscreenWin = false; EnumWindows ((WNDENUMPROC) checkmaximize, (LPARAM) & amp; bThereIsAFullscreenWin);  

edit2: Works fine for Media Player on Windows 7, which has been updated with the test code. I tried it with GetForegroundWindow instead of EnumWindows, but then IsFullScreenSize () works only on the basis of which the mouse player of the media is properly.

Note that the problem with multiple setup mentioned in the comment below is still here.


Comments