Вниз
Скачать: 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 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.011 c
3-76323
sergey32
2003-03-05 15:01
2003.03.24
Не могу передать числовой параметр в хранимую процедуру.


9-76255
Madburro
2002-08-24 22:16
2003.03.24
GLScene - попадание


14-76664
X-Man
2003-03-06 19:54
2003.03.24
Windows 98


1-76430
[BAD]Angel
2003-03-07 22:50
2003.03.24
Люди, помогите с реестром! (СРОЧНО)


4-76724
TAN
2003-01-29 14:49
2003.03.24
WinExec




   Наверх