Jump to content
Sign in to follow this  
Aces

GUI Ctrl's and Func's

Recommended Posts

Aces

#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

Share this post


Link to post
Share on other sites
poisonkiller

Add "If $msg = $shutdown Then poweroff()" after $GUI_EVENT_CLOSE line.

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  

×