Manipulating Windows 10 sound adjustment popup
-
- Posts: 8
- Joined: 29 Jan 2023, 02:48
Manipulating Windows 10 sound adjustment popup
I'm trying to make a script which clicks on the Windows popup to close it. Thus far I have zero success: Spy and WinSpy both tell me this is Explorer.exe window but I have no luck finding it with WinGet no matter how I try. It's not even in the list of windows filtered by process name.
What's the problem?
What's the problem?
- Attachments
-
- Annotation 2023-01-31 200257.png (25.62 KiB) Viewed 722 times
-
- Annotation 2023-01-31 200252.png (29.25 KiB) Viewed 722 times
Re: Manipulating Windows 10 sound adjustment popup
We can't tell since you haven't shown us how you tried to implement it. This kind of issue is usually the result of incorrect syntax.
-
- Posts: 8
- Joined: 29 Jan 2023, 02:48
Re: Manipulating Windows 10 sound adjustment popup
The boiler plate of my attempts:
Spoiler
But the actual problem is that there's no such window ID if I look into debugger:Re: Manipulating Windows 10 sound adjustment popup
Why does your RegEx pattern start with a backslash? Why are you using RegEx at all instead of just explorer.exe?
-
- Posts: 8
- Joined: 29 Jan 2023, 02:48
Re: Manipulating Windows 10 sound adjustment popup
I was getting empty Window list and I thought that search was case sensitive. It does not matter, now I am getting same list without regex.
Spoiler
-
- Posts: 8
- Joined: 29 Jan 2023, 02:48
Re: Manipulating Windows 10 sound adjustment popup
It's how it's written in the documentation.: https://www.autohotkey.com/docs/v1/misc/WinTitle.htm#ahk_exe
Re: Manipulating Windows 10 sound adjustment popup
Start with just a simple script like:
...so you can prove to yourself that it finds the window, then build from there.
Code: Select all
MsgBox, % WinExist("ahk_exe explorer.exe")
-
- Posts: 8
- Joined: 29 Jan 2023, 02:48
Re: Manipulating Windows 10 sound adjustment popup
Please refer to my last screenshot which literally displays all windows from explorer.exe. There is no problem with that.boiler wrote: ↑31 Jan 2023, 13:05Start with just a simple script like:...so you can prove to yourself that it finds the window, then build from there.Code: Select all
MsgBox, % WinExist("ahk_exe explorer.exe")
The problem is: the handle which WinSpy shows is not present there and searching by needed ahk_class does not give anything either.
Re: Manipulating Windows 10 sound adjustment popup
How do you know that 0x808DE is one of the window IDs? Your WinSpy image is showing a different class than the one for an explorer window.
In any case, there is no reason to look for specific numbers since they change for each new instance. It's still not clear what you are trying to do.
In any case, there is no reason to look for specific numbers since they change for each new instance. It's still not clear what you are trying to do.
-
- Posts: 8
- Joined: 29 Jan 2023, 02:48
Re: Manipulating Windows 10 sound adjustment popup
That's one of the things I tried. Refer to my code to see what else I tried:boiler wrote: ↑31 Jan 2023, 14:50How do you know that 0x808DE is one of the window IDs? Your WinSpy image is showing a different class than the one for an explorer window.
In any case, there is no reason to look for specific numbers since they change for each new instance. It's still not clear what you are trying to do.
- coordinate search
- class search
Re: Manipulating Windows 10 sound adjustment popup
Do you realize that every time that window pops up, it is going to have a different ID? You can't find it by number unless you are searching for the same instance that already exists. That's why it's useless to use an exact numerical ID as the criterion. You only use window IDs when your script gets them dynamically so you can refer to the same window again (i.e., before it closes because it will have a different ID next time) when you need to. You never even know or care what the actual number is.
-
- Posts: 8
- Joined: 29 Jan 2023, 02:48
Re: Manipulating Windows 10 sound adjustment popup
This does:
So again I would ask if you are expecting that window to always have that ID, although I no longer care about the answer after your flippant response.
Code: Select all
if(id=0x808DE){
So again I would ask if you are expecting that window to always have that ID, although I no longer care about the answer after your flippant response.
-
- Posts: 8
- Joined: 29 Jan 2023, 02:48
Re: Manipulating Windows 10 sound adjustment popup
Why are you asking that since my code in no way makes that a requirement I have no idea. I said that I have tried a lot of criteria to find the window and my code shows what I tried. Of course I am not stupid.boiler wrote: ↑01 Feb 2023, 13:45This does:Code: Select all
if(id=0x808DE){
So again I would ask if you are expecting that window to always have that ID, although I no longer care about the answer after your flippant response.
If you do not believe this volume adjustment popup cannot be found through normal AHK calls, try it yourself. Even simpliest width+height search gives nothing.
Code: Select all
DetectHiddenWindows, On
SetTitleMatchMode, RegEx
~Volume_Down::
~Volume_Up::
Sleep, 1000
ar := []
WinGet windows, List, ahk_exe i)\\explorer\.exe$
Loop %windows%
{
id := windows%A_index%
WinGetPos X, Y, W, H, ahk_id %id%
ar.Push([pn, id])
if (W=509) and (H=140){
MsgBox "Found"
}
}