Is there an API for vista to detect if the desktop is running full screen?

后端 未结 4 1734
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-10 15:21

e.g, Is the user playing a movie full screen, or looking at powerpoint in full screen mode?

I could have sworn I saw a IsFullScreenInteractive API before, but can\'t fin

4条回答
  •  悲哀的现实
    2021-02-10 15:55

    Use GetForegroundWindow to get a handle to the window the user is working with. GetClientRect will give the dimensions of the active part of the window sans borders; use ClientToScreen to convert the rectangle to monitor coordinates.

    Call MonitorFromRect or MonitorFromWindow to get the monitor that the window is in. Use GetMonitorInfo to get the coordinates of the monitor.

    Compare the two rectangles - if the window rectangle completely covers the monitor rectangle, it's a full screen window.

提交回复
热议问题