Many thanks for the quick replies!
RASHAD: it seems your code is for having my program send these keystrokes, not ignore them. But thanks, anyway.
RSBasic: That does the job! Here's my version of the code, compiled and tested using PB 5.70 (I had to remove Structure KBDLLHOOKSTRUCT as PB already has the structure defined):
Code:
EnableExplicit
Procedure.l KeyboardHook(nCode, wParam, *p.KBDLLHOOKSTRUCT)
If wParam = #WM_KEYDOWN Or wParam = #WM_SYSKEYDOWN
If *p\vkCode = $AE
Debug "volume down"
ProcedureReturn 1
ElseIf *p\vkCode = $AF
Debug "volume up"
ProcedureReturn 1
ElseIf *p\vkCode = $AD
; "volume mute", but ignore on key down due to keyboard auto-repeat
ProcedureReturn 1
EndIf
ElseIf wParam = #WM_KEYUP Or wParam = #WM_SYSKEYUP
If *p\vkCode = $AD
Debug "volume mute"
ProcedureReturn 1
EndIf
EndIf
ProcedureReturn CallNextHookEx_(0, nCode, wParam, *p)
EndProcedure
If OpenWindow(0,0,0,500,250,"Window",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
TextGadget(1,10,10,200,20,"Taste ''A'' wird gesperrt.",0)
StringGadget(2,10,30,200,20,"",0)
SetWindowsHookEx_(#WH_KEYBOARD_LL,@KeyboardHook(),GetModuleHandle_(0),0)
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf