teadrinker Posts: 22
01/02/2023
|
I'm trying out this program but the hotkey doesn't seem to work all the time. When some other programs are maximized, like for instance Thunderbird, hotkeys don't work, no matter what hotkey is set and regardless of whether that hotkey is used in Thunderbird
|
|
link
|
Gianluca Administrator Posts: 1274
01/02/2023
|
Hello and welcome to the community.
It's normal Windows behavior with hotkeys management. If SyMenu is running with normal privileges and the program in the foreground is running in elevated mode Windows prevents the less privileged program from getting the pressed keys for security purposes.
Is it possible you are executing Thunderbird in admin mode? Otherwise the reason should be different and we have to investigate.
When you have an issue possibly tied with your system like this one, you should mention your Windows version, your .NET Framework version and your SyMenu version to ease the resolution.
|
|
link
|
teadrinker Posts: 22
09/02/2023
|
I don't quite understand why this doesn't work. I've tried a different program called PSmenu, which is similar to SyMenu though with less features. It also has the ability for a hotkey and those hotkeys work fine, even when Thunderbird or any other program is open. I don't open anything in admin mode as far as i know.
|
|
link
|
Gianluca Administrator Posts: 1274
10/02/2023
|
Well the keyboard hook works this way. If PSMenu is successfully notified of a keyboard event even when a higher privileged app is active, it means it is not using a hook but a shortcut.
The differences among the two systems are simple.
The shortcut way is considered safer by Windows and for this reason can overcome the applications privilege hierarchy. But the reason it is considered safer it's because you can register only some keys and modifiers. For example you can't register CTRL+C or CTRL+V because it goes against the OS shortcuts Copy and Paste. An application will be refused to register a globally already taken shortcut so imagine what could happen on a portable application like SyMenu... in a PC your shortcut works in another not. A mess.
The hook way is considered less safe because you can use it to create a keyboard hooker and use it to register the user data. For this reason Windows limits this kind of tech. The Windows hook system is powerful and flexible because you can register any kind of keyboard combination and then bubble it to the next subscriber (or not, it's your choice). To be clear if you want you can open the SyMenu contextual menu with a CTRL+V. SyMenu opens, but, since I decided to stop the propagation and the focus is grabbed by SyMenu, you completely lose the ability to paste your text or files. But it's my decision not an hook system limit.
Anyway I have a workaround for your little issue: start SyMenu in elevated mode. There is a second executable file (SyMenu.Admin.exe) you can use for this purpose or you can set it in a shortcut to the SyMenu.exe. This way SyMenu can register his hooks on the higher possible level and will always work.
|
|
link
|
teadrinker Posts: 22
14/02/2023
|
Is there any way to have a simple hotkey always work to see SyMenu's menu without having to run it in as admin?
|
|
link
|
Gianluca Administrator Posts: 1274
15/02/2023
|
Since I've implemented the keyboard hook and not the keyboard shortcut technique, there is no way to overcome the Windows security limits. I advise you to follow the Microsoft recommendation and work with a user with no privileges.
|
|
link
|
teadrinker Posts: 22
16/02/2023
|
What does that mean? "follow the Microsoft recommendation and work with a user with no privileges".
|
|
link
|
Gianluca Administrator Posts: 1274
17/02/2023
|
https://learn.microsoft.com/en-us/windows-server/identity/ad-ds/plan/security-best-practices/implementing-least-privilege-administrative-models
|
|
link
|
teadrinker Posts: 22
17/02/2023
|
So, I don't use a user account with privileges at all, just standard. I don't know why certain programs are preventing your hotkey system from working. You say it's because they are elevated but I don't do anything to cause that nor do I know how to find out if they are elevated and then how to change that.
|
|
link
|
Gianluca Administrator Posts: 1274
17/02/2023
|
A program executes in elevated mode for several reasons.
I will try to list everything that comes to my mind:
- you can run a program through a shortcut and a Windows shortcut can have a flag that tells Windows to execute in elevated mode;
- if you check whatever program settings you will find a checkbox with the same behaviour of the shortcut one. It's called "Run this program as an administrator";
- a program can have this information written on its manifest. Reading the manifest Windows understands the program needs and asks the user to grant the elevation through UAC. The reason can be the program needs to control your system/FS/HD in a way that is impossible if executed with normal privileges
- a program can be launched by an elevated launcher (we already talked about this one).
I think that's all.
|
|
link
|
Gianluca Administrator Posts: 1274
17/02/2023
|
BTW to check if a program is running in elevate mode you can use Task manager (https://www.elevenforum.com/t/check-if-process-is-running-as-administrator-elevated-in-windows-11.7199/)
|
|
link
|
teadrinker Posts: 22
17/02/2023
|
Thank you.
So it turns out a lot of my running software is running elevated but I do not know why. Maybe it's because I have an Autohotkey script that runs several programs that I always want open at startup? I just checked and for instance if I kill Thunderbird and run it manually than it's not elevated. I have never given this any thought before.
|
|
link
|
Gianluca Administrator Posts: 1274
17/02/2023
|
Then probably the launcher (Autohotkey script) has gained privileges... Try to work on that one and every other program will be OK.
|
|
link
|