program SSPreviewTest1; {$mode objfpc}{$H+} uses {$IFDEF UNIX} cthreads, {$ENDIF} {$IFDEF HASAMIGA} athreads, {$ENDIF} Interfaces, // this includes the LCL widgetset SysUtils, Windows, Controls, Forms, Unit1 { you can add units after this }; {$R *.res} var ParentHWND: HWND = 0; begin RequireDerivedFormResource := True; Application.Scaled := True; Application.Initialize; if (ParamCount >= 2) and (SameText(ParamStr(1), '/p')) then begin ParentHWND := StrToIntDef(ParamStr(2), 0); end; // プレビューモード以外(/s や /c)は何もしないで終了 if ParentHWND = 0 then Exit; Application.CreateForm(TForm1, Form1); {$PUSH} {$WARN 5044 OFF} // タスクバー完全抑制処理 // メインフォームをタスクバーと連動させない Application.MainFormOnTaskbar := False; {$POP} {$PUSH} {$WARN SYMBOL_PLATFORM OFF} // Application(隠し窓)にツールウィンドウ属性を与えてタスクバーから隠す SetWindowLong(Application.Handle, GWL_EXSTYLE, GetWindowLong(Application.Handle, GWL_EXSTYLE) or WS_EX_TOOLWINDOW); {$POP} // プレビューの実行 Form1.PreparePreview(ParentHWND); Application.Run; end.