开发开发

软件的生命
随笔 - 18, 文章 - 0, 评论 - 0, 引用 - 0
数据加载中……

mycode1

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;

 

 

posted on 2011-09-23 22:57 wm6run 阅读(149) 评论(0)  编辑  收藏