L leigp Unregistered / Unconfirmed GUEST, unregistred user! 2002-01-30 #1 我希望程序运行后,主窗体始终保持最大化, 现在的问题是如何在用户要将它最小化时,仍然 保持最大化。以便使主窗体始终占据整个屏幕,就 象delphi的主Form一样,最小化不了。
A alvinlv Unregistered / Unconfirmed GUEST, unregistred user! 2002-02-01 #4 1 拦截WM_SysCommand消息。 屏蔽 SC_MINIMIZE 消息. 2 写 Application.OnMinimize 事件,当系统最小化时。在最大化窗体。
L liuge Unregistered / Unconfirmed GUEST, unregistred user! 2002-02-01 #5 //先设置窗口的WindowState属性为wsMaximized,然后看下面的代码: unit Unit1; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs; type TForm1 = class(TForm) procedure onSysCommand(var msg:Tmessage);message wm_syscommand; private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.DFM} procedure TForm1.onSysCommand(var msg: Tmessage); begin if (msg.WParam <>61472) then DefaultHandler(msg); end; end.
//先设置窗口的WindowState属性为wsMaximized,然后看下面的代码: unit Unit1; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs; type TForm1 = class(TForm) procedure onSysCommand(var msg:Tmessage);message wm_syscommand; private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.DFM} procedure TForm1.onSysCommand(var msg: Tmessage); begin if (msg.WParam <>61472) then DefaultHandler(msg); end; end.
Y yitanhg Unregistered / Unconfirmed GUEST, unregistred user! 2003-01-18 #7 unit Unit1; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs; type TForm1 = class(TForm) procedure WMSysCommand(var msg:Tmessage); message wm_syscommand; private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.DFM} procedure TForm1.onSysCommand(var msg: Tmessage); begin if msg.cmdtype=SC_MINIMIZE then//如果最小化 sendmessage(wm_syscommand,SC_MAXIMIZE,0,0);//发送消息,让其最大化 else inherited; end; end.
unit Unit1; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs; type TForm1 = class(TForm) procedure WMSysCommand(var msg:Tmessage); message wm_syscommand; private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.DFM} procedure TForm1.onSysCommand(var msg: Tmessage); begin if msg.cmdtype=SC_MINIMIZE then//如果最小化 sendmessage(wm_syscommand,SC_MAXIMIZE,0,0);//发送消息,让其最大化 else inherited; end; end.
Y yitanhg Unregistered / Unconfirmed GUEST, unregistred user! 2003-01-18 #8 写错了一点 sendmessage(screen.activeform.handle,wm_syscommand,SC_MAXIMIZE,0);//发送消息,让其最大化
太 太阳火 Unregistered / Unconfirmed GUEST, unregistred user! 2003-01-18 #9 Form1.BorderIcons:=[biSystemMenu]; Form1.BorderStyle:=bsSingle; Form1.WindowState:=wsMaximized;