From d2cf3ad43f0693c909aff61545d2e69e86368b69 Mon Sep 17 00:00:00 2001 From: jesus Date: Thu, 23 Jun 2011 07:07:04 +0000 Subject: [PATCH] LCL, windows, fix a crash on pressing a key when there is a (html) hint visible git-svn-id: trunk@31340 - --- lcl/interfaces/win32/win32callback.inc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lcl/interfaces/win32/win32callback.inc b/lcl/interfaces/win32/win32callback.inc index dadaf82398..5a5b919a68 100644 --- a/lcl/interfaces/win32/win32callback.inc +++ b/lcl/interfaces/win32/win32callback.inc @@ -187,6 +187,7 @@ type var CurDoubleBuffer: TDoubleBuffer = (DC: 0; Bitmap: 0; BitmapWidth: 0; BitmapHeight: 0); DisabledForms: TList = nil; + CurrentWindow: HWND = 0; function CheckMouseMovement: boolean; // returns true if mouse did not move between lmousebutton down @@ -1374,6 +1375,8 @@ begin end; WM_DESTROY: begin + if CurrentWindow=Window then + CurrentWindow := 0; if lWinControl is TCustomComboBox then DisposeComboEditWindowInfo(TCustomComboBox(lWinControl)); if WindowInfo^.Overlay<>HWND(nil) then @@ -2391,7 +2394,13 @@ begin // application processing if NotifyUserInput then + begin + CurrentWindow := Window; NotifyApplicationUserInput(PLMsg^.Msg); + if CurrentWindow=0 then + // Invalidate associated lWinControl if current window has been destroyed + lWinControl := nil; + end; if Assigned(lWinControl) and (PLMsg^.Msg <> LM_NULL) then DeliverMessage(lWinControl, PLMsg^);