Quantcast
Channel: VBForums - CodeBank - Visual Basic 6 and earlier
Viewing all articles
Browse latest Browse all 1529

Detect if the program in the foreground is in full screen mode

$
0
0
Code:

Option Explicit

Private Enum QUERY_USER_NOTIFICATION_STATE
    QUNS_NOT_PRESENT = 1
    QUNS_BUSY = 2
    QUNS_RUNNING_D3D_FULL_SCREEN = 3
    QUNS_PRESENTATION_MODE = 4
    QUNS_ACCEPTS_NOTIFICATIONS = 5
    QUNS_QUIET_TIME = 6
    QUNS_APP = 7
End Enum

Private Declare Function SHQueryUserNotificationState Lib "shell32" (ByRef pquns As QUERY_USER_NOTIFICATION_STATE) As Long

Public Function IsFullScreen() As Boolean
    Dim State As Long
   
    Call SHQueryUserNotificationState(State)
    IsFullScreen = (State > 1) And (State < 5)
End Function

SHQueryUserNotificationState requires Windows Vista+
For XP you could try this (not tested).

Viewing all articles
Browse latest Browse all 1529

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>