Jump to content
Sign in to follow this  

I am looking to make a script that allows the user to modify some values

Recommended Posts


I have this program that works really well but some users are going to need to put the hovering button in a new location on their screen and I want them to have the ability to change it without my intervention. I am thinking 2 seperate programs and an external ini file but I have not used an external ini to store and use data in an Autoit script. 1 Program to control the actual hovering button (code below) and 1 program to modify the location in a clean gui for the end user. Here is what is working now to put the hovering button in the upper right hand corner and function the way I want it to:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
Local $Button1, $b1label, $height, $width, $hPosition, $vPosition
$height = 75
$width = 80
$hPosition = $width
$vPosition = 1
GUICreate("Hovering Button", $width, $height, @DesktopWidth - $hPosition, $vPosition, $WS_POPUP, $WS_EX_TOPMOST)
GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
$Button1 = GUICtrlCreatePic("MacBackground.jpg", -1, -1)
GUICtrlSetState(-1, $GUI_DISABLE)
Opt("GUICoordMode", 2)
$b1label = GUICtrlCreateLabel("", 1, 1, $width, $height, 0x201)
GUICtrlSetOnEvent($b1label, "Change")

While 1
Func Change()
    If WinExists("My Program") Then; check to see if the program is already running
        WinActivate("My Program"); makes program active
        Run('My Program.exe') ; Starts program

Func _Exit()
EndFunc   ;==>_Exit

I want to control the:

$hPosition = $width

$vPosition = 1

from an external ini file and create a gui for the user to change the position. Does anyone have any good design ideas that can be called stupid proof? If not Ill wing it but I want minimal problems / tech support calls on this.

Lastly I am making the MACBackground.jpg the same dimensions as $width and $ height but A large portion of the picture is getting cropped when I run the program. Is the width and height parameters in GUICreate measured in pixels or something else?

Edited by computergroove

Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

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.