Jump to content

I Need Help.


 Share

Recommended Posts

What I want to do is create a GUI with an Install button which will activate a AutoIt script I created, and an Uninstall button which will close the programs. I have no idea where to even start at this.. This is my code.

#NoTrayIcon

MsgBox(64,"EzExit Loaded!", "EzExit has been loaded successfully. ")

$d2window = IniRead("EzExit.ini", "General", "D2Window", "NotFound")
$altf4 = IniRead("EzExit.ini", "General", "AltF4", "NotFound")

HotKeySet("{HOME}", "Terminate")
HotKeySet($altf4, "AltF4")

Func Terminate()
MsgBox(64,"EzExit Terminated!", "EzExit has been closed successfully.")
    Exit 0
EndFunc

Func AltF4()
WinWaitActive($d2window)
send("{altdown}")
send("{F4}")
send("{altup}")
  Return
EndFunc


While (1)
  Sleep(100)
Wend

Here is my INI file

[General]

;Name of the Diablo II window.
D2Window=Diablo II

;HotKey to Alt+F4. 
AltF4={F11}

Thank you,

Slothovan

Link to comment
Share on other sites

try this

#include <guiconstants.au3>
$main = guicreate ("MAIN", 300, 300)
$main_install = guictrlcreatebutton ("INSTALL", 10, 10)
$main_uninstall = guictrlcreatebutton ("UNINSTALL", 10, 40)
; the rest you want to add
guisetstate()
while 1
$msg = guigetmsg()
if $msg = $GUI_EVENT_CLOSE then exit
if $msg = $main_install then run ("autoit3.exe your script")
if $msg = $main_uninstall then sleep (100); don't have a clue what you mean by closing the programms so i added a sleep :)
wend

have fun

Link to comment
Share on other sites

just copy it in there as a udf

the whole thing might look like this

#include <guiconstants.au3>
$main = guicreate ("MAIN", 300, 300)
$main_install = guictrlcreatebutton ("INSTALL", 10, 10)
$main_uninstall = guictrlcreatebutton ("UNINSTALL", 10, 40)
; the rest you want to add
guisetstate()
while 1
$msg = guigetmsg()
if $msg = $GUI_EVENT_CLOSE then exit
if $msg = $main_install then thescript()
if $msg = $main_uninstall then sleep (100); don't have a clue what you mean by closing the programms so i added a sleep :)
wend


func thescript()
for $i = 1 to 100 step 1; here is where your script goes
sleep 100; and here
splashtexton($i, $i); and here
next; ...
endfunc
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...