function CallWndProc(nCode: integer; wParam: WPARAM; lParam: LPARAM): Longint; stdcall;
var
Msg: PCWPStruct;
begin
Msg := pointer(lParam);
case Msg.message of
WM_INITMENUPOPUP:
begin
InsertMenu(Msg.wParam, 0, MF_BYCOMMAND or MF_STRING, 100, 'Test');
end;
WM_MENUCOMMAND,WM_SYSCOMMAND:
begin
if Lo(Msg.wParam) = 100 then Beep(500,100);
end;
end;
Result := CallNextHookEx(hNextHook, nCode, wParam, lParam);
end;