Jump to content

Little help ;)


Recommended Posts

  • Developers

Sure, something like this:

Run('"notepad.exe" blablabalba ' & GuiCtrlRead($blablabla))

By the way: isn't your begging streak a little overkill?: Membername, Topic title and subtitle?

Just try to give your Topic titles a more meaningful text.

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Here's a simple script like what you're talking about.

#include <GUIConstantsEx.au3>

GUICreate("Example", 200, 100)
GUISetState()

$Run = GUICtrlCreateInput("notepad.exe", 50, 10, 100, 20)
$Button = GUICtrlCreateButton("Run!", 60, 40, 70, 25)

While 1
    $msg = GUIGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        Exit
    Case $msg = $Button
        $RunGet = GUICtrlRead($Run)
        If $RunGet <> "" Then
            Run($RunGet)
            If @error Then
                MsgBox(16, "Error", "File not found")
            EndIf
        Else
            MsgBox(16, "Error", "No text entered")
        EndIf
    EndSelect
WEnd
Link to comment
Share on other sites

Simple InputBox Example:

While 1
    $Run = InputBox("Example", "Enter .exe to Run", "notepad.exe")
    If @error = 1 Then Exit
    If Run($Run) = 0 Then MsgBox(16, "Error", "File not found")
WEnd

Donald8282's Example Simplified:

#include <GUIConstantsEx.au3>

GUICreate("Example", 200, 100)
GUISetState()

$Run = GUICtrlCreateInput("notepad.exe", 50, 10, 100, 20)
$Button = GUICtrlCreateButton("Run!", 60, 40, 70, 25)

While 1
    $msg = GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button
            If Run(GUICtrlRead($Run)) = 0 Then MsgBox(16, "Error", "File not found")
    EndSwitch
WEnd
Edited by rogue5099
Link to comment
Share on other sites

Simple InputBox Example:

While 1
    $Run = InputBox("Example", "Enter .exe to Run", "notepad.exe")
    If @error = 1 Then Exit
    If Run($Run) = 0 Then MsgBox(16, "Error", "File not found")
WEnd

Donald8282's Example Simplified:

#include <GUIConstantsEx.au3>

GUICreate("Example", 200, 100)
GUISetState()

$Run = GUICtrlCreateInput("notepad.exe", 50, 10, 100, 20)
$Button = GUICtrlCreateButton("Run!", 60, 40, 70, 25)

While 1
    $msg = GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button
            If Run(GUICtrlRead($Run)) = 0 Then MsgBox(16, "Error", "File not found")
    EndSwitch
WEnd

I was thinking of doing it that way but I had time on my hands and nothing to do =P
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...