function HookPLSQLMsgProc(code: Integer; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;
begin
if code = HC_ACTION then
begin
IDE_DebugLog(PChar(IntToHex(PMsg(lParam)^.Message, 4)));
if PMsg(lParam)^.Message = WM_CONTEXTMENU then
begin
ShowMessage('a111');
end;
end;
Result := CallNextHookEx(hookHandle, code, WParam, Longint(@lParam));
end;
// This function is called when the Plug-In is loaded into memory. You can use it to do
// some one-time initialization. PL/SQL Developer is not logged on yet and you can’t
// use the callback functions, so you are limited in the things you can do.
procedure OnActivate; cdecl;
begin
try
hookHandle := SetWindowsHookEx(WH_GETMESSAGE, HookPLSQLMsgProc, FindHInstance(Pointer(IDE_GetAppHandle())), 0);
IDE_DebugLog('Hook Success');
except
on E:Exception do
begin
IDE_DebugLog('Hook Error.');
IDE_DebugLog(PChar(e.Message));
end;
end;
end;