ZeR0 Posted January 17, 2009 Share Posted January 17, 2009 Hi everybody, i here, with other problem... I found this script: expandcollapse popup#include <GUIConstantsEx.au3> #include <TreeViewConstants.au3> #include <WindowsConstants.au3> #Include <GuiTreeView.au3> #Include <File.au3> $gui = GUICreate("File Browser", 362, 378, -1, -1) $tree = GUICtrlCreateTreeView(0, 0, 361, 377) GUICtrlSetFont(-1,10) GUICtrlSetColor($tree, 0x00FF00) GUICtrlSetBkColor($tree,0x000000) $hImage = _GUIImageList_Create(16, 16, 5, 2) _GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 4) _GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 54) _GUICtrlTreeView_SetNormalImageList($tree, $hImage) GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") $root = _GUICtrlTreeView_AddChild($tree,"","C:\",0) $root = _GUICtrlTreeView_AddChild($tree,"","D:\",0) GUISetState(@SW_SHOW) $folder = DriveGetDrive( "all" ) While 1 $msg = GUIGetMsg() If $msg= -3 Then ExitLoop WEnd Func _SearchFolder($folder,$parent,$level=0) If $level >= 1 Then Return $files = _FileListToArray($folder,"*",1) $folders = _FileListToArray($folder,"*",2) _FolderFunc($folders,$folder,$parent,$level) _FileFunc($files,$parent) EndFunc Func _FileFunc($files,$parent) For $i = 1 To UBound($files)-1 _GUICtrlTreeView_AddChild($tree,$parent,$files[$i],1,1) Next EndFunc Func _FolderFunc($folders,$folder,$parent,$level) For $i = 1 To UBound($folders)-1 $parentitem = _GUICtrlTreeView_AddChild($tree,$parent,$folders[$i],0) _SearchFolder($folder & "\" & $folders[$i],$parentitem,$level+1) Next EndFunc Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam) Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR $hWndTreeView = GUICtrlGetHandle($tree) $tNMHDR = DllStructCreate($tagNMHDR, $ilParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iIDFrom = DllStructGetData($tNMHDR, "IDFrom") $iCode = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case $hWndTreeView Switch $iCode Case -451 $item = _GUICtrlTreeView_GetSelection($hWndTreeView) $root = $item If _GUICtrlTreeView_GetChildCount($hWndTreeView,$item) <= 0 Then $txt = _GUICtrlTreeView_GetText($hWndTreeView,$item) Do $parent = _GUICtrlTreeView_GetParentHandle($hWndTreeView,$item) If $parent <> 0 Then $txt = _GUICtrlTreeView_GetText($hWndTreeView,$parent) & "\" & $txt $item = $parent EndIf Until $parent = 0 _SearchFolder($txt,$root) EndIf EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc And i need list all drivers to view in the treeview, but i dont know how... i test with DriverGetDriver but not work... HELP! Link to comment Share on other sites More sharing options...
FireFox Posted January 17, 2009 Share Posted January 17, 2009 (edited) @Zer0 $dgd = DriveGetDrive("ALL") For $drive = 1 to $dgd[0] MsgBox(64, "DriveGetDrive", $dgd[$drive]) Next Cheers, FireFox. Edited January 17, 2009 by FireFox Link to comment Share on other sites More sharing options...
ZeR0 Posted January 17, 2009 Author Share Posted January 17, 2009 Hi Firefox, Tanks for ur Help, but i need Get the driver with the script... get the drivers and write the name in the tree view... i have checked with DriverGetDriver but not work :S Link to comment Share on other sites More sharing options...
FireFox Posted January 17, 2009 Share Posted January 17, 2009 @Zer0 Give me example because i dont understand what you mean... get drive name ? Cheers, FireFox. Link to comment Share on other sites More sharing options...
ZeR0 Posted January 17, 2009 Author Share Posted January 17, 2009 I Need get drivers and put in Child (TreeView) : $root = _GUICtrlTreeView_AddChild($tree,""," FUNCTION TO GET DRIVERS !!!",0) ??? Link to comment Share on other sites More sharing options...
FireFox Posted January 17, 2009 Share Posted January 17, 2009 @Zer0 DriveGetDrvier doesnt exists or its an udf.. what do you mean about driver ? sorry for all this questions Cheers, FireFox. Link to comment Share on other sites More sharing options...
ZeR0 Posted January 17, 2009 Author Share Posted January 17, 2009 Check with atention the first script Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now