win32 interface: prevent recursion when redirecting a WM_MOUSEWHEEL message

git-svn-id: trunk@10845 -
This commit is contained in:
vincents 2007-04-01 20:57:35 +00:00
parent a0cd202e73
commit 50948b0577
2 changed files with 43 additions and 39 deletions

View File

@ -1587,13 +1587,15 @@ begin
// check if the window is an edit control of a combobox, if so,
// redirect it to the combobox, not the edit control
if GetWindowInfo(TargetWindow)^.isComboEdit then
begin
TargetWindow := Windows.GetParent(TargetWindow);
if (TargetWindow <> Window) then
begin
Result := SendMessage(TargetWindow, WM_MOUSEWHEEL, WParam, LParam);
exit;
end;
// check InMouseWheelRedirection to prevent recursion
if not InMouseWheelRedirection and (TargetWindow <> Window) then
begin
InMouseWheelRedirection := true;
Result := SendMessage(TargetWindow, WM_MOUSEWHEEL, WParam, LParam);
InMouseWheelRedirection := false;
exit;
end;
// the mousewheel message is for us

View File

@ -302,6 +302,8 @@ var
MouseDownFocusStatus: TMouseDownFocusStatus = mfNone;
ComboBoxHandleSizeWindow: HWND = 0;
IgnoreNextCharWindow: HWND = 0; // ignore next WM_(SYS)CHAR message
// set to true, if we are redirecting a WM_MOUSEWHEEL message, to prevent recursion
InMouseWheelRedirection: boolean = false;
OnClipBoardRequest: TClipboardRequestEvent;
{$ifdef MSG_DEBUG}
MessageStackDepth: string = '';