Code: Select all
2::
ControlGetText, ThisPath, Edit2, ahk_class #32770
tooltip, %ThisPath%
Return
Thanks allot for your help.
Code: Select all
2::
ControlGetText, ThisPath, Edit2, ahk_class #32770
tooltip, %ThisPath%
Return
Code: Select all
ControlGetText, ThisPath, ToolbarWindow324, ahk_class #32770
Thank you so much man, it works just like how I needed it to work.boiler wrote: Try this:Code: Select all
ControlGetText, ThisPath, ToolbarWindow324, ahk_class #32770
This works great except when "This PC > Downloads" or "This PC > Documents" or "This PC > Pictures" and similar "This PC" locations are in the control, then it only retrieves "Downloads", "Documents", "Pictures" ETC...boiler wrote: ↑26 Mar 2021, 23:58Try this:Code: Select all
ControlGetText, ThisPath, ToolbarWindow324, ahk_class #32770
Code: Select all
MyPictures := StrReplace(A_Desktop, "Desktop", "Pictures")
This is a creative solution, but does not work for me.boiler wrote: ↑28 Nov 2023, 19:21One thing you could do is check the result, and when it retrieves one of those, then you can use the contents of the associated built-in variable, such as A_Documents, A_MyDesktop, etc. And for the ones that don’t have built-in variables, they can typically be constructed from the ones that do, such as:
Code: Select all
MyPictures := StrReplace(A_Desktop, "Desktop", "Pictures")
There may be more elegant ways others could suggest.
Not just for me. For anyone that uses my SavePictureAs program.
Code: Select all
FOLDERID_Downloads := "{374DE290-123F-4565-9164-39C4925E467B}"
MsgBox % SHGetKnownFolderPath(FOLDERID_Downloads)
FOLDERID_Music := "{4BD8D571-6D19-48D3-BE97-422220080E43}"
MsgBox % SHGetKnownFolderPath(FOLDERID_Music)
FOLDERID_Pictures := "{33E28130-4E1E-4676-835A-98395C3BC3BB}"
MsgBox % SHGetKnownFolderPath(FOLDERID_Pictures)
FOLDERID_Videos := "{18989B1D-99B5-455B-841C-AB7C74E4DDFC}"
MsgBox % SHGetKnownFolderPath(FOLDERID_Videos)
FOLDERID_Desktop := "{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}"
MsgBox % SHGetKnownFolderPath(FOLDERID_Desktop)
FOLDERID_Documents := "{FDD39AD0-238F-46AF-ADB4-6C85480369C7}"
MsgBox % SHGetKnownFolderPath(FOLDERID_Documents)
Return
SHGetKnownFolderPath(FOLDERID, KF_FLAG:=0) { ; By SKAN on D356 @ tiny.cc/t-75602
Local CLSID, pPath:="" ; Thanks teadrinker @ tiny.cc/p286094
Return Format("{4:}", VarSetCapacity(CLSID, 16, 0)
, DllCall("ole32\CLSIDFromString", "Str",FOLDERID, "Ptr",&CLSID)
, DllCall("shell32\SHGetKnownFolderPath", "Ptr",&CLSID, "UInt",KF_FLAG, "Ptr",0, "PtrP",pPath)
, StrGet(pPath, "utf-16")
, DllCall("ole32\CoTaskMemFree", "Ptr",pPath))
}
Users browsing this forum: No registered users and 132 guests