public int commandProc(int nextHandler, int theEvent, int userData) { if (OS.GetEventKind(theEvent) == OS.kEventProcessCommand) { HICommand command= new HICommand(); OS.GetEventParameter(theEvent,OS.kEventParamDirectObject, OS.typeHICommand, null,HICommand.sizeof, null, command); return handleCommand(command.commandID, theEvent); } return OS.eventNotHandledErr; }