admin管理员组文章数量:1434363
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 badges1 Answer
Reset to default -2In 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.
本文标签:
版权声明:本文标题:Preventing Windows Taskbar and Messages from Appearing Over a Fullscreen Delphi FMX Application Running Indefinitely - Stack Ove 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745635061a2667505.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论