Detect if an explorer window with a filepath is already open.

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Timmy347
Posts: 109
Joined: 26 Aug 2017, 12:15

Detect if an explorer window with a filepath is already open.

18 Jun 2021, 01:14

Method to detect if an MS Windows explorer window is already open the user's desktop, when given a filepath.

e.g. In the below sample image, this user's desktop, the filepath "D:\My Cool Folder" is already open in an explorer window. So the function would return TRUE. Else the function would return FALSE.

Image
Rohwedder
Posts: 7630
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Detect if an explorer window with a filepath is already open.

18 Jun 2021, 01:42

Hallo,
try:

Code: Select all

FilePath = D:\My Cool Folder

q::ToolTip,% Explorer(FilePath)

Explorer(FilePath)
{
	SetTitleMatchMode, 3
	Return, !!WinExist(FilePath " ahk_exe Explorer.EXE")
}

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Joey5 and 327 guests