我现在采用的是TBusinessSkinForm作为调整界面样式的控件,采用的是TRzTray作为托盘控件,因为这个托盘控件可以显示动画。
但是,现在当我把主窗口最小化后,所产生的所有窗口(主窗口,还有一些其他打开的窗口),全部最小化到托盘了。我现在想要:主窗口最小化到托盘,主窗口不要出现在任务栏,其他窗口照样打开不动,其他窗口可以出现在任务栏上。
-------------------------
TBusinessSkinForm的最小化源码如下:
procedure TbsBusinessSkinForm.DoMinimize;
var
P: TPoint;
begin
if (Application.MainForm = FForm)
then
begin
Application.Minimize
end
else
begin
if IsNullRect(OldBoundsRect)
then OldBoundsRect := FForm.BoundsRect;
P := GetMinimizeCoord;
FForm.SetBounds(P.X, P.Y, GetMinWidth, GetMinHeight);
if (FForm.FormStyle = fsMDIChild) and (FWindowState <> wsMaximized)
then
begin
SendMessage(Application.MainForm.Handle, WM_MDICHILDRESTORE, 0, 0);
end;
end;
end;
请问如何修改????我试过消息处理没有效果,代码如下:
procedure TForm1.WMSysCommand(var Message: TWMSysCommand);
begin
with Message do
begin
if CmdType and $FFF0 = SC_MINIMIZE then
ShowWindow(Handle, SW_MINIMIZE)
else inherited;
end;
end;
请问现在如何修改????非常感激!!!!!
但是,现在当我把主窗口最小化后,所产生的所有窗口(主窗口,还有一些其他打开的窗口),全部最小化到托盘了。我现在想要:主窗口最小化到托盘,主窗口不要出现在任务栏,其他窗口照样打开不动,其他窗口可以出现在任务栏上。
-------------------------
TBusinessSkinForm的最小化源码如下:
procedure TbsBusinessSkinForm.DoMinimize;
var
P: TPoint;
begin
if (Application.MainForm = FForm)
then
begin
Application.Minimize
end
else
begin
if IsNullRect(OldBoundsRect)
then OldBoundsRect := FForm.BoundsRect;
P := GetMinimizeCoord;
FForm.SetBounds(P.X, P.Y, GetMinWidth, GetMinHeight);
if (FForm.FormStyle = fsMDIChild) and (FWindowState <> wsMaximized)
then
begin
SendMessage(Application.MainForm.Handle, WM_MDICHILDRESTORE, 0, 0);
end;
end;
end;
请问如何修改????我试过消息处理没有效果,代码如下:
procedure TForm1.WMSysCommand(var Message: TWMSysCommand);
begin
with Message do
begin
if CmdType and $FFF0 = SC_MINIMIZE then
ShowWindow(Handle, SW_MINIMIZE)
else inherited;
end;
end;
请问现在如何修改????非常感激!!!!!
解决方案 »
- 如何用代码新建数据库?紧急
- VBA中有个例子,在delphi中怎么写
- 能否实现对内存中的数据集进行计算,然后打印??
- ???怎么增加可用分阿????(看看我的给分你就知道为什么了...)
- 关于事务的问题
- 文件读些问题
- delphi7 ado无法连接远程sqlserver2005
- 一个算法的问题,高分求救!!
- 我的程序在98下编的,到2000面目全非,惨不忍睹。
- 请问如何找到oracle call interface(OCI)的调用说明和完整的中文文档(English也行)?
- 怎样调用DBGridEh1KeyPress事件,调用的参数怎么写?
- DBGrid如何触发ADOQuery的AfterScroll事件?
procedure CreateParams(var Params:TCreateParams);override;
////////////////////////////////////////////////////////
procedure Tfrm_child.CreateParams(var Params: TCreateParams);
begin
inherited CreateParams(Params);
Params.WndParent := GetDesktopWindow;
end;
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,ShellAPI,
StdCtrls, Menus;const
WM_TRAYNOTIFY = WM_USER+100;type
TForm1 = class(TForm)
PopupMenu1: TPopupMenu;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
procedure TrayNotifyMessage(var Sender: TMessage); message WM_TRAYNOTIFY;
procedure MarkTaskBarIcon(Sender: TObject);
public
{ Public declarations }
end;var
Form1: TForm1;
tnd : TNOTIFYICONDATA;
implementation{$R *.DFM}procedure TForm1.FormCreate(Sender: TObject);
begin
Application.OnMinimize := MarkTaskBarIcon;
end;procedure TForm1.MarkTaskBarIcon(Sender: TObject);
begin
Form1.Visible := False;
tnd.cbSize := sizeof(tnd);
tnd.Wnd := Handle;
tnd.uID := 128;
tnd.uFlags := NIF_MESSAGE or NIF_ICON or NIF_TIP;
tnd.uCallbackMessage := WM_TRAYNOTIFY;
tnd.hIcon := Application.Icon.Handle;
StrPCopy(tnd.szTip,Application.Title);
Shell_NotifyIcon(NIM_ADD,@tnd);
end;procedure TForm1.TrayNotifyMessage(var Sender: TMessage);
begin
if Sender.LParam = WM_LBUTTONDBLCLK then
begin
Shell_NotifyIcon(NIM_DELETE,@tnd);
Form1.Visible := True;
Application.Restore;
Application.BringToFront;
end;
if wm_size=1 then
end;end.
--------------------
不晓得这个可不可以