Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Select path in windows explorer
#2
Function OpenFolder
Code:
Copy      Help
;/
function hwnd $folder

;Opens folder in existing Windows Explorer window.

;EXAMPLES
;OpenFolder win("" "ExploreWClass") "$desktop$"
;OpenFolder win("" "ExploreWClass") ":: 14001F50E04FD020EA3A6910A2D808002B30309D" ;;My Computer



SHDocVw.InternetExplorer f=GetFolderInterface(hwnd)
if(!f) end ES_FAILED
VARIANT v
str s.expandpath(folder)
if(s.beg(":: "))
#if _winnt>=5
,dll shell32 #ILGetSize ITEMIDLIST*pidl
,ITEMIDLIST* il=PidlFromStr(s)
,int ils=ILGetSize(il)
,ARRAY(byte) a.create(ils)
,memcpy(&a[0] il ils)
,CoTaskMemFree(il)
,v.attach(a)
#else
,ret
#endif
else v=s
f.Navigate2(v)

Function GetFolderInterface
Code:
Copy      Help
;/
function'SHDocVw.InternetExplorer hwnd

;Returns InternetExplorer interface of Windows Explorer window.


SHDocVw.ShellWindows sw._create
SHDocVw.InternetExplorer ie
foreach(ie sw)
,int h=ie.HWND; err continue
,if(h=hwnd) ret ie


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)