diff options
author | George Hazan <george.hazan@gmail.com> | 2013-02-06 13:59:23 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-02-06 13:59:23 +0000 |
commit | 499799acc71f753871757c43af89e744e9068d79 (patch) | |
tree | 3557372e58b6d348c2ddb09f5acf4a7639beccfe /plugins/HistoryPlusPlus/hpp_richedit.pas | |
parent | 557320085b66813a1f6f525bf0730ed0006ec05c (diff) |
fix for crash in h++
git-svn-id: http://svn.miranda-ng.org/main/trunk@3456 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/HistoryPlusPlus/hpp_richedit.pas')
-rw-r--r-- | plugins/HistoryPlusPlus/hpp_richedit.pas | 26 |
1 files changed, 7 insertions, 19 deletions
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);
|