-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lock sound #1
Comments
* Lock (e.g. Win+L or "Switch user") = Play sound of "Windows Logoff" * Unlock = Play sound of "Windows Logon" * Shut down/Restart/Sign out (anything that ends your session) = Play sound of "Exit Windows" * Start the program (e.g. via startup folder or registry Run key) = Play sound of "Start Windows" Probably satisfies #1
Hello Sorry for the late reply. GitHub messages goes to my trash email account and I only check it rarely. Technically it is no problem. The reason I didn't include it was that I found nothing suitable in I built an update and put it on the Release. Please try it if you want. It works as follows now:
This seems to make the most sense especially when using classic desktop themes, e.g. I log off my session so my friend can use the computer, then I want to hear my shutdown sound. I think this is also how Windows 98 did it. How to upgrade:
I hope it works as you wish afterwards. I tested with Windows 10.0.19041.804. I can't run Windows Update because it causes a boot-loop and I had to restore my PC from backup, so I gave up and just disabled Windows Update and its hostile auto-repair shit completely. |
Ah finally I had the time to try it. Yes this is awesome and now brings back the Lock and Unlock sounds as before. However in this version, now there is no sound played for logon (after logging off) which it did in the earlier version. What I had done was a trick using Winaero Tweaker to set the startup sound to "Windows Logon Sound.wav" from Vista/7. I load SoundRestore.exe very early at startup using the Taskman reg value: https://www.geoffchappell.com/notes/windows/shell/explorer/taskman.htm Then I set the logon sound to the one Windows Vista/7 played as the startup sound. The net result was that because Taskman loaded Soundrestore very early on before it logged on, on Windows 10, the original startup sound played exactly like Windows Vista (by SoundRestore), then the logon sound of Vista played (by Windows). The log off sound shared with Exit Windows is ok. And I had the distinct Lock/Unlock sounds too. So now here's the situation: With SoundRestore 1.1, I had:
With SoundRestore 1.2 have:
Can you produce a version where all 5 sound events play, please? 🙂 With 1.1, I had modified the reg as follows:
|
Well problem solved. For now, I have added SoundRestore 1.2 to load later at startup and for Taskman, I play a VBScript: WScript "Logon sound.vbs" Here's what Logon sound.vbs contains:
|
That VBS workaround is probably the most sensible approach since it lets you use v1.2 as it was intended to be used. I had no idea about the Taskman registry key so thanks for showing me that. Problem right now is that I have no way to compile the code at the moment because Windows Update of all things killed my separate work PC with Visual Studio. I have at this point resigned to using Linux as my work OS and just running Windows in a VM so I can revert to whatever the last snapshot was when it decides to randomly break again. I might experiment later when I get up and running again to see if I can come up with something more useful. |
sorry for the necropost but locking and unlocking sounds are done by listening to WM_WTSSESSION_CHANGE and playing WindowsLogoff on WTS_SESSION_LOCK and WindowsLogon on WTS_SESSION_UNLOCK (set in wParam) this is the way Windows itself did it from Windows XP up until 8.1 |
If I understand your comment correctly, that is what the app is doing at the moment. https://github.com/shuuryou/soundrestore/blob/main/src/soundrestore/DummyForm.cs#L94 private void SystemEvents_SessionSwitch(object sender, SessionSwitchEventArgs e)
{
if (e.Reason == SessionSwitchReason.SessionUnlock)
Play(Sound.Logon);
else if (e.Reason == SessionSwitchReason.SessionLock)
Play(Sound.Logoff);
// Weird because user expects shutdown sound when session ends
//else if (e.Reason == SessionSwitchReason.SessionLogoff)
// Play(Sound.Logoff);
// Cannot work since this program is not running when it would fire
//else if (e.Reason == SessionSwitchReason.SessionLogon)
// Play(Sound.Logon);
} |
ah |
Firstly, thank you and great work! The sounds for Logoff/Exit Windows, Unlock and Logon work perfectly.
Is it possible to also have a Lock sound after pressing Win+L or Start menu -> Lock? Windows XP and Windows Vista and 7 used to have one.
The text was updated successfully, but these errors were encountered: