unit sub; //{$DEFINE DEBUG} interface uses Windows, Messages, SysUtils, Forms, Controls, Classes, ExtCtrls, myMessagePanel; type TApp_MEDIAPlayerSubForm = 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_MEDIAPlayerSubForm: TApp_MEDIAPlayerSubForm; implementation uses {$IFDEF DEBUG} myDebug, {$ENDIF} myParam, myWindow, main; {$R *.dfm} procedure TApp_MEDIAPlayerSubForm.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_MEDIAPlayerSubForm.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_MEDIAPlayerSubForm.Timer2Timer(Sender: TObject); begin if not(IsWindow(FhMainPlayer)) then begin Timer2.Enabled := False; Close; end else begin end; { if (IsWindowVisible(Application.Handle)) then begin //タスクバーのアイコンを非表示に ShowWindow(Application.Handle, SW_HIDE); end; } end; end.