mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-07 07:38:28 +02:00
Qt: TQtWidgetSet.GetDC() check if hwnd is valid handle.
git-svn-id: trunk@30541 -
This commit is contained in:
parent
fc8550cf53
commit
0abaa5be8e
@ -2268,18 +2268,14 @@ begin
|
|||||||
WriteLn('Trace:> [WinAPI GetDC] hWnd: ', dbghex(hWnd));
|
WriteLn('Trace:> [WinAPI GetDC] hWnd: ', dbghex(hWnd));
|
||||||
{$endif}
|
{$endif}
|
||||||
|
|
||||||
Widget := TQtWidget(hWnd);
|
if QtWidgetSet.IsValidHandle(hWnd) then
|
||||||
|
|
||||||
if Widget <> nil then
|
|
||||||
begin
|
begin
|
||||||
|
Widget := TQtWidget(hWnd);
|
||||||
Result := Widget.Context;
|
Result := Widget.Context;
|
||||||
if Result = 0 then
|
if Result = 0 then
|
||||||
Result := HDC(QtDefaultContext);
|
Result := HDC(QtDefaultContext);
|
||||||
end
|
end else
|
||||||
else
|
|
||||||
begin
|
|
||||||
Result := HDC(QtScreenContext);
|
Result := HDC(QtScreenContext);
|
||||||
end;
|
|
||||||
|
|
||||||
{$ifdef VerboseQtWinAPI}
|
{$ifdef VerboseQtWinAPI}
|
||||||
WriteLn('Trace:< [WinAPI GetDC] Result: ', dbghex(Result));
|
WriteLn('Trace:< [WinAPI GetDC] Result: ', dbghex(Result));
|
||||||
|
Loading…
Reference in New Issue
Block a user