unit sub; //{$DEFINE DEBUG} interface uses Windows, Messages, SysUtils, Forms, Controls, Classes, ExtCtrls, myMessagePanel; type TApp_CheaPlayerSubForm = class(TForm) MyMessagePanel1: TMyMessagePanel; Timer2: TTimer; procedure FormCreate(Sender: TObject); procedure MyMessagePanel1TextChange(Sender: TObject; Text: WideString); procedure Timer2Timer(Sender: TObject); private { Private 宣言 } FhMainPlayer : HWND; //メインフォームのハンドルということではない public { Public 宣言 } end; var App_CheaPlayerSubForm: TApp_CheaPlayerSubForm; implementation uses {$IFDEF DEBUG} myDebug, {$ENDIF} myParam, myWindow, main; {$R *.dfm} procedure TApp_CheaPlayerSubForm.MyMessagePanel1TextChange(Sender: TObject; Text: WideString); var l_Param : TMyParam; begin {$IFDEF DEBUG} myDebug.gpcDebug(Text); {$ENDIF} l_Param := TMyParam.Create(Text); try if (l_Param.OptionExists('CLOSE')) then begin Close; end else if (l_Param.OptionExists('FROM')) then begin FhMainPlayer := StrToIntDef(l_Param.ValueString('FROM'), 0); gpcMessagePanelSend(Format('/TO_SUBPLAYER:%d', [MyMessagePanel1.Handle]), FhMainPlayer); end; finally l_Param.Free; end; end; procedure TApp_CheaPlayerSubForm.FormCreate(Sender: TObject); begin Self.Icon := Application.Icon; // main.SetCaption(Self, gfnsProductNameGet); SetWindowPos(Handle, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOACTIVATE); MyMessagePanel1TextChange(nil, ParamW.MessageText); Show; Timer2.Enabled := True; //タスクバーのアイコンを非表示に ShowWindow(Application.Handle, SW_HIDE); // Windows.SetParent(Application.Handle, gfnhDesktopListViewWindowGet); end; procedure TApp_CheaPlayerSubForm.Timer2Timer(Sender: TObject); begin if not(IsWindow(FhMainPlayer)) then begin Timer2.Enabled := False; Close; end else { if (IsWindowVisible(Application.Handle)) then begin //タスクバーのアイコンを非表示に ShowWindow(Application.Handle, SW_HIDE); end; } end; end.