我想实现:当我的程序最小化时,在某一个时间点,程序自动激活并最大化显示。如何实现?
程序主窗体为Form_main
其中下列方法我了试一下:
   Form_main.WindowState :=wsMaximized;好像不可以
   showwindow(Form_main.handle,SW_SHOWMAXIMIZED);好像也不可以

解决方案 »

  1.   

    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls, ExtCtrls;type
      TForm1 = class(TForm)
        Button1: TButton;
        Timer1: TTimer;
        procedure Timer1Timer(Sender: TObject);
      private
        { Private declarations }
        procedure MySyscommand(var Msg:TWMSyscommand);message wm_syscommand;
      public
        { Public declarations }
      end;var
      Form1: TForm1;
      Start: TDateTime;implementation{$R *.dfm}{ TForm1 }procedure TForm1.MySyscommand(var Msg: TWMSyscommand);
    begin
         inherited;
         if (Msg.CmdType and $fff0 = sc_minimize) then
         begin
            Timer1.Enabled := True;
            Start := Now;
         end;
    end;procedure TForm1.Timer1Timer(Sender: TObject);
    begin
        showwindow(handle,SW_NORMAL)
    end;end.我自己刚才试了试,只有在把Form的FormStyle属性设置为fsStayOnTop的时候才会起作用
      

  2.   

    原理是拦截最小化消息,激活Timer,初始化时Timer.enabled := False;
      

  3.   

    yi.............is these c/c++ codes??
      

  4.   

    Are.........英文真滥,想冒充一下都不行
      

  5.   

    procedure TForm1.Timer1Timer(Sender: TObject);
    begin
      Application.Restore();
      WindowState := wsMaximized;
    end;