Creates a Button control for the GUI.
GUICtrlCreateButton ( "text", left, top [, width [, height [, style = -1 [, exStyle = -1]]]] )
To set or change information in the control see GUICtrlUpdate...() functions.
A Button control can display an icon or image by using the $BS_ICON or $BS_BITMAP style. Use GUICtrlSetImage() to specify the picture to use.
To combine styles with the default style use BitOR ( $GUI_SS_DEFAULT_BUTTON, newstyle, ... ).
To use the values specified above you must #include <ButtonConstants.au3> in your script.
Default resizing is $GUI_DOCKSIZE
GUICoordMode (Option), GUICtrlUpdate..., GUIGetMsg
#include <GUIConstantsEx.au3>
Example()
Func Example()
; Create a GUI with various controls.
Local $hGUI= GUICreate ("Example",300,200)
; Create a button control.
Local $idButton_Notepad= GUICtrlCreateButton ("Run Notepad",120,170,85,25)
Local $idButton_Close= GUICtrlCreateButton ("Close",210,170,85,25)
; Display the GUI.
GUISetState (@SW_SHOW ,$hGUI)
Local $iPID= 0
; Loop until the user exits.
While 1
Switch GUIGetMsg ()
Case $GUI_EVENT_CLOSE,$idButton_Close
ExitLoop
Case $idButton_Notepad
; Run Notepad with the window maximized.
$iPID= Run ("notepad.exe","",@SW_SHOWMAXIMIZED )
EndSwitch
WEnd
; Delete the previous GUI and all controls.
GUIDelete ($hGUI)
; Close the Notepad process using the PID returned by Run.
If $iPIDThen ProcessClose ($iPID)
EndFunc ;==>Example