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

Explorer Lib With Tabs In Windows 11 #14

Open
King-of-Kings-980 opened this issue Mar 12, 2024 · 0 comments
Open

Explorer Lib With Tabs In Windows 11 #14

King-of-Kings-980 opened this issue Mar 12, 2024 · 0 comments

Comments

@King-of-Kings-980
Copy link

In the Explorer Lib, in order to retrieve the right tab/window in the Windows 11 Explorer, you need to check if the window title is the same as the title of the tab in addition to checking if it is the right hwnd:

Explorer_GetWindow(hwnd="")
{
    WinGet, process, processName, % "ahk_id" hwnd := hwnd? hwnd:WinExist("A")
    WinGetClass class, ahk_id %hwnd%
	
	If (process!="explorer.exe")
		Return
	If (class ~= "(Cabinet|Explore)WClass")
	{
        WinGetTitle, currentWindowTitle, A
		For window In ComObjCreate("Shell.Application").Windows
			If (window.hwnd == hwnd And window.LocationName == currentWindowTitle)
				Return window
	}
	Else If (class ~= "Progman|WorkerW") 
		Return "desktop" ; desktop found
}

The two thing I added to the code are WinGetTitle, currentWindowTitle, A and And window.LocationName == currentWindowTitle

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

1 participant