Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2006.05.21;
Скачать: CL | DM;

Вниз

Отключить контексное меню в TWebBrowser-e   Найти похожие ветки 

 
DelphiN! ©   (2006-04-24 10:46) [0]

Пробовал в TranslateAccelerator-е обнулить все свойства lpMsg, но не помогает ...

function TranslateAccelerator(const lpMsg: PMsg;
 const pguidCmdGroup: PGUID; const nCmdID: Cardinal): HRESULT;
begin
 lpMsg.lParam := 0;
 lpMsg.wParam := 0;
 lpMsg.message := 0;
 lpMsg.pt.X := 0;
 lpMsg.pt.Y := 0;
end;


Как это меню отключить?


 
easy ©   (2006-04-24 11:11) [1]

http://www.delphikingdom.com/asp/viewitem.asp?catalogid=355


 
DelphiN! ©   (2006-04-24 12:25) [2]


>  [1] easy ©   (24.04.06 11:11)


Через определение координат я уже дедал, но при каких то обстоятельствах пользователю все же удавалось установить фокус на TWebBrowser, и нажать кнопку "меню" на клавиатуре, что и вызывало контексное меню веббраузера.
Делал я так :



function GetComponentScreenPos(Comp: TWinControl): TPoint;
var
 Parent: TWinControl;
begin
 Result.X := Comp.Left;
 Result.Y := Comp.Top;
 Parent := Comp.Parent;
 while Parent <> nil do
 begin
   Result.X := Result.X+Parent.Left;
   Result.Y := Result.Y+Parent.Top;
   Parent := Parent.Parent;
 end;
end;

procedure WMMouseActivate(var Msg: TMessage);
var
 pCompPos,pComp2Pos,pScrPos: TPoint;
begin
 try
   pCompPos := GetComponentScreenPos(memNews);
   pComp2Pos := GetComponentScreenPos(WBBaner);
   GetCursorPos(pScrPos);
   inherited;
                    //513
     if (
        ( (pScrPos.X >= pCompPos.X)and(pScrPos.X <= (pCompPos.X+memNews.Width)) ) and
        ( (pScrPos.Y >= pCompPos.Y)and(pScrPos.Y <= (pCompPos.Y+memNews.Height)) ))
        or
        (
        ( (pScrPos.X >= pComp2Pos.X)and(pScrPos.X <= (pComp2Pos.X+WBBaner.Width)) ) and
        ( (pScrPos.Y >= pComp2Pos.Y)and(pScrPos.Y <= (pComp2Pos.Y+WBBaner.Height)) ) ) then
          Msg.Result:= MA_NOACTIVATEANDEAT


А есть ли другой способ отключить конексное меню в WebBrowser-e?


 
DelphiN! ©   (2006-04-24 12:46) [3]

Разобрался!

function WBBanerShowContextMenu(const dwID: Cardinal;
 const ppt: PPoint; const pcmdtReserved: IInterface;
 const pdispReserved: IDispatch): HRESULT;
begin
 Result := S_OK;
end;



Страницы: 1 вся ветка

Текущий архив: 2006.05.21;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.061 c
3-1143660996
XeON
2006-03-29 23:36
2006.05.21
Работа с локальными БД


9-1129832946
Galiaf
2005-10-20 22:29
2006.05.21
Учится хочу.


1-1144497861
так себе
2006-04-08 16:04
2006.05.21
По следам К.Пачеко. Двусторонняя печать


9-1129234201
$noopy.MC
2005-10-14 00:10
2006.05.21
Зацените игруху мою (openGL)


2-1146826978
gadyuka
2006-05-05 15:02
2006.05.21
События мыши