Sign in to follow this  
Followers 0
eri

Combo AddDir ..??

8 posts in this topic

#include <GUIConstantsEx.au3>
#include <GUIComboBox.au3>

$Gui = GUICreate("Combo", 350, 100)
$Combo = GUICtrlCreateCombo("", 10, 10)
;$var = DriveGetFileSystem( "FAT32" )
_GUICtrlComboBox_AddDir($Combo, "", $DDL_DRIVES, False)
GUISetState(@SW_SHOW)


While 1
    $Msg = GUIGetMsg()
    Switch $Msg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

I want Create ComboBox Only Show Fat and Fat32 Partition...?? :mellow:

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

whatever Edited by MvGulik

"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Share this post


Link to post
Share on other sites

#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <GUIComboBox.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=fghfs.kxf
$Form1 = GUICreate("Form1", 395, 150, 192, 124)
$Combo1 = GUICtrlCreateCombo("Combo1", 96, 40, 161, 25)
_GUICtrlComboBox_AddDir($Combo1, "", $DDL_DRIVES, False)
$Button1 = GUICtrlCreateButton("Button1", 136, 112, 89, 17, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            MsgBox(64,"FILESYSTEM OF SELECTED DRIVE",GUICtrlRead($Combo1) & " is " & DriveGetFileSystem(GUICtrlRead($Combo1)))

    EndSwitch
WEnd


[size="5"] [/size]

Share this post


Link to post
Share on other sites

Simple helper function.

#include <GUIConstantsEx.au3>
#include <GUIComboBox.au3>

$Gui = GUICreate("Combo", 350, 100)
$Combo = GUICtrlCreateCombo("", 10, 10)
_AddDrives ($Combo, "FAT32|FAT")
GUISetState(@SW_SHOW)


While 1
    $Msg = GUIGetMsg()
    Switch $Msg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

;$hCombo        -> Handle to combo box
;$sFileSystem   -> String with a combinationfile systems to include.  Deliminated by "|".  Can be any of the following:
;                       -FAT
;                       -FAT32
;                       -NTFS
;                       -NWFS
;                       -CDFS
;                       -UDF

Func _AddDrives ($hCombo, $sFileSystem)
    $aDrives = DriveGetDrive ("ALL")
    For $i = 1 to $aDrives[0]
        $sys = DriveGetFileSystem ($aDrives[$i])
        If StringRegExp ($sys, "(" & $sFileSystem & ")") = 1 Then _GUICtrlComboBox_AddString ($hCombo, $aDrives[$I])
    Next
EndFunc

Share this post


Link to post
Share on other sites

In My Com.. C,D,F is NTFS

G and H is Removable FAT32

I want Create ComboBox Only Show Drive G and H..???

Share this post


Link to post
Share on other sites

Thank`S BrettF You Answer My Question.. :mellow:

Share this post


Link to post
Share on other sites

#include <GUIConstantsEx.au3>
#include <GUIComboBox.au3>

$Gui = GUICreate("Combo", 350, 100)
$Combo = GUICtrlCreateCombo("", 10, 10)
$var = DriveGetDrive( "all" )
Local $sDrives
If NOT @error Then
    For $i = 1 to $var[0]
        If DriveGetFileSystem($var[$i] & "\") = "FAT32" Then
            $sDrives = $sDrives & $var[$i] & "|"
        EndIf
    Next
EndIf

GUICtrlSetData($Combo,StringTrimRight($sDrives,1))
GUISetState(@SW_SHOW)


While 1
    $Msg = GUIGetMsg()
    Switch $Msg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd


GDIPlusDispose - A modified version of GDIPlus that auto disposes of its own objects before shutdown of the Dll using the same function Syntax as the original.EzMySql UDF - Use MySql Databases with autoit with syntax similar to SQLite UDF.

Share this post


Link to post
Share on other sites

+ This way too.

#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <GUIComboBox.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Array.au3>
#include <File.au3>
Dim $avarray

$value="A:\" & @CRLF & "B:\" & @CRLF & "C:\" & @CRLF & "D:\" & @CRLF & "E:\" & @CRLF & "F:\" & @CRLF & "G:\" & @CRLF & "H:\" & @CRLF & "I:\" & @CRLF & "J:\" & @CRLF & "K:\" & @CRLF & "L:\" & @CRLF & "M:\" & @CRLF & "N:\" & @CRLF & "O:\" & @CRLF & "P:\" & @CRLF & "Q:\" & @CRLF & "R:\" & @CRLF & "S:\" & @CRLF & "T:\" _
& @CRLF & "U:\" & @CRLF &"V:\" & @CRLF &"W:\" & @CRLF & "X:\" & @CRLF & "Y:\" & @CRLF & "Z:\"
FileWrite(@TempDir & "\temp.ini",$value)
_FileReadToArray(@TempDir & "\temp.ini",$avarray)
FileDelete(@TempDir & "\temp.ini")



$Form1 = GUICreate(":::", 395, 150, 192, 124)
$Combo1 = GUICtrlCreateCombo("", 96, 40, 161, 25)
For $i=0 To $avarray[0]

If DriveGetFileSystem($avarray[$i]) = "FAT32" Then
GUICtrlSetData($Combo1,$avarray[$i])

EndIf
Next

$Button1 = GUICtrlCreateButton("Check", 136, 112, 89, 17, $WS_GROUP)
GUISetState(@SW_SHOW)


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            MsgBox(64,"FILESYSTEM OF SELECTED DRIVE",GUICtrlRead($Combo1) & " is " & DriveGetFileSystem(GUICtrlRead($Combo1)))

    EndSwitch
WEnd

[size="5"] [/size]

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0