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

Don't change Focus #2242

Closed
Zeroes1 opened this issue Oct 17, 2024 · 2 comments
Closed

Don't change Focus #2242

Zeroes1 opened this issue Oct 17, 2024 · 2 comments

Comments

@Zeroes1
Copy link

Zeroes1 commented Oct 17, 2024

Brief description of your issue

Wish:
If Set option: [x] Start hidden -
don't change Focus from current window (where start SystemInformer.exe)

Steps to reproduce (optional)

Real example problem:
I many time manually start/restart SystemInformer.exe from Far Manager
my SystemInformer.exe.settings.xml have option [x] Start hidden
and after start program every time I lost focus from Far Manager window.

Expected behavior (optional)

May be need add logic:

main()
Old_hwnd: HWND;
Old_hwnd:= GetForegroundWindow();

...
if option.hide == true
   {
    SetForegroundWindow(Old_hwnd);
   }

where "option.hide" it's:
ListView_GetCheckState(listViewHandle, PHP_OPTIONS_INDEX_START_HIDDEN) == BST_CHECKED
from options.c

Actual behavior (optional)

No response

Environment (optional)

SI 3.1.24290.0
WIN32_NT 10.0.19045.3448 (22H2)
@dmex
Copy link
Member

dmex commented Oct 18, 2024

May be need add logic:

SetForegroundWindow is always skipped for SW_HIDE (StartHidden)

if (ShowCommand != SW_HIDE)
{
ShowWindow(PhMainWndHandle, ShowCommand);
UpdateWindow(PhMainWndHandle);
SetForegroundWindow(PhMainWndHandle);
}

I many time manually start/restart SystemInformer.exe from Far Manager

I just tested this and works fine so either Far Manager or another program is causing the issue 🤷‍♂️

@dmex dmex closed this as completed Oct 18, 2024
@Zeroes1
Copy link
Author

Zeroes1 commented Oct 18, 2024

@dmex

I'm again make tests:
check x64 version of
systeminformer-3.0.7660-release-bin.zip
systeminformer-3.1.24290-canary-bin.zip

under Win10 and Win11 22h2
with default config

with only one changes [x] Start Hidden

also check on the clear OS

if start anywhere [for example - Explorer window] after start SystemInformer.exe
focus lost from current window (from window where start SystemInformer.exe with press enter/double mouse click)

how to detect what focus lost: pressing Key - not have effect to window.
with helper utility i see what now active windows have class : MainWindowClassName
it's window SI, If now press AltF4 - systray ico SI is gone - program close (window of SI get message to close).
problem 100% reproduced

I am attaching a video as proof

bandicam.2024-10-18.14-49-40-155.mp4

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