找回密码
 加入
搜索
楼主: Bone

[交流] 选择驱动器的窗口

[复制链接]
发表于 2018-11-4 17:05:18 | 显示全部楼层
学习了 谢谢啊
发表于 2018-11-4 20:23:27 | 显示全部楼层
下载学习一下。
发表于 2018-11-16 14:41:51 | 显示全部楼层
炫彩助手下载
发表于 2019-1-2 13:18:34 | 显示全部楼层
这个经常用到,学习学习。
发表于 2019-5-23 19:18:13 | 显示全部楼层
看看楼主同学的学习结果
谢谢分享
发表于 2019-6-18 10:51:01 | 显示全部楼层
不错支持一下
发表于 2019-9-16 23:32:51 | 显示全部楼层
强烈支持,下载了
发表于 2020-2-23 12:36:52 | 显示全部楼层
感谢楼主的分享,学习一下
发表于 2020-4-26 23:58:48 | 显示全部楼层
看看什么效果
发表于 2020-7-25 17:25:01 | 显示全部楼层
过来康康 康康
发表于 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


发表于 2020-8-14 14:29:50 | 显示全部楼层
[mw_shl_code=actionscript3,true]#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[0]
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[10]
Local $Return
For $i = 0 To UBound($aDrive) - 1
$aList[$i] = ''
Next
If IsArray($aDrive) Then
For $i = 1 To $aDrive[0]
$aData = _WinAPI_GetDriveNumber($aDrive[$i])
If IsArray($aData) Then
$aList[$aData[1]] &= 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[/mw_shl_code]
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-3-29 22:39 , Processed in 0.071556 second(s), 14 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表