Application.OnMinimize
OnRestore
OnActivate
OnDeactivate
OnRestore
OnActivate
OnDeactivate
解决方案 »
- 在线等待!FastReport中如何实现用户自定义字段进行打印!马上揭贴!!
- 自从装了Delphi7.0之后...
- 问题:D7的 RaveReport 如何在一个报表中实现主-细表打印? 有经验的请进
- 请问如何把可执行程序中的数据库分离出来?
- 到底如何通过编程发送手机短信?:(
- delphi 7.0-
- IMGEDIT.OCX 未注册无法使用的问题IMAGING FOR WINDOWS
- 关于VisualStido里的Help WorkShop如何使用?
- 寻找最适合做类似资源管理器的构件
- 如何用Delphi编程实现隐藏"添加/删除程序"弹出窗口中的特定程序项目显示?
- 关于COM+的问题,请各位高手关注!
- 非常简单的Excel控制问题,就一句话!请帮忙!
if Form = Application.MainForm then begin
if IsIconic(Application.Handle) then begin
Reg File.Write Integer(Sect Name,'WindowState',
Integer(wsMinimized));
end;
end;
end;
RegFile.Free;
end;
type
TForm1 = class(TForm)
private
procedure WMSysCommand(var Message: TMessage); message WM_SYSCOMM
AND;
//...
end; implementation {$R *.DFM}
procedure TForm1.WMSysCommand(var Message:TMessage);
begin
if Message.WParam = SC_ICON then //最小化了
begin
//...
end
else
inherited;
end;
type
TForm1 = class(TForm)
private
procedure Minimize(var mess:TWMNCLBUTTONDOWN);message WM_NCLBUTTON
DOWN;
//...
end; implementation {$R *.DFM}
procedure TForm1.Minimize(var mess:TWMNCLBUTTONDOWN);
begin
if mess.hittest=htreduce then //htreduce表示是否按了最小化按钮
begin
//Form1.hide; ...
end
else
inherited;
end;
AState := 'iconic'
else
begin
if application.active then
AState := 'active'
else
AState := 'unactive'
end;
方法知道了状态。但是,
当我用下面的方法来恢复的时候,却出了问题。假如是最小化状态或者active状态都没问题,但是‘deactive’,即被其它窗口覆盖的情况,restore却会跳到最上面来!而我希望是回到他原来的状态。
if AState<>'iconic' then
begin
//showwindow(application.Handle,sw_hide);
application.minimize;
application.Restore;
end;