Danke.
Gruss
Code: Alles auswählen
Repeat
Event = WaitWindowEvent()
.......
Until EventID = #PB_Event_CloseWindow
Code: Alles auswählen
Repeat
Event = WaitWindowEvent()
.......
Until EventID = #PB_Event_CloseWindow
Code: Alles auswählen
EnableExplicit
Define EventID
If OpenWindow(0,0,0,500,400,"Window",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
Repeat
EventID=WaitWindowEvent()
If GetAsyncKeyState_(#VK_A)
Debug "Taste A wird gedrückt."
EndIf
If EventID = #PB_Event_CloseWindow
End
EndIf
ForEver
EndIfCode: Alles auswählen
EnableExplicit
If OpenWindow(0,0,0,500,400,"Window",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow : Break
Case #WM_KEYDOWN : Debug "Taste gedrückt"
Case #WM_KEYUP : Debug "Taste losgelassen"
EndSelect
ForEver
EndIf Code: Alles auswählen
EnableExplicit
If OpenWindow(0,0,0,500,400,"Window",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow : Break
Case #WM_KEYDOWN
If EventwParam() = #VK_A
Debug "A gedrückt"
EndIf
EndSelect
ForEver
EndIf 
Code: Alles auswählen
Procedure.l WindowCallback(hWnd, uMsg, wParam, lParam)
Result = #PB_ProcessPureBasicEvents
If uMsg = #WM_KEYUP And wParam = #VK_A
Debug "Taste A wurde gedrückt."
EndIf
ProcedureReturn Result
EndProcedure
If OpenWindow(0,0,0,500,250,"Window",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
SetWindowCallback(@WindowCallback())
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIfCode: Alles auswählen
Procedure.i WindowCallback(hWnd, uMsg, wParam, lParam)
Protected Result = #PB_ProcessPureBasicEvents
If uMsg = #WM_KEYUP And wParam = #VK_A
Debug "Taste A wurde gedrückt."
; Return = 0 oder
ProcedureReturn 0
EndIf
ProcedureReturn Result
EndProcedure
If OpenWindow(0, 0, 0, 500, 250, "Window", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
SetWindowCallback(@WindowCallback())
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf 