;注意要编译为exe才有效果的
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Include <WinAPI.au3>
#NoTrayIcon
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 324, 189, 192, 124)
$Button1 = GUICtrlCreateButton("Button1", 192, 72, 57, 33)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
DllCall("kernel32.dll", "BOOL", "AllocConsole")
$hConsole = _WinAPI_GetStdHandle(1)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
DllCall("kernel32.dll", "BOOL", "FreeConsole")
Exit
Case $Button1
$s = @HOUR & ":" & @MIN & ":" & @SEC & @CRLF
_WinAPI_WriteConsole($hConsole, $s)
If @error Then MsgBox(0,"",@error)
EndSwitch
WEnd
|