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

Stealing focus when starting with Windows #200

Open
KarellenX opened this issue Jan 28, 2023 · 12 comments
Open

Stealing focus when starting with Windows #200

KarellenX opened this issue Jan 28, 2023 · 12 comments

Comments

@KarellenX
Copy link

Hello,

I have been a user of your software for many, many years. Thank you.

The issue I have is that when CrystalDiskInfo starts up with Windows, it steals focus.
I have Kodi running on my HTPC to autostart with Windows. Kodi starts, then a few minutes later CrystalDiskInfo starts and then sits on top of my running media centre. This is not recent, and has been this way for many years. But because it can't be controlled by remote control, I need to pull out the keyboard and close CrystalDiskInfo.

Is there anyway to prevent stealing focus? Maybe a setting to prevent this?

Thankyou

@hiyohiyo
Copy link
Owner

Thank you for your report.

CrystalDiskInfo uses SetForegroundWindow() when it shows windows. So, I make test version which does not use SetForegroundWindow().
84856b0

Please download Alpha version from below link. and test it.
https://crystalmark.info/download/zz/CrystalDiskInfo8_18_0Alpha.zip

@KarellenX
Copy link
Author

Hello @hiyohiyo

My apologies for the delay in replying as I was a bit caught up yesterday.

I have tried installing the alpha version by running the DiskInfo64.exe in the zip file from your link but I receive an error during installation...

crystal

@KarellenX
Copy link
Author

Here is a short 48 second video that captures the startup of my HTPC (slow startup due to NextPVR server), Kodi starts (25sec) then CrystalDisk takes focus (44sec).

From the time I select Restart to the end of the video there are no keyboard, mouse or other input made.

https://streamable.com/mzi2kb

@hiyohiyo
Copy link
Owner

Please unzip all files.
DiskInfo64.exe required "CdiResource" files.

@KarellenX
Copy link
Author

Ok, thanks.

I believe I am misunderstanding what to do with this zip file.

I have extracted it, double clicked the DiskInfo64.exe file and allowed Windows to install. I did this with the assumption that it was the installer file. But I don't think it is, because when I ran it, then restarted my pc, there was no change.

Am I instead meant to copy these files to the existing install?

@hiyohiyo
Copy link
Owner

hiyohiyo commented Feb 1, 2023

I prepare installer version. Please use it.
https://crystalmark.info/download/zz/CrystalDiskInfo8_18_0Alpha.exe

@KarellenX
Copy link
Author

Thank you for the installer.

I have uninstalled the previous version and installed the above Alpha version.

Unfortunately, there is no change and it still pops up over previously running window (Kodi) as shown in the video above.

@hiyohiyo
Copy link
Owner

hiyohiyo commented Feb 2, 2023

Do you enable resident and startup option?

image

I will investigate this issue this weekend.

@KarellenX
Copy link
Author

No, I did not enable Resident as I did not know what it was for.

I will do that when I return home later.
Thankyou.

@KarellenX
Copy link
Author

Hello @hiyohiyo
Sorry for the delay in responding.

I have enabled both Resident and Startup as shown in your screenshot. Now I see that CrystalDisk is shown on the taskbar in the "hidden icons" section near the clock.

Even though CrystalDisk is not visible focus is still taken and requires clicking anywhere on Kodi to bring focus back to it.
If I disable CrystalDisk, on restart focus does remain with Kodi and I can immediately navigate.

Maybe this is a fringe issue that does not affect many people, so if it is a difficult fix, no problems, I have learnt to live with it for quite a few years, so I can continue to do so. I just thought I would ask in case there was a simple fix I was not aware of.

Thank you.

@hiyohiyo
Copy link
Owner

It may fix stealing focus problem.
https://crystalmark.info/download/zz/CrystalDiskInfo8_18_0Beta4.zip

I'd be happy to test it for you.

Reference: How to show a MFC dialog without stealing focus on the other window
https://stackoverflow.com/questions/2122278/how-to-show-a-mfc-dialog-without-stealing-focus-on-the-other-window

@hiyohiyo
Copy link
Owner

It may fix stealing focus problem.
https://crystalmark.info/download/zz/CrystalDiskInfo8_18_0Beta5.zip

I'd be happy to test it for you.

Reference: How to show a MFC dialog without stealing focus on the other window
https://stackoverflow.com/questions/2122278/how-to-show-a-mfc-dialog-without-stealing-focus-on-the-other-window

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