请问怎么使程序在右下角的工具栏运行,任务栏不显示(50分)

  • 主题发起人 TomCat_ZYS
  • 开始时间
T

TomCat_ZYS

Unregistered / Unconfirmed
GUEST, unregistred user!
请问怎么使程序在右下角的工具栏运行,任务栏不显示,还有,怎么把窗口做成像XP那样的
 
I

icelovey

Unregistered / Unconfirmed
GUEST, unregistred user!
[DELPHI]程序不出现在任务栏
uses windows
var
Extendedstyle : Integer;
begin
Application.Initialize;
//==============================================================
Extendedstyle := GetWindowLong (Application.Handle, GWL_EXstyle);
SetWindowLong(Application.Handle, GWL_EXstyle, Extendedstyle OR WS_EX_TOOLWINDOW
AND NOT WS_EX_APPWINDOW);
//===============================================================
Application.Createform(Tform1, form1);
Application.Run;
end.

在右下角显示的话可以才用托盘控件,很多地方有下的!
 
Y

ynma

Unregistered / Unconfirmed
GUEST, unregistred user!
可以使用托盘控件,几乎不用编写代码!
 
B

baiduan

Unregistered / Unconfirmed
GUEST, unregistred user!
在uses
uses shellapi;
在publish中这样
//==========================
MyIcon: PNOTIFYICONDATA;
Icon: TIcon;
procedure getminmessage(var msg: Tmessage);
message wm_syscommand;
//拦截消息函数
//===========================
procedure Tmainform.getminmessage(var msg: Tmessage);
var
str1: string;
nid: TNotifyIconData;
st: Tstringlist;
count: integer;
i: integer;
begin
if msg.WParam = sc_restore then
begin
SetForegroundWindow(self.Handle);
self.Visible := true;
nid.cbSize := sizeof(nid);
// nid变量的字节数
nid.uID := getcurrentprocessid;
//内部标识,与加入小图标时的数一致
nid.Wnd := Handle;
//主窗口句柄
Shell_NotifyIcon(NIM_DELETE, @nid);
//去掉小图标
exit;
end;
if msg.WParam = SC_MINIMIZE then
begin
New(MyIcon);
MyIcon.cbSize := SizeOf(MyIcon^);
MyIcon.uID := getcurrentprocessid;
MyIcon.wnd := Handle;
MyIcon.uCallbackMessage := WM_MY_Notify;
MyIcon.uFlags := NIF_ICON + NIF_Tip + NIF_MESSAGE;
MyIcon.szTip := 'Utility Ping';
Icon := TIcon.Create;
if goping then
Icon.Handle := wgolbal.littleicon.Handle //决定显示的icon
else
Icon.Handle := wgolbal.bigicon.Handle;//
MyIcon.hIcon := Icon.handle;
self.Visible := false;
Shell_NotifyIcon(NiM_ADD, MyIcon);
//NIM_modify,NIM_delete
exit;
end;
//=================
procedure Tmainform.changeicon;
begin
New(MyIcon);
MyIcon.cbSize := SizeOf(MyIcon^);
MyIcon.uID := getcurrentprocessid;
MyIcon.wnd := Handle;
MyIcon.uCallbackMessage := WM_MY_Notify;
MyIcon.uFlags := NIF_ICON + NIF_Tip + NIF_MESSAGE;
MyIcon.szTip := 'Utility Ping';
Icon := TIcon.Create;
if goping then
icon.Handle := wgolbal.littleicon.Handle
else
icon.Handle := wgolbal.bigicon.Handle;
MyIcon.hIcon := Icon.handle;
//self.Visible := false;
Shell_NotifyIcon(NIM_MODIFY, MyIcon);
//去掉小图标
end;
//如果配上一个timer和好的图标还可以像qq一样闪动
 
B

baiduan

Unregistered / Unconfirmed
GUEST, unregistred user!
试用xp的界面就一个设置使用系统风格,
具体忘了,搜吧,很简单的。
 

Similar threads

顶部