From 499799acc71f753871757c43af89e744e9068d79 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 6 Feb 2013 13:59:23 +0000 Subject: fix for crash in h++ git-svn-id: http://svn.miranda-ng.org/main/trunk@3456 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/HistoryPlusPlus/hpp_richedit.pas | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) (limited to 'plugins/HistoryPlusPlus') diff --git a/plugins/HistoryPlusPlus/hpp_richedit.pas b/plugins/HistoryPlusPlus/hpp_richedit.pas index cdfac15c79..ed80232967 100644 --- a/plugins/HistoryPlusPlus/hpp_richedit.pas +++ b/plugins/HistoryPlusPlus/hpp_richedit.pas @@ -1111,6 +1111,7 @@ uses hpp_global; type + PClass = ^TClass; EOleError = class(Exception); const @@ -1758,28 +1759,15 @@ begin inherited; end; -type - InheritedWMRButtonUp = procedure(var Message: TWMRButtonUp) of object; - procedure THppRichedit.WMRButtonUp(var Message: TWMRButtonUp); - - function GetDynamicMethod(AClass: TClass; Index: Integer): Pointer; - asm call System.@FindDynaClass end; - var - Method: TMethod; + ClassOld: TClass; begin - Method.Code := GetDynamicMethod(TCustomMemo,WM_RBUTTONUP); - Method.Data := Self; - InheritedWMRButtonUp(Method)(Message); - // RichEdit does not pass the WM_RBUTTONUP message to defwndproc, - // so we get no WM_CONTEXTMENU message. - // Simulate message here, after EN_LINK defwndproc's notyfy message -{!! - if Assigned(FRichEditOleCallback) or (Win32MajorVersion < 5) then - Perform(WM_CONTEXTMENU, Handle, LParam(PointToSmallPoint( - ClientToScreen(SmallPointToPoint(TWMMouse(Message).Pos))))); -} + ClassOld := PClass(Self)^; + PClass(Self)^ := TCustomMemo; + with TMessage(Message) do + Perform(WM_RBUTTONUP, WParam, LParam); + PClass(Self)^ := ClassOld; end; procedure THppRichedit.WMSetFocus(var Message: TWMSetFocus); -- cgit v1.2.3