Sign in to follow this  
Followers 0

Gotta start somewhere.

5 posts in this topic

First yes I have the betta yes I use SciTE for editing.

Ok so I created a form with a bunch of buttons.

Sample: GuiCtrlCreateButton("regedit", 373, 330, 90, 20) and as a standalone

script i can make it run.

Run("regedit.exe") Now my questions.

A / When I click the button "regedit' what kind of code is required to run,start regedit.exe?The script without form works fine.

B / I am looking to make a popup appear for confirmation.IE:Run bla bla bla?ok/cancel

C / I can make a script to run a .VBS file but again can't figure out the on click or do or function.

D / When I place a picture acoss the form the buttons are still vissible but don't click.Send picture to back? how?

I guess a button that runs something other than a msg would be a nice place to start with autoit3 no?

All or any help to let the fun begin would be most appreciated.

Humble beginnings.

P.s most of the sample scipts provided show error.

Error parsing,Error unknown function,unresolved etc... Hard to learn that way.

Share this post

Link to post
Share on other sites

#2 ·  Posted (edited)

show us your script... then we can help you better

use this to post it

[ code ] ; no spaces

; post your code

[ /code ] ; no spaces


Edited by Valuater


Share this post

Link to post
Share on other sites

#3 ·  Posted (edited)

There are two approaches. I usually use the first method; however, the second way is better structured for complex GUIs and is similar to other programming languages.

The code for a confirmation box would be the same, but I just put it in the second example.

When a picture overlaps with a button, you need to disable the picture:

#include <GuiConstants.au3>
$myPic = GuiCtrlCreatePic("something.jpg", 10, 10)
GUICtrlSetState(-1, $GUI_DISABLE)
Just so you know, -1 in the above line referes to the most recently created control.  I could have also said GUICtrlSetState($myPic, $GUI_DISABLE)

Answers to question A:

#include <GuiConstants.au3>
GuiCreate("Example One")

$Button1 = GuiCtrlCreateButton("Launch Regedit", 100, 100, 200, 30)

While 1
    $msg = GuiGetMsg()
        Case $msg = $GUI_EVENT_CLOSE
        Case $msg = $Button1

#include <Constants.au3>
#include <GUIConstants.au3>
Opt("GUIOnEventMode", 1)

GUICreate("Example Two")
GUISetOnEvent($GUI_EVENT_CLOSE, "SpecialEvents")

$Button1 = GUICtrlCreateButton ("Launch Regedit",  10, 10, 100, 30)
GUICtrlSetOnEvent(-1, "RegeditButtonclicked")


; Just idle around
While 1

Func RegeditButtonclicked()
    $answer = MsgBox($MB_YESNO, "Confirm", "Do you want to run regedit?")
    If $answer = $IDYES Then Run("regedit.exe")

Func SpecialEvents()
Edited by CyberSlug

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post

Link to post
Share on other sites

Has no-one noticed that this is in the wrong forum. This is the V2 Support forum.

Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post

Link to post
Share on other sites

hahaha, they accidently clicked the wrong link, "7 links down".....

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  
Followers 0