Aces Posted June 11, 2007 Share Posted June 11, 2007 #include <GUIConstants.au3> GUICreate("CPU-Mach V0.1 - Made by Aces", 300,400) $shutdown = GUICtrlCreateButton("Power Off", 10, 10, 100, 50) GUISetState() While 1 $msg = GuiGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd Func poweroff() MsgBox(0, "Shutdown", "Your CPU will power off when you press OK.") Shutdown(9) EndFunc Func reboot() Shutdown(3) EndFunc Func logoff() Shutdown(0) EndFunc How do I add one of my functions [let's say poweroff()], to the button I added? ~~ AutoIt v3 Minion ~~Name: Kevin "Aces-X" MorrisOrganization: A C DevelopmentE-Mail: AcesX91@acecoding.netOS: XP Professional; Vista package~~ Released Software ~~CPU-Mach: Topic at acecoding.net ForumsProxyzBuddy: Beta testing at the moment, private onlyWHSTool: Not released to the public Link to comment Share on other sites More sharing options...
poisonkiller Posted June 11, 2007 Share Posted June 11, 2007 Add "If $msg = $shutdown Then poweroff()" after $GUI_EVENT_CLOSE line. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now