楼上的错了,你仔细看一看联机帮助吧! poScreenCenter:The form remains the size you left it at design time, but is positioned in the center of the screen. In multi-monitor applications, the form may be moved from this center position so that it falls entirely on one monitor, as specified by the DefaultMonitor property. poDesktopCenter:The form remains the size you left it at design time, but is positioned in the center of the screen. No adjustments are made for multi-monitor applications.
FindWindowEx(FindWindow('Shell_TrayWnd', nil), 0, 'ReBarWindow32', nil)
begin
WindowState:=wsMaximized;
BorderStyle:=bsNone;
align:=alNone;
end;
unit Unit1;interfaceuses
Windows, Messages, Forms;type
TForm1 = class(TForm)
private
{ Private declarations }
procedure wmsyscommand(var msg:Tmessage);message WM_syscommand; //最小化,最大化...等按钮单击消息
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.wmsyscommand(var msg:Tmessage);
begin
case msg.WParam of
SC_MAXIMIZE :
begin
ShowWindow(FindWindow('Shell_TrayWnd',nil),SW_SHOW);
Form1.Top := 0;
Form1.Left := 0;
Form1.Width := GetSystemMetrics(SM_CXSCREEN);
Form1.Height := GetSystemMetrics(SM_CYSCREEN);
end;
else
inherited; //响应其他消息 end;
end;end.
h:hwnd;
begin
h:=0;
h:=findwindow(pchar('shell_traywnd'),nil);
if h<>0 then
begin
sendmessage(h,wm_hide,0,0);
end;
请改为:
//ShowWindow(FindWindow('Shell_TrayWnd',nil),SW_HIDE);
poScreenCenter:The form remains the size you left it at design time, but is positioned in the center of the screen. In multi-monitor applications, the form may be moved from this center position so that it falls entirely on one monitor, as specified by the DefaultMonitor property.
poDesktopCenter:The form remains the size you left it at design time, but is positioned in the center of the screen. No adjustments are made for multi-monitor applications.