Sign in to follow this  
Followers 0
BrettF

Find CD Drives

3 posts in this topic

How can i make the a user select a cd drive from a list of drives??

This is the code where i would like to put it into the gui.

Func InsertDisc ()
    Global $drive
$Form1_2 = GUICreate("PDB- Protected Disc Burner- STEP 2 ", 404, 259, 193, 115)
$Pic1 = GUICtrlCreatePic($sidesplash, 0, 0, 105, 257, BitOR($SS_NOTIFY,$WS_GROUP))
$Button1 = GUICtrlCreateButton("Next", 344, 232, 57, 25, 0)
$Button2 = GUICtrlCreateButton("Back", 280, 232, 57, 25, 0)
$Label1 = GUICtrlCreateLabel("Please insert a BLANK disk for the protection system to written to, along with the files specified in STEP 1.", 112, 8, 283, 33)
GUISetState(@SW_SHOW)

While 1
     $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $Button2
            GUISetState (@SW_HIDE, $Form1_2)
            SelectFolder ()
        Case $msg = $Button1
            $drive = DriveGetDrive ("CDROM")
                MsgBox(1,"", $drive)
            If DriveSpaceFree ($drive) = DriveSpaceTotal ($drive) Then
                    GUISetState (@SW_HIDE, $Form1_2)
                    Burn ()
                Else
                    MsgBox(48,"Blank Disc!","A blank Disk was not detected in drive: " & $drive & @CRLF & @CRLF & "Please insert a blank disk and try again.")
            EndIf
    EndSelect
WEnd
EndFunc

how should i do it?

Share this post


Link to post
Share on other sites



Here:

Func InsertDisc ()
    Global $drive
$Form1_2 = GUICreate("PDB- Protected Disc Burner- STEP 2 ", 404, 259, 193, 115)
;~ $Pic1 = GUICtrlCreatePic($sidesplash, 0, 0, 105, 257, BitOR($SS_NOTIFY,$WS_GROUP))
$Button1 = GUICtrlCreateButton("Next", 344, 232, 57, 25, 0)
$Button2 = GUICtrlCreateButton("Back", 280, 232, 57, 25, 0)
$Label1 = GUICtrlCreateLabel("Please insert a BLANK disk for the protection system to written to, along with the files specified in STEP 1.", 112, 8, 283, 33)
$DriveCombobox = GUICtrlCreateCombo("",10,10,60,20,$CBS_DROPDOWNLIST)
$as_drive = DriveGetDrive ("CDROM");this function returns an array
If Not @error = 1 Then
Local $s_ComboData
For $intcount = 1 to $as_drive[0]
    $s_ComboData &= "|"& StringUpper($as_drive[$intcount])
Next
GUICtrlSetData($DriveCombobox,StringTrimLeft($s_ComboData,1),$as_drive[1])
Else
    Msgbox(0,"ERROR","Could not get system CD and DVD drives.")
    Return 0
EndIf
GUISetState(@SW_SHOW)

While 1
     $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $Button2
            GUISetState (@SW_HIDE, $Form1_2)
            SelectFolder ()
        Case $msg = $Button1
            $drive = GUICtrlRead($DriveCombobox)
            If DriveSpaceFree ($drive) = DriveSpaceTotal ($drive) Then
                    GUISetState (@SW_HIDE, $Form1_2)
                    Burn ()
                Else
                    MsgBox(48,"Blank Disc!","A blank Disk was not detected in drive: " & $drive & @CRLF & @CRLF & "Please insert a blank disk and try again.")
            EndIf
    EndSelect
WEnd
EndFunc

"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

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