Opt('MustDeclareVars', 1)

#include-once
#include <_Print.au3>
#include <WinAPISysWin.au3>
#include <WinAPIMisc.au3>

Global $g_iDEBUG

_Example()

Func _Example()
	_CW("> $g_iSCI_Codepage           --> " & $g_iSCI_Codepage)
	_CW("> $g_iSCI_OutputCodepage     --> " & $g_iSCI_OutputCodepage & '\n')

	_CW('@@ _Example() _Print.au3 <-- Mach einen Doppelklick auf diese Zeile!') ; Special! ;-)
	_CWSF('@@ _Example() FileName = %-32s, FileSize = %i Bytes, <-- %s\n', '"'&@ScriptName&'"', FileGetSize(@ScriptFullPath), 'Mach einen Doppelklick auf diese Zeile!') ; Special! ;-)

	Local $aWinList = WinList()
	_CW('> UBound($aWinList) = ' & UBound($aWinList) & '\n')
	For $i = 1 To $aWinList[0][0] Step 1
		If $aWinList[$i][0] And BitAND(WinGetState($aWinList[$i][1]), $WIN_STATE_VISIBLE) Then ; nur sichtbare Fenster
			_CWSF("> $aWinList[%3i][%3i] Handle = %s, Title = '%s'", $i, 1, $aWinList[$i][1], $aWinList[$i][0])
			_PrintPos('- WinPos', WinGetPos($aWinList[$i][1]))
			_PrintRect('- WinRect', _WinAPI_GetWindowRect($aWinList[$i][1]))
			_PrintClientSize('- ClientSize', WinGetClientSize($aWinList[$i][1]))
			_PrintPoint('- MousePos("relative coords to window")', _WinAPI_GetMousePos())
			_PrintPoint('- MousePos("screen to client coordinates")', _WinAPI_GetMousePos(True, HWnd($aWinList[$i][1])))
		EndIf
	Next
	ConsoleWrite(@CRLF)

	$g_iDEBUG = 0
	ConsoleWrite('> $g_iDEBUG = 0' & @CRLF)
	_DebugPrint('- _DebugPrint huhu') ; wird nicht ausgegeben!
	_DebugPrint('!! _DebugPrint tada') ; wird wegen '!!' ausgegeben!

	_DebugPrintStringFormat('- _DebugPrintStringFormat omg = %s\n', '0815') ; wird nicht ausgegeben!
	_DebugPrintStringFormat('!! _DebugPrintStringFormat hiphop = %s\n', '123') ; wird wegen '!!' ausgegeben!

	$g_iDEBUG = 1
	ConsoleWrite(@CRLF & '! $g_iDEBUG = 1' & @CRLF)
	_DebugPrint('> _DebugPrint easy')
	_DebugPrint('@@ _Example() _Print.au3 <-- Mach einen Doppelklick auf diese Zeile!') ; Special! ;-)
	_DebugPrintStringFormat('@@ _Example() _DebugPrintStringFormat go = %6i, to = %6i, sum = %12i, <-- %s\n', 123, 456, 123 + 456, 'Mach einen Doppelklick auf diese Zeile!') ; Special! ;-)
EndFunc  ;==>_Example

