Skip to content
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

Powershell shows via toggle_active_window.exe #160

Closed
CHRONOMASTER opened this issue Mar 20, 2023 · 5 comments
Closed

Powershell shows via toggle_active_window.exe #160

CHRONOMASTER opened this issue Mar 20, 2023 · 5 comments

Comments

@CHRONOMASTER
Copy link

CHRONOMASTER commented Mar 20, 2023

Issue:
When using Nyrna Hotkey and the hotkey is pressed, a empty powershell window is briefly displayed.

Reproduce Issue:
Using Windows, run Nyrna Hotkey and press the Pause key while a target program has focus.

Investigation:
The powershell only shows when using toggle_active_hotkey.exe that calls toggle_active_window.exe --toggle
This does not happen when toggled via the nyrna.exe gui.

The command line of the powershell process
powershell -NoProfile $process=[System.Diagnostics.Process]::GetProcessById(//$pid//) ; $threads=$process.Threads ; "$threads | select Id,ThreadState,WaitReason"

Expected results:
No powershell console being displayed when pause/resume a program.
Where the console process is created with the SW_HIDE flag being set like in the wWindMain of windows>runner>main.cpp

Related code in question:

Future<ProcessStatus> getProcessStatus(int pid) async {
final result = await _run(
'powershell',
[
'-NoProfile',
'\$process=[System.Diagnostics.Process]::GetProcessById($pid)',
';',
'\$threads=\$process.Threads',
';',
'\$threads | select Id,ThreadState,WaitReason',
],
);

@CHRONOMASTER
Copy link
Author

CHRONOMASTER commented Mar 20, 2023

By adding -WindowStyle Hidden to the powershell argument list (after -NoProfile for example) reduces the display time to quick flash before disappearing.

I have been combing through the code trying to find out how toggle_active_window.exe is created as in the release download but so far I can't seem to find how it is made and what code it is pulling from.

It is strange to me, the nyrna.exe is only 50 KB and does not require toggle_active_window.exe to function in suspending processes.
But toggle_active_window.exe is over 5 MB and does not require UI and images.

@Merrit
Copy link
Owner

Merrit commented Mar 20, 2023

Can you confirm which version of Nyrna you have?

The dedicated toggle executable was replaced with the built-in hotkey in v2.5.0 and the latest version is currently v2.11.1.

If you are using a newer version but still seeing those executables, I wonder if they didn't get cleaned up for some reason during an upgrade..

@CHRONOMASTER
Copy link
Author

This is a good question as to what version I have. I downloaded it a few weeks ago, but the settings>info Nyrna version does not display the version and clicking or mousing over does nothing either. According to the exe file version, it reports v2.4.1.0 which is significantly older then the latest version.

I'm not sure if the exe info version is reported correctly as they not often are or how I ended up with such an old version.

I will redownload and install the latest version then report back if that was the issue.

@CHRONOMASTER
Copy link
Author

The version I downloaded a few weeks ago must have been a much older version for some reason.

I installed the latest v2.11.1 and now the settings have additional options and the hotkey works without the companion app.

Now I feel like a dunce, after all that time digging through the code and trying to figure out how to resolve issue, it was down to me having an old version.

@Merrit
Copy link
Owner

Merrit commented Mar 20, 2023

Happens to us all!

I do very much appreciate the effort you made to track down the issue, and your well-crafted issue report. Thanks for contributing! ❤️

Let me know if you have any further issues. 🎉

@Merrit Merrit closed this as completed Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants