Win32: use class helper for TApplication instead of typecast hack. Part of issue #41567.

This commit is contained in:
Bart 2025-07-30 12:04:22 +02:00
parent 047249a8f8
commit 769b7fdc4f

View File

@ -13,8 +13,24 @@
// {$C+}
// {$DEFINE ASSERT_IS_ON}
{$ENDIF}
type
TApplicationAccess = class(TApplication);
{ TApplicationAccessHelper }
// Provides access to protected methods and properties of TWinControl, without using a typecast hack,
// since such a typecast wil raise an EInvalidCast when compiled with -CR {$OBJECTCHECKS ON}
TApplicationAccessHelper = class helper for TApplication
public
procedure _ProcessAsyncCallQueue;
end;
{ TApplicationAccessHelper }
procedure TApplicationAccessHelper._ProcessAsyncCallQueue;
begin
ProcessAsyncCallQueue;
end;
{*************************************************************}
{ callback routines }
{*************************************************************}
@ -2064,7 +2080,7 @@ begin
CheckSynchronize;
TWin32Widgetset(Widgetset).CheckPipeEvents;
if Assigned(Application) then
TApplicationAccess(Application).ProcessAsyncCallQueue;
Application._ProcessAsyncCallQueue;
end;
WM_ENTERIDLE: Application.Idle(False);
WM_ACTIVATE: SetLMessageAndParams(LM_ACTIVATE);