فيSource التطبيق.
program Project1;
uses
System.StartUpCopy,
FMX.Forms,
FMX.Platform.Win, // اضف هذه
Winapi.Windows, // اضف هذه
Unit1 in 'Unit1.pas' {Form1};
{$R *.res}
// الاجراء الذي سيخفي الزر
procedure HideFmxApplicationFromTaskbar;
var
AppHandle: HWND;
Style: NativeInt;
begin
// 1. Get the invisible "Application" window handle FMX creates
AppHandle := FMX.Platform.Win.ApplicationHWND;
if AppHandle <> 0 then
begin
// 2. Hide it temporarily to apply changes without flickering
ShowWindow(AppHandle, SW_HIDE);
// 3. Get current Extended Styles
Style := GetWindowLongPtr(AppHandle, GWL_EXSTYLE);
// 4. REMOVE the "AppWindow" style (which forces a taskbar button)
// and ADD the "ToolWindow" style (which hides it from taskbar)
Style := (Style and (not WS_EX_APPWINDOW)) or WS_EX_TOOLWINDOW;
SetWindowLongPtr(AppHandle, GWL_EXSTYLE, Style);
// 5. Apply the changes
ShowWindow(AppHandle, SW_SHOW);
end;
end;
begin
HideFmxApplicationFromTaskbar; // اطلب اجراء اخفاء الزر هنا
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.