#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiButton.au3>
#include <File.au3>
#include <Array.au3>
$Form = GUICreate("",400,300)
$gx = _GUICtrlButton_Create($Form,"TEST",10,10,75,25)
GUISetState(@SW_SHOW)
GUIRegisterMsg($WM_COMMAND, "WM_COMMAND")
While 1
If GUIGetMsg() = $GUI_EVENT_CLOSE Then Exit
WEnd
Func WM_COMMAND($hWnd, $Msg, $wParam, $lParam)
#forceref $hWnd, $Msg
Local $nNotifyCode = BitShift($wParam, 16)
Local $nID = BitAND($wParam, 0x0000FFFF)
Local $hCtrl = $lParam
Switch $hCtrl
Case $gx
If $nNotifyCode = $BN_CLICKED Then
$file = _FileListToArray(@ScriptDir)
_ArrayDisplay($file)
EndIf
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc
|