Jump to content

Button help


Recommended Posts

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
Link to comment
Share on other sites

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

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