mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-13 02:49:06 +02:00
win32: activate application when inactive disabled form is clicked (windows does not send any other messages for such forms than WM_SETCURSOR) - fixes issue #0019069
git-svn-id: trunk@36182 -
This commit is contained in:
parent
a793b4fa1f
commit
0d66913910
@ -706,9 +706,11 @@ var
|
|||||||
lControl: TControl;
|
lControl: TControl;
|
||||||
BoundsOffset: TRect;
|
BoundsOffset: TRect;
|
||||||
ACursor: TCursor;
|
ACursor: TCursor;
|
||||||
|
MouseMessage: Word;
|
||||||
begin
|
begin
|
||||||
if (lWinControl <> nil) and not (csDesigning in lWinControl.ComponentState)
|
if Assigned(lWinControl) then
|
||||||
and (LOWORD(LParam) = HTCLIENT) then
|
begin
|
||||||
|
if not (csDesigning in lWinControl.ComponentState) and (LOWORD(LParam) = HTCLIENT) then
|
||||||
begin
|
begin
|
||||||
ACursor := Screen.Cursor;
|
ACursor := Screen.Cursor;
|
||||||
if ACursor = crDefault then
|
if ACursor = crDefault then
|
||||||
@ -733,6 +735,25 @@ var
|
|||||||
Windows.SetCursor(Screen.Cursors[ACursor]);
|
Windows.SetCursor(Screen.Cursors[ACursor]);
|
||||||
LMessage.Result := 1;
|
LMessage.Result := 1;
|
||||||
end;
|
end;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if (LOWORD(LParam) = Word(HTERROR)) then
|
||||||
|
begin
|
||||||
|
MouseMessage := HIWORD(LParam);
|
||||||
|
// a mouse click on a window
|
||||||
|
if ((MouseMessage = WM_LBUTTONDOWN) or
|
||||||
|
(MouseMessage = WM_RBUTTONDOWN) or
|
||||||
|
(MouseMessage = WM_XBUTTONDOWN)) and
|
||||||
|
Assigned(Screen) and Assigned(Screen.ActiveCustomForm) and
|
||||||
|
Screen.ActiveCustomForm.HandleAllocated and
|
||||||
|
(GetForegroundWindow <> Screen.ActiveCustomForm.Handle) then
|
||||||
|
begin
|
||||||
|
// A mouse click is happen on our application window which is not active
|
||||||
|
// we need to active it ourself. This is needed only when click is happen
|
||||||
|
// on disabled window (e.g. ShowModal is called and non modal window is clicked)
|
||||||
|
Win32WidgetSet.AppBringToFront;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
if LMessage.Result = 0 then
|
if LMessage.Result = 0 then
|
||||||
begin
|
begin
|
||||||
@ -1005,7 +1026,6 @@ begin
|
|||||||
WinProcess := True;
|
WinProcess := True;
|
||||||
NotifyUserInput := False;
|
NotifyUserInput := False;
|
||||||
|
|
||||||
//WriteLn('Msg: ', WM_To_String(Msg), ' ', WndClassName(Window));
|
|
||||||
WindowInfo := GetWin32WindowInfo(Window);
|
WindowInfo := GetWin32WindowInfo(Window);
|
||||||
if WindowInfo^.isChildEdit then
|
if WindowInfo^.isChildEdit then
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user