Jump to content

combo boxes


loooooser
 Share

Recommended Posts

Hello!

I'm a newbee on scripting and I need some help on a simple task with combo boxes.

I want $device to be a device name like "c,d" or whatever.

I want to format a device with a program called hpusbf.exe.

here is the code:

CODE
#include <GUIConstants.au3>

$testGUI = GUICreate("FAT32 formatter", 280 , 250)

$device = GUICtrlCreateCombo("", 10, 10, 40, -1, $CBS_DROPDOWNLIST)

GUICtrlSetData($device, "C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|X|Y|Z", "C")

$btn_start = GUICtrlCreateButton("Start", 10, 50, 50)

GUISetState(@SW_SHOW)

While 1

$msg = GUIGetMsg()

Select

Case $msg = $btn_start

$val = MsgBox(0 ,"test", @ScriptDir & "\utils\HPUSBF.exe " & $device & ":" & " /FS:fat32-Y -V:USB")

ExitLoop

EndSelect

WEnd

I choose MsgBox instead of runwait also for the output...

I want the $device to be a device like "C" or whatever i choose. now it become 3 why? And how to make it a device letter?

my output is : "@ScriptDir\utils\HPUSBF.exe 3: /FS:fat32-Y -V:USB"

I want the output to be "@ScriptDir\utils\HPUSBF.exe C: /FS:fat32-Y -V:USB"

Link to comment
Share on other sites

need to use GuiCtrlRead to get the selection

#include <GUIConstants.au3>

$testGUI = GUICreate("FAT32 formatter", 280, 250)
$device = GUICtrlCreateCombo("", 10, 10, 40, -1, $CBS_DROPDOWNLIST)
GUICtrlSetData($device, "C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|X|Y|Z", "C")
$btn_start = GUICtrlCreateButton("Start", 10, 50, 50)

GUISetState(@SW_SHOW)

While 1
    $msg = GUIGetMsg()

    Select
        Case $msg = $btn_start
            $val = MsgBox(0, "test", @ScriptDir & "\utils\HPUSBF.exe " & GUICtrlRead($device) & ":" & " /FS:fat32-Y -V:USB")
            ExitLoop
    EndSelect

WEnd

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

need to use GuiCtrlRead to get the selection

#include <GUIConstants.au3>

$testGUI = GUICreate("FAT32 formatter", 280, 250)
$device = GUICtrlCreateCombo("", 10, 10, 40, -1, $CBS_DROPDOWNLIST)
GUICtrlSetData($device, "C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|X|Y|Z", "C")
$btn_start = GUICtrlCreateButton("Start", 10, 50, 50)

GUISetState(@SW_SHOW)

While 1
    $msg = GUIGetMsg()

    Select
        Case $msg = $btn_start
            $val = MsgBox(0, "test", @ScriptDir & "\utils\HPUSBF.exe " & GUICtrlRead($device) & ":" & " /FS:fat32-Y -V:USB")
            ExitLoop
    EndSelect

WEnd
thanks!
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...