Hello,
I'm new with Autohotkey, but as far I know it - I love it
I created a script to set some Windows 10 program defaults.
For this purpose I start the Set Default Programs under Control Panel\Programs. That is no problem with a "Run, control /name Microsoft.DefaultPrograms /page pageDefaultProgram"
And also the rest what I want to change is easy with {tab} - letters and {space}.
Here is my problems.
The start of the "Set Default Programs" takes sometimes 2-3 seconds but on some PCs I saw the loading bar for more than 30 seconds. So WAIT is not a good option.
The Window is always active so I can't check on this too.
The only thing I could check would be a green pixel in the loading bar or if the list field is displayed.
Any ideas how this can be done? Or other suggestions?
Thanks.
Oh and it must run "unattended" with no user action like - klick on OK, because it is in every users first-run-login script.
Here some screenshot of the windows i mentioned.
https://imgur.com/a/ThvVQ
Check when "Set Default Programs" Window is loaded
-
- Posts: 4309
- Joined: 29 Mar 2015, 09:41
- Contact:
Re: Check when "Set Default Programs" Window is loaded
Hello, trexman,
The window "Set Default Programs" has the initially hidden ListView-control, which gets visible after the list gets loaded. You could check in a loop whether ListView became visible.
The window "Set Default Programs" has the initially hidden ListView-control, which gets visible after the list gets loaded. You could check in a loop whether ListView became visible.
Code: Select all
Run, control /name Microsoft.DefaultPrograms /page pageDefaultProgram
WinWait, Set Default Programs ahk_exe explorer.exe
ControlGet, hListView, hwnd,, SysListView321
while !DllCall("IsWindowVisible", Ptr, hListView)
Sleep, 500
MsgBox, Loaded!
Last edited by teadrinker on 26 Sep 2017, 10:17, edited 1 time in total.
Re: Check when "Set Default Programs" Window is loaded
Hello teadrinker,
Yes, perfect.
I had to change the WinTitle because of my Windows OS language, but it works!
Thank you!
Yes, perfect.
I had to change the WinTitle because of my Windows OS language, but it works!
Thank you!