Jump to content

Start Apps with a button


Recommended Posts

how can I start an application with button in the GUI? :P

Brego

Hi Brego-

I would first look in the AutoIT help file, which is full of useful examples. Check out guicreate and guictrlcreatebutton for starters.

Also, search this forum for those same functions and see what other people have done.

Then, write some test code and post it here. You will get lots of feedback at that point.... :lmao:

...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format
Link to comment
Share on other sites

Hi Brego-

I would first look in the AutoIT help file, which is full of useful examples. Check out guicreate and guictrlcreatebutton for starters.

Also, search this forum for those same functions and see what other people have done.

Then, write some test code and post it here. You will get lots of feedback at that point.... :P

Hi jefhal

i have read the helpfile, before I have written here - of course. I found any examples to make events with a button click. But I'm unsure how I can start an application (I haven't found examples - sorry) with a button click, therefore I wrote here.

best regards

Brego

Link to comment
Share on other sites

Hi jefhal

i have read the helpfile, before I have written here - of course. I found any examples to make events with a button click. But I'm unsure how I can start an application (I haven't found examples - sorry) with a button click, therefore I wrote here.

best regards

Brego

Hey Jefhal,

If you know how to make events with a button click then starting an application is easy. Use the Run Function to run your application. (I'm also just a learner with the Gui's so hope I haven't led you astray). I've included some code that should work ok!!

#include <GuiConstants.au3>

; GUI
GuiCreate("Sample GUI", 400, 400)
GuiSetIcon(@SystemDir & "\mspaint.exe", 0)

; BUTTON
$button = GuiCtrlCreateButton("Sample Button", 10, 330, 100, 30)

While 1
    
    $msg = GUIGetMsg()
        Select
            Case $msg = $button
                Run(@ProgramFilesDir & "\Microsoft Office\office\excel.exe")
        EndSelect
WEnd
        
; GUI MESSAGE LOOP
GuiSetState()
While GuiGetMsg() <> $GUI_EVENT_CLOSE
         Exit
WEnd
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...