uses shellapi;
const
WM_BARICON=WM_USER+200;
private
procedure wmsc(var message:TMessage); message wm_syscommand;
procedure wmb(var message:TMessage); message wm_baricon;
{ Private declarations }
public
{ Public declarations }
end;
procedure TForm1.wmb(var message: TMessage);
var lpData:PNotifyIconData;
begin
if (Message.LParam = WM_LBUTTONDOWN) then begin
//|paG¥I???¥o?????????°£|}|^I`μ!?f!C
lpData := new(PNotifyIconDataA);
lpData.cbSize := 88;//SizeOf(PNotifyIconDataA);
lpData.Wnd := Form1.Handle;
lpData.hIcon := Form1.Icon.Handle;
lpData.uCallbackMessage := WM_BARICON;
lpData.uID :=0;
lpData.szTip := '?﹐T|O?O‥t?';
lpData.uFlags := NIF_ICON or NIF_MESSAGE or NIF_TIP;
Shell_NotifyIcon(NIM_DELETE,lpData);
dispose(lpData);
Form1.Visible := True;
end;
end;
procedure TForm1.wmsc(var message: TMessage);
var lpData:PNotifyIconData;
begin
if Message.WParam = SC_ICON then begin
//|paG¥I?3I?p?Aμ!?f??μ!?f?AA|}|b¥o???W2K¥[??
lpData := new(PNotifyIconDataA);
lpData.cbSize := 88;
//SizeOf(PNotifyIconDataA);
lpData.Wnd := Form1.Handle;
lpData.hIcon := Form1.Icon.Handle;
lpData.uCallbackMessage := WM_BARICON;
lpData.uID :=0;
lpData.szTip := '3A¥÷‥t2I';
lpData.uFlags := NIF_ICON or NIF_MESSAGE or NIF_TIP;
Shell_NotifyIcon(NIM_ADD,lpData);
dispose(lpData);
Form1.Visible := False;
end else begin
//|paG?O‥a¥|aoSystemCommandRoR§??¥I‥t?¯E?U?2z‥c??2z?§!C
DefWindowProc(Form1.Handle,Message.Msg,Message.WParam,Message.LParam);
end;
end;
之前好像有找到元件 直接呼叫就可以縮小到工具列
一時之間查不到 若有查到會再補充
全站熱搜
留言列表