-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathtest.ahk
49 lines (43 loc) · 936 Bytes
/
test.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#NoEnv
#SingleInstance, Force
SendMode, Input
SetBatchLines, -1
SetWorkingDir, %A_ScriptDir%
^a::
path := get_explore_all_file_name()
for k,v in path
{
MsgBox,% v
}
return
get_explore_all_file_name()
{
static all_file_name := []
path := getPath()
if(g_is_finc_status)
return all_file_name
else
all_file_name := []
Loop Files,% path "\*", DF
{
all_file_name.Push(A_LoopFileName)
}
g_is_finc_status := true
return all_file_name
}
getPath()
{
thisHwnd := WinActive("A")
WinGet, processName, processName, A
WinGetClass, class, A
if (processName!="explorer.exe")
return
for window in ComObjCreate("Shell.Application").Windows
{
if (window.hwnd == thisHwnd)
path := StrReplace(window.LocationURL, "file:///", "")
path := StrReplace(path, "/", "\")
path := StrReplace(path, "`%20"," ")
}
Return path
}