13gu 发表于 2018-11-4 17:05:18

学习了 谢谢啊

yongge9999 发表于 2018-11-4 20:23:27

下载学习一下。

gywxdn 发表于 2018-11-16 14:41:51

炫彩助手下载

zhouzc88 发表于 2019-1-2 13:18:34

这个经常用到,学习学习。

120268323 发表于 2019-5-23 19:18:13

看看楼主同学的学习结果
谢谢分享

gtest 发表于 2019-6-11 12:34:44

涨见识了!

tarcy118 发表于 2019-6-18 10:51:01

不错支持一下

sunbaolu 发表于 2019-6-24 20:35:56

:face (29):

shykx 发表于 2019-8-29 03:10:15

看看效果。。

h111666b 发表于 2019-9-16 23:32:51

强烈支持,下载了

netmaple 发表于 2020-2-23 12:36:52

感谢楼主的分享,学习一下

沐月狐 发表于 2020-4-26 23:58:48

看看什么效果

haopp1 发表于 2020-7-25 17:25:01

过来康康 康康

cj4025 发表于 2020-8-14 14:25:12


#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

GUICreate(" 浏览", 211, 152, 8, 10, $WS_SYSMENU, $WS_EX_ACCEPTFILES)
GUISetBkColor(0xffffff)
GUISetFont(9, 400, '', '微软雅黑')
GUICtrlCreateIcon("shell32.dll", -77, 12, 23, 32, 32)

GUICtrlSetState(-1, $GUI_DISABLE)
$btn2 = GUICtrlCreateButton("取消", 93, 74, 88, 30)
$btn3 = GUICtrlCreateButton("浏览(B)...", 93, 24, 88, 30)
GUISetState()

$msg = 0
While $msg <> $GUI_EVENT_CLOSE
      $msg = GUIGetMsg()
      Select

                Case $msg = $btn2
                        ExitLoop
                Case $msg = $btn3
                        $var = FileOpenDialog('浏览', @UserProfileDir & "\", "所有文件(*.*)" )
                        GUICtrlSetData( $var, $var)
      EndSelect
WEnd


cj4025 发表于 2020-8-14 14:29:50

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <TreeViewConstants.au3>
#include <WindowsConstants.au3>
#include <WinAPIFiles.au3>
$S_Form = GUICreate("请选择目录", 250, 210, 345, 166)
$Tvw1 = GUICtrlCreateTreeView(8, 8, 233, 160,BitOR($TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS), $WS_EX_CLIENTEDGE)
$S_CmdOK = GUICtrlCreateButton("选择", 112, 175, 57, 25, $BS_DEFPUSHBUTTON)
$S_CmdClose = GUICtrlCreateButton("关闭", 176, 175, 57, 25)
GUISetState(@SW_SHOW)

_AddTreeView()

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE,$S_CmdClose
Exit
Case $S_CmdOK
MsgBox(0,0,GUICtrlRead($Tvw1,1))
EndSwitch
WEnd

Func _AddTreeView()
Local $DriveList,$i
$t_Title = GUICtrlCreateTreeViewItem('本地磁盘', $Tvw1)
GUICtrlSetColor(-1, 0x0000C0)

$DriveList = StringSplit(_GetLogicalDrives(),',')
For $i = 1 To $DriveList
GUICtrlCreateTreeViewItem($DriveList[$i] & ':\', $t_Title)
Next
GUICtrlSetState($t_Title, BitOR($GUI_EXPAND, $GUI_DEFBUTTON)) ; Expand the "General"-item and paint in bold
EndFunc ;==>_AddTreeView

;摘自DriveGetDrive示例
Func _GetLogicalDrives()
Local $aData, $aDrive = DriveGetDrive('FIXED')
Local $aList
Local $Return
For $i = 0 To UBound($aDrive) - 1
$aList[$i] = ''
Next
If IsArray($aDrive) Then
For $i = 1 To $aDrive
$aData = _WinAPI_GetDriveNumber($aDrive[$i])
If IsArray($aData) Then
$aList[$aData] &= StringUpper($aDrive[$i]) & ' '
EndIf
Next
EndIf
For $i = 0 To UBound($aDrive) - 1
If $aList[$i] Then
;~ ConsoleWrite('Drive' & $i & ' => ' & $aList[$i] & @CRLF)
$Return &= StringReplace($aList[$i], ': ', ',')
EndIf
Next
$Return = StringLeft($Return, StringLen($Return) - 1)
Return $Return
EndFunc ;==>_GetLogicalDrives
页: 1 [2] 3
查看完整版本: 选择驱动器的窗口