请问如何判断现在窗口是处于最大化的????

解决方案 »

  1.   

    用if FORM1.FormState=wsMaximized为最大化判断一下就行了。
    有问题请发信息到我的E-mail:[email protected]
      

  2.   

    就是API ISZoomed
    The IsZoomed function determines whether a window is maximized. BOOL IsZoomed(    HWND hWnd  // handle of window
       );
     ParametershWndIdentifies the window.  Return ValuesIf the window is zoomed, the return value is nonzero.
    If the window is not zoomed, the return value is zero.
      

  3.   

    if FORM1.FormState=wsMaximized如果是其它程序的窗口,就不能这样判断了。
      

  4.   

    给你个例子unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls;type
      TForm1 = class(TForm)
        Button1: TButton;
        Button2: TButton;
        procedure Button2Click(Sender: TObject);
      private
      private
      procedure WMsyscommand(var msg : Twmsyscommand);message wm_syscommand;
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.dfm}procedure Tform1.WMsyscommand(var msg : Twmsyscommand);
    begin
      if msg.CmdType = SC_MAXIMIZE then
         showmessage('现在最大化')
      else if msg.CmdType = SC_MINIMIZE then
         showmessage('现在最小化');
      inherited;
    end;end.
      

  5.   

    if FORM1.FormState=wsMaximized
    这个法不行呀,你们试过了吗?