Jump to content

[How can I] pop a MsgBox when [Run] command fails?


star2
 Share

Recommended Posts

hey ppl it's - Mr, Alwayas asking - again

this time I'm having a hard time making this GUI do what I need

I have a Run Command and I want to pop a MsgBox of Failure instade of exiting the GUI

the user will press on the button and a MsgBox will tell him that the command is not available

here's my GUI

#include <GUIConstants.au3>

GUICreate("test", 120,70)
GUISetFont(12)
$send = GUICtrlCreateButton("Run", 25, 25, 50, 25)
GUISetState()

While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    If $msg = $send Then
        run ("1.exe")
    EndIf
WEnd
Edited by star2

[quote]Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams[/quote].............................................................................[u]AUTOIT[/u]

Link to comment
Share on other sites

I can't thank u enough I was searching but didn't find ur example (nice one)

u're always the answer

thanks again

#include <GUIConstants.au3>

GUICreate("test", 120,70)
GUISetFont(12)
$send = GUICtrlCreateButton("Run", 25, 25, 50, 25)
GUISetState()
Opt("RunErrorsFatal", 0) 

While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    If $msg = $send Then
        run ("1.exe")
        If @error Then MsgBox(48,'Error','Error with Run')
    EndIf
WEnd

[quote]Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams[/quote].............................................................................[u]AUTOIT[/u]

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