Preventing Windows Taskbar and Messages from Appearing Over a Fullscreen Delphi FMX Application Running Indefinitely - Stack Ove

I have developed a Delphi 10.2. FMX application that runs in fullscreen mode on Windows 10 and 11, disp

I have developed a Delphi 10.2. FMX application that runs in fullscreen mode on Windows 10 and 11, displaying animated graphics continuously for extended periods (several months). To maintain an uninterrupted display, I've disabled all Windows messages and notifications. Nevertheless, it has already occurred that the Windows taskbar or other Windows messages appear over the application, disrupting the fullscreen experience.

To address this, I tried to implemented a TTimer that triggers every 10 seconds, attempting to bring the application back to the foreground and reassert its fullscreen state.

procedure TForm1.Timer1Timer(Sender: TObject);
var
  NativeHandle: HWND;
begin
  // Retrieve the native window handle
  NativeHandle := WindowHandleToPlatform(Self.Handle).Wnd;

  // Bring the form to the front
  SetForegroundWindow(NativeHandle);
end;

This works fine when I start the application in debugging mode from within the IDE. It does not work when I run the application directly outside the IDE by double clicking on the EXE file. In this case nothing happens when the timer event fires.

What could be the problem?

Or is my whole approach going in the wrong direction?

I have developed a Delphi 10.2. FMX application that runs in fullscreen mode on Windows 10 and 11, displaying animated graphics continuously for extended periods (several months). To maintain an uninterrupted display, I've disabled all Windows messages and notifications. Nevertheless, it has already occurred that the Windows taskbar or other Windows messages appear over the application, disrupting the fullscreen experience.

To address this, I tried to implemented a TTimer that triggers every 10 seconds, attempting to bring the application back to the foreground and reassert its fullscreen state.

procedure TForm1.Timer1Timer(Sender: TObject);
var
  NativeHandle: HWND;
begin
  // Retrieve the native window handle
  NativeHandle := WindowHandleToPlatform(Self.Handle).Wnd;

  // Bring the form to the front
  SetForegroundWindow(NativeHandle);
end;

This works fine when I start the application in debugging mode from within the IDE. It does not work when I run the application directly outside the IDE by double clicking on the EXE file. In this case nothing happens when the timer event fires.

What could be the problem?

Or is my whole approach going in the wrong direction?

Share Improve this question asked Nov 17, 2024 at 15:05 user3384674user3384674 8371 gold badge9 silver badges32 bronze badges
Add a comment  | 

1 Answer 1

Reset to default -2

In a clean Desktop start your program. Start the Task Manager and under Details select each explorer out of two and End Task. That will leave your program and Task Manager showing. Use Start New Task and add "explorer" in run dialog's edit box to get back to "Windows".

However, above only helps hiding the taskbar. On my Win 11 machine running Delphi 12.2 building and running a FMX program works until closing Delphi even with detach. This is fixed by not running Delphi in above Desktop. That is run the exe without Delphi running.

An industrial application may load only the program* and require a login to access the task manager and file explorer.

  • You would change windows registry to start your program and not explorer.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745635061a4637340.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信