Jump to content
Sign in to follow this  
cleiton12

Button help

Recommended Posts

cleiton12

hello autoiters

I have a doubt

wanted to know if a button is possible to open an Archiving outside the script example

I have a picture and when I press on the button opens the picture

example script

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("Form1", 302, 186, 192, 124)
$Button1 = GUICtrlCreateButton("Open Picture", 24, 32, 257, 97)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

Share this post


Link to post
Share on other sites
smartee

hi,

Have a look at ShellExecute in the helpfile.

Here is a quick demo :)

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

$Form1 = GUICreate("Demo1", 200, 150)
$Button1 = GUICtrlCreateButton("Launch", 50, 50, 100, 50)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            ShellExecute(@WindowsDir & "\Web\Wallpaper\Windows\img0.jpg")
    EndSwitch
WEnd

-smartee

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.