Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than shell32, prefix the name with the module name and a period.
SHQueryUserNotificationState (shell32)
.
C# Signature:
[DllImport("shell32.dll")]
static extern int SHQueryUserNotificationState(
out QUERY_USER_NOTIFICATION_STATE pquns);
VB Signature:
Declare Function SHQueryUserNotificationState Lib "shell32.dll" (TODO) As int
// Define other methods and classes here
class QueryUserNotificationState
{
public enum UserNotificationState
{
/// <summary>
/// A screen saver is displayed, the machine is locked,
/// or a nonactive Fast User Switching session is in progress.
/// </summary>
NotPresent = 1,
public enum UserNotificationState
{
NotPresent = 1,
Busy = 2,
RunningDirect3dFullScreen = 3,
PresentationMode = 4,
AcceptsNotifications = 5,
QuietTime = 6
};
[DllImport("shell32.dll")]
static extern int SHQueryUserNotificationState(out UserNotificationState pquns);
public static UserNotificationState State()
{
UserNotificationState state;
var returnVal = SHQueryUserNotificationState(out state);
return state;
}
}
/// <summary>
/// A full-screen application is running or Presentation Settings are applied.
/// Presentation Settings allow a user to put their machine into a state fit
/// for an uninterrupted presentation, such as a set of PowerPoint slides, with a single click.
/// </summary>
Busy = 2,
/// <summary>
/// A full-screen (exclusive mode) Direct3D application is running.
/// </summary>
RunningDirect3dFullScreen = 3,
/// <summary>
/// The user has activated Windows presentation settings to block notifications and pop-up messages.
/// </summary>
PresentationMode = 4,
/// <summary>
/// None of the other states are found, notifications can be freely sent.
/// </summary>
AcceptsNotifications = 5,
/// <summary>
/// Introduced in Windows 7. The current user is in "quiet time", which is the first hour after
/// a new user logs into his or her account for the first time. During this time, most notifications
/// should not be sent or shown. This lets a user become accustomed to a new computer system
/// without those distractions.
/// Quiet time also occurs for each user after an operating system upgrade or clean installation.
/// </summary>
QuietTime = 6
};
[DllImport("shell32.dll")]
static extern int SHQueryUserNotificationState(out UserNotificationState userNotificationState);
public static UserNotificationState State()
{
UserNotificationState state;
var returnVal = SHQueryUserNotificationState(out state);
return state;
}
}
The SHQueryUserNotificationState API
2/11/2021 3:30:58 AM - -89.88.236.149
Please edit this page!
Do you have...
helpful tips or sample code to share for using this API in managed code?
corrections to the existing content?
variations of the signature you want to share?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).