请教高手,谢谢帮助!~_~ 我想做一个应用程序,要求类似sql server service manager ,在开机后能够自启动,并且能够在状态栏右下角有小图标,点击(或是程序中有事件触发)时弹出应用程序界面!能帮忙么?在此先谢了! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 rxlib的tryicon可以,名字记不清了,有demo,改改就可以了 自动启动,可以加在注册表的run键下 有一个apiShell_NotifyIcon自己看着参考用吧 自动启动,可以加在注册表的run键下Shell_NotifyIcon uses ShellAPI代码如下,不用外部控件unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, AppEvnts, ShellAPI;const SERVER_TRAY_MESSAGE = WM_USER + 100;type TForm1 = class(TForm) ApplicationEvents1: TApplicationEvents; procedure ApplicationEvents1Minimize(Sender: TObject); procedure FormActivate(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormCreate(Sender: TObject); private { Private declarations } ServerTrayIconData : TNotifyIconData; procedure ServerTrayMessage(var Message: TMessage); message SERVER_TRAY_MESSAGE; public { Public declarations } end;var Form1: TForm1;implementation{$R *.dfm}{ TForm1 }procedure TForm1.ServerTrayMessage(var Message: TMessage);begin if Message.Msg = SERVER_TRAY_MESSAGE then begin case Message.LParam of WM_LBUTTONDBLCLK: begin if IsIconic(Application.Handle) then begin ShowWindow(Application.Handle, SW_NORMAL); SetForegroundWindow(Application.Handle); end; end; end; end;end;procedure TForm1.ApplicationEvents1Minimize(Sender: TObject);begin ShowWindow(Application.Handle, SW_HIDE);end;procedure TForm1.FormActivate(Sender: TObject);begin Application.Minimize;end;procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);begin Shell_NotifyIcon(NIM_DELETE, @ServerTrayIconData);end;procedure TForm1.FormCreate(Sender: TObject);begin { 托盘 } ServerTrayIconData.cbSize := SizeOf(ServerTrayIconData); ServerTrayIconData.uFlags := NIF_ICON or NIF_TIP or NIF_MESSAGE; ServerTrayIconData.uID := UINT(Self); ServerTrayIconData.Wnd := Handle; ServerTrayIconData.hIcon := Application.Icon.Handle; ServerTrayIconData.szTip := '简单局域网聊天程序服务器端'; ServerTrayIconData.uCallbackMessage := SERVER_TRAY_MESSAGE; Shell_NotifyIcon(NIM_ADD, @ServerTrayIconData);end;end. 谁可以用delphi调用这个sys驱动恢复SSDT,谢谢帮忙了! 多个动态库调用问题,有几个不同品牌的硬件要控制,动态库都是按统一接口提供,调用平台怎么做? 如何学习Delphi delphi的调度功能很讨厌,程序一出错,老是打开delphi来调试,不知能否开闭? 关于自编控件的一个问题,请各位帮忙。 那位老大有VXML方面的资料否? 一个很简单的异常问题 一个小问题 我做的程序在 PII 机器上用没问题,而在 PIII 机器上用不了,请指教! 关于ZIPTV控件问题 谁有vfw的资料给一份? 看到一个用流读文件的函数的代码,不明白,请高人指点?
Shell_NotifyIcon
自己看着参考用吧
Shell_NotifyIcon uses ShellAPI
代码如下,不用外部控件
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, AppEvnts, ShellAPI;
const
SERVER_TRAY_MESSAGE = WM_USER + 100;type
TForm1 = class(TForm)
ApplicationEvents1: TApplicationEvents;
procedure ApplicationEvents1Minimize(Sender: TObject);
procedure FormActivate(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
ServerTrayIconData : TNotifyIconData; procedure ServerTrayMessage(var Message: TMessage); message SERVER_TRAY_MESSAGE;
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}{ TForm1 }procedure TForm1.ServerTrayMessage(var Message: TMessage);
begin
if Message.Msg = SERVER_TRAY_MESSAGE then
begin
case Message.LParam of
WM_LBUTTONDBLCLK:
begin
if IsIconic(Application.Handle) then begin
ShowWindow(Application.Handle, SW_NORMAL);
SetForegroundWindow(Application.Handle);
end;
end;
end;
end;
end;procedure TForm1.ApplicationEvents1Minimize(Sender: TObject);
begin
ShowWindow(Application.Handle, SW_HIDE);
end;procedure TForm1.FormActivate(Sender: TObject);
begin
Application.Minimize;
end;procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Shell_NotifyIcon(NIM_DELETE, @ServerTrayIconData);
end;procedure TForm1.FormCreate(Sender: TObject);
begin
{ 托盘 }
ServerTrayIconData.cbSize := SizeOf(ServerTrayIconData);
ServerTrayIconData.uFlags := NIF_ICON or NIF_TIP or NIF_MESSAGE;
ServerTrayIconData.uID := UINT(Self);
ServerTrayIconData.Wnd := Handle;
ServerTrayIconData.hIcon := Application.Icon.Handle;
ServerTrayIconData.szTip := '简单局域网聊天程序服务器端';
ServerTrayIconData.uCallbackMessage := SERVER_TRAY_MESSAGE;
Shell_NotifyIcon(NIM_ADD, @ServerTrayIconData);
end;end.