Jump to content

can't build GUI


qknet
 Share

Recommended Posts

I'm new at Autoit and have no background on programming. :o

Can any one help me with a code (autoit 3) that would build up a dialog on which there are a number of check-boxes and an OK button. clicking the OK button will run the selected programs, say, "pro1.exe", "pro2.exe"). :geek:

I can draw up the dialog with GuiBuilder but I don't know how to set the action.

Pls help

Edited by qknet
Link to comment
Share on other sites

but i don't know how to set the action.

What do you mean by "action", is it the function that will occur when the button is pressed?.

if so, you should have got a while 1/wend loop, and everything in the body of the script, right?. Then.

;;Put this under ExitLoop.
Case $msg = $YourButtonname;;Replace $YourButtonname with Your Button.
if GUIctrlread($Checkbox) = $GUI_CHECKED Then
Run("Pathtofile")
Elseif GUIctrlread($Checkbox) = $GUI_CHECKED Then
Run("PathtosecondFile")
Endif

i Havent Tested the code, so, hoping some other person will help you.

EDIT: Code.

Edited by NegativeNrG

[size=20]My File Upload[/size]Register at my site and upload.

Link to comment
Share on other sites

This is what I got from the code generated by GuiBuilder

#region --- GuiBuilder code Start ---

; Script generated by AutoBuilder 0.6 Prototype

#include <GuiConstants.au3>

GuiCreate("MyGUI", 150, 193,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))

$Checkbox_1 = GuiCtrlCreateCheckbox("Notepad", 20, 30, 90, 20)

$Checkbox_2 = GuiCtrlCreateCheckbox("Calculator", 20, 60, 90, 30)

$Checkbox_3 = GuiCtrlCreateCheckbox("Charmap", 20, 100, 80, 30)

$Button_4 = GuiCtrlCreateButton("OK", 20, 140, 60, 30)

GuiSetState()

While 1

$msg = GuiGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE

ExitLoop

Case Else

;;;

EndSelect

WEnd

Exit

#endregion --- GuiBuilder generated code End ---

So where should i insert your code?

Link to comment
Share on other sites

#region --- GuiBuilder code Start ---
; Script generated by AutoBuilder 0.6 Prototype

#include <GuiConstants.au3>

GuiCreate("MyGUI", 150, 193,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))

$Checkbox_1 = GuiCtrlCreateCheckbox("Notepad", 20, 30, 90, 20)
$Checkbox_2 = GuiCtrlCreateCheckbox("Calculator", 20, 60, 90, 30)
$Checkbox_3 = GuiCtrlCreateCheckbox("Charmap", 20, 100, 80, 30)
$Button_4 = GuiCtrlCreateButton("OK", 20, 140, 60, 30)

GuiSetState()
While 1
$msg = GuiGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop

Case $msg = $YourButtonname;;Replace $YourButtonname with Your Button.
if GUIctrlread($Checkbox) = $GUI_CHECKED Then
Run("Pathtofile")
Elseif GUIctrlread($Checkbox) = $GUI_CHECKED Then
Run("PathtosecondFile")
Endif

Case Else
;;;
EndSelect
WEnd
Exit
#endregion --- GuiBuilder generated code End ---

Replace Pathtofile and Pathtosecondfile with your exe path's name. so it could be.

Run("C:\Program files\file\myfile.exe")

Edited by NegativeNrG

[size=20]My File Upload[/size]Register at my site and upload.

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...