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

Вниз

TWebBrouser не работает ctrl c   Найти похожие ветки 

 
BANick   (2003-02-04 12:38) [0]

текст нормально выделяется а в буфер обмена не заноситься. как с это пофиксить?


 
int64 ©   (2003-02-04 14:40) [1]

Q: Paste works fine, but Cut and Copy won"t work. What"s the problem?

A: You have to add the following line to the bottom of your unit:

initialization
OleInitialize(nil);

finalization
OleUninitialize;




Q: ShortCut (Ctrl-C, Ctrl-O, etc.) and Delete keys have no effect. What"s the problem?

A: It"s not a bug, it"s a feature. There"s information about this in a Microsoft KnowledgeBase article Q168777. The code below should fix the problem:

...

var
Form1: TForm1;
FOleInPlaceActiveObject: IOleInPlaceActiveObject;
SaveMessageHandler: TMessageEvent;

...

implementation

...

procedure TForm1.FormActivate(Sender: TObject);
begin
SaveMessageHandler := Application.OnMessage;
Application.OnMessage := MyMessageHandler;
end;

procedure TForm1.FormDeactivate(Sender: TObject);
begin
Application.OnMessage := SaveMessageHandler;
end;

procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Application.OnMessage := SaveMessageHandler;
FOleInPlaceActiveObject := nil;
end;

procedure TForm1.MyMessageHandler(var Msg: TMsg; var Handled: Boolean);
var
iOIPAO: IOleInPlaceActiveObject;
Dispatch: IDispatch;
begin
{ exit if we don"t get back a webbrowser object }
if WebBrowser = nil then
begin
Handled := False;
Exit;
end;

Handled:=(IsDialogMessage(WebBrowser.Handle, Msg) = True);

if (Handled) and (not WebBrowser.Busy) then
begin
if FOleInPlaceActiveObject = nil then
begin
Dispatch := WebBrowser.Application;
if Dispatch <> nil then
begin
Dispatch.QueryInterface(IOleInPlaceActiveObject, iOIPAO);
if iOIPAO <> nil then
FOleInPlaceActiveObject := iOIPAO;
end;
end;

if FOleInPlaceActiveObject <> nil then
if ((Msg.message = WM_KEYDOWN) or (Msg.message = WM_KEYUP)) and
((Msg.wParam = VK_BACK) or (Msg.wParam = VK_LEFT) or (Msg.wParam = VK_RIGHT)) then
//nothing - do not pass on Backspace, Left or Right arrows
else
FOleInPlaceActiveObject.TranslateAccelerator(Msg);
end;
end;



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

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

Наверх




Память: 0.47 MB
Время: 0.02 c
1-76460
dr.Karter
2003-03-12 11:01
2003.03.24
Интересующий вопрос


1-76397
Starkom
2003-03-10 16:31
2003.03.24
Как простым образом конвертнуть битмап в строку?


3-76281
roadrunner
2003-03-04 11:20
2003.03.24
В чем ошибка...Вроде бы все делаю правильно...Access и пароль


1-76435
Len
2003-03-11 22:45
2003.03.24
Прога


6-76559
BANick
2003-02-04 12:38
2003.03.24
TWebBrouser не работает ctrl c