Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Сети";
Текущий архив: 2003.03.24;
Скачать: [xml.tar.bz2];

Вниз

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;
Скачать: [xml.tar.bz2];

Наверх




Память: 0.45 MB
Время: 0.007 c
3-76278
Anton.
2003-03-04 09:32
2003.03.24
Сверка DBF и Oracle


7-76683
Dracula2000
2003-01-29 15:32
2003.03.24
ModBus


1-76392
hooch
2003-03-13 10:41
2003.03.24
Bitmap в Excel


7-76676
stone
2003-01-14 11:59
2003.03.24
CDText


4-76728
fishca
2003-01-29 18:18
2003.03.24
Вываливается простейшая прога с ошибкой :(





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский