declare Titel$
declare x%,y%,e%,ico%
declare testbutton&
PROC FENSTER
let x% = 600
let y% = 400
let Titel$ = "Profan²-Demo für Tasten-Codes"
WindowTitle Titel$
Windowstyle 536
WINDOW add(%MaxX,div(sub(%MaxX,x%),2)),div(sub(%MaxY,y%),2) - x%,y%
SetTrueColor 1
AppendMenuBar 999,"Beenden"
ENDPROC
'##############################################################
FENSTER
SetWindowPos %HWnd = div(sub(%MaxX,x%),2),div(sub(%MaxY,y%),2) - x%,y%;0
whilenot e%
waitInput
print add$("%ScanKey: ",str$(%ScanKey))
print add$("%Key: ",str$(%Key))
print ""
if or(MenuItem(999),equ(%Key,2))
endif
wend
end