Sign in to follow this  
Followers 0
markj

Please don't think i'm stupid - this is an easy one

3 posts in this topic

Hi All

I'm a rank amateur/beginner at AutoIT but want to simply create a console for running other executables.

I used the gui wizard to create a simple image that has buttons on that link to other exe's but i cannot for the life in me work out how to link the buttons to the executables.

I know im thick and this is easy for you lot - but give me a chance and i'll get there in the end.

This is the only code i've got for the gui so far

GuiCreate("SolveSE Console", 296, 425,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))

$Label_1 = GuiCtrlCreateLabel("SolveSE Console: What do you want to do?", 40, 10, 270, 30)

$Button_2 = GuiCtrlCreateButton("Stop SolveSE", 10, 70, 270, 40)

$Button_3 = GuiCtrlCreateButton("Uninstall SolveSE", 10, 120, 270, 40)

$Button_4 = GuiCtrlCreateButton("Install New SolveSE", 10, 170, 270, 40)

$Button_5 = GuiCtrlCreateButton("Upgrade SmartSwitch", 10, 220, 270, 40)

$Button_6 = GuiCtrlCreateButton("Upgrade SCSrv", 10, 270, 270, 40)

$Button_7 = GuiCtrlCreateButton("Exit", 40, 320, 210, 40)

$Progress_8 = GuiCtrlCreateProgress(10, 380, 270, 30)

While 1

$msg = GuiGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE

ExitLoop

Case Else

;;;

EndSelect

WEnd

Exit

Any help with adding the functionality to launch exe's off each of these buttons would be greatly appreciated.

Thanks

Mark

Share this post


Link to post
Share on other sites



Case $msg = $Button_1
    Run('Some.exe')
Case $msg = $Button_2
    Run('Someother.exe')


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Welcome to the Forums!!

maybe

#include <GuiConstants.au3>

GuiCreate("SolveSE Console", 296, 425,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))

$Label_1 = GuiCtrlCreateLabel("SolveSE Console: What do you want to do?", 40, 10, 270, 30)
$Button_2 = GuiCtrlCreateButton("Stop SolveSE", 10, 70, 270, 40)
$Button_3 = GuiCtrlCreateButton("Uninstall SolveSE", 10, 120, 270, 40)
$Button_4 = GuiCtrlCreateButton("Install New SolveSE", 10, 170, 270, 40)
$Button_5 = GuiCtrlCreateButton("Upgrade SmartSwitch", 10, 220, 270, 40)
$Button_6 = GuiCtrlCreateButton("Upgrade SCSrv", 10, 270, 270, 40)
$Button_7 = GuiCtrlCreateButton("Exit", 40, 320, 210, 40)
$Progress_8 = GuiCtrlCreateProgress(10, 380, 270, 30)
GUISetState()

While 1
$msg = GuiGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE Or $msg = $Button_7
ExitLoop
Case $msg = $Button_2
    MsgBox(0,"", " button 2 was pressed   ")
;;;
EndSelect
WEnd
Exit

to learn alot quickly... check this out

http://www.autoitscript.com/forum/index.php?showtopic=21048#

8)

Edited by Valuater

NEWHeader1.png

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