Autohotkey Open Folder of Current Application or Process -
in code no open current application folder because filepath variable include exe file name
f11:: pid = 0 winget, hwnd,, dllcall("getwindowthreadprocessid", "uint", hwnd, "uint *", pid) hprocess := dllcall("openprocess", "uint", 0x400 | 0x10, "int", false , "uint", pid) pathlength = 260*2 varsetcapacity(filepath, pathlength, 0) dllcall("psapi.dll\getmodulefilenameexw", "uint", hprocess, "int", 0, "str", filepath, "uint", pathlength) dllcall("closehandle", "uint", hprocess) run, explorer %filepath%
thanks in advance assistance.
f11:: winget, path, processpath, splitpath, path, name, dir run, explorer.exe %dir% return
or:
f11:: winget, path, processpath, run, % "explorer.exe /select," . path return
Comments
Post a Comment