我再瞎扯一下!
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ProgressConstants.au3>
#include <GuiComboBoxEx.au3>
#include <GuiComboBox.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("可用盘符", 306, 96)
$Combo1 = GUICtrlCreateCombo("", 24, 16, 145, 25)
$Button1 = GUICtrlCreateButton("确认挂载", 200, 16, 75, 25)
$Button2 = GUICtrlCreateButton("卸载", 200, 56, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
Global $pf = 0
Global $aNewOrder, $aNewOrderInfo[1][3], $aFixedOrder[27]
For $i = 65 To 90
If $pf = 0 And Not FileExists(Chr($i) & ':') Then $pf = $i
If Not FileExists(Chr($i) & ':') Then
If StringRegExp('XY', '(?i)' & Chr($i)) = 0 Then GUICtrlSetData($Combo1, Chr($i), Chr($pf))
EndIf
Next
Func zhkxyg($up = "")
$sPartion = _GUICtrlComboBox_GetList($Combo1)
If StringRight($sPartion, 1) == '|' Then $sPartion = StringTrimRight($sPartion, 1)
$aNewOrder = StringSplit($sPartion, '|', 1)
ReDim $aNewOrderInfo[UBound($aNewOrder)][3]
$aNewOrderInfo[0][0] = $aNewOrder[0]
For $i = 1 To $aNewOrder[0]
_GUICtrlComboBoxEx_SetCurSel($Combo1, GUICtrlRead($Combo1))
If GUICtrlRead($Combo1) = $aNewOrder[$i] Then
If $up = "" Then
ControlCommand('', '', $Combo1, 'SetCurrentSelection', $i)
Else
If $i <> 1 Then _GUICtrlComboBox_SetCurSel($Combo1, $i-2)
EndIf
ExitLoop
EndIf
Next
EndFunc ;==>zhkxyg
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $Button1
zhkxyg()
Case $Button2
zhkxyg("1")
;MsgBox(4096,"", "找到" & _GUICtrlComboBox_GetList ( $Combo1 ))
;_GUICtrlComboBoxEx_SetCurSel($Combo1,GUICtrlRead($Combo1)+1)
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
|