Einzelnen Beitrag anzeigen

horst

Registriert seit: 1. Jul 2003
347 Beiträge
 
Delphi 2007 Professional
 
#4

Re: Kontextmenü des TWebbrowser überall...

  Alt 28. Aug 2004, 16:35
hallo...
stimmt du hast recht...
aufrufen tue ich das so.... über einen button
Delphi-Quellcode:
HookID := SetWindowsHookEx(WH_MOUSE, MouseProc, 0, GetCurrentThreadId());

und

function MouseProc(nCode: Integer; wParam, lParam: Longint): Longint; stdcall;
var
  szClassName: array[0..255] of Char;
const
  ie_name = 'Internet Explorer_Server';
begin
  case nCode < 0 of
    True:
      Result := CallNextHookEx(HookIDb, nCode, wParam, lParam)
  else
    case wParam of
      WM_RBUTTONDOWN,
        WM_RBUTTONUP:
        begin
          GetClassName(PMOUSEHOOKSTRUCT(lParam)^.HWND, szClassName, SizeOf(szClassName));
          if lstrcmp(@szClassName[0], @ie_name[1]) = 0 then
            Result := HC_SKIP;
         // Form1.PopUpMenu1.PopUp(Mouse.CursorPos.X, Mouse.CursorPos.Y);
          Form1.WebBrowser1.PopupMenu.Popup(Mouse.CursorPos.X, Mouse.CursorPos.Y);
        end
    else
      Result := CallNextHookEx(HookIDb, nCode, wParam, lParam);
    end;

  end;

end;
habe die zeile nun eingefügt aber es funktioniert immer noch nicht.
Form1.WebBrowser1.PopupMenu.Popup(Mouse.CursorPos.X, Mouse.CursorPos.Y); gruß
horst
  Mit Zitat antworten Zitat