Jump to content
Sign in to follow this  
thibeaz

Help with Gui Functions

Recommended Posts

thibeaz

Here is my code

Posted Image

(by the way this is a simple launcher for the sdl version of VisualBoyAdvance)

Could anybody help me please

#NoTrayIcon

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 350, 79, 193, 125)
$Button1 = GUICtrlCreateButton("Button1", 8, 8, 75, 25, 0)
$Input1 = GUICtrlCreateInput("Input1", 88, 8, 249, 21)
$Button2 = GUICtrlCreateButton("Button2", 8, 40, 331, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            $File = FileOpenDialog("Open Rom", @ScriptDir, "GBA (*.gba;*.zip)")
            GuiCtrlSetData($Input1, $File)
        Case $Button2
            ShellExecute(@ScriptDir + 'App\VisualBoyAdvance\vba.exe' + $Button1)

    EndSwitch
WEnd

Share this post


Link to post
Share on other sites
Richard Robertson

ShellExecute(@ScriptDir + 'App\VisualBoyAdvance\vba.exe' + $Button1)

This line is a problem. I don't know what you intended to do here, but I know that won't work.

Did you perhaps mean to use & to combine strings? + is only for addition of numbers and will not join strings.

Also, you'll need spaces and a slash. And I think that $Button1 was supposed to be $File.

ShellExecute(@ScriptDir & '\App\VisualBoyAdvance\vba.exe ' & $File)

Edited by Richard Robertson

Share this post


Link to post
Share on other sites
thibeaz

Thanks Mate I just found that out my self XD it's been sometime since I last used Autoit (mostly been working with delphi which does use the + sign XD), Really thanks a lot though man

Edited by thibeaz

Share this post


Link to post
Share on other sites
Richard Robertson

It happens. I've done it before too.

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.