private void SystemEvents_SessionSwitch(object sender, SessionSwitchEventArgs e)
{
//If the reason for the session switch is lock or unlock //send the message to mute or unmute the system volume
if (e.Reason == SessionSwitchReason.SessionLock)
{
SendMessageW(this.Handle, WM_APPCOMMAND, this.Handle, (IntPtr)APPCOMMAND_VOLUME_MUTE);
}
else if (e.Reason == SessionSwitchReason.SessionUnlock)
{
SendMessageW(this.Handle, WM_APPCOMMAND, this.Handle, (IntPtr)APPCOMMAND_VOLUME_MUTE);
}
}
0.00 (0%) 0 votes






