当前位置:首页 > 软件开发 > dev
firefox

如何在状态栏中加入图标(或图片),还有动态的时间

function shell_notifyicon(dwmessage:dword;lpdata:pnotifyicondata):bool;stdcall;
在shellapi单元中。

dwmessage:nim_add
          nim_modify
          nim_delete

pnotifyicondata=^tnotifyicondataa
tnotifyicondataa=record
      cbsize:dword;
      wnd:hwnd;
      uid:uint;
      uflags:uint;
      ucallbackmessage:uint;
      hicon:hicon;
      sztip:array[0..63] of ansichar;
end;

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
...
const
     myiconid=1;
     myiconevent=wm_user+1;
...

private
       ...
       myicon:ticon;
...

//install
var
   icondata:tnotifyicon;
...
   myicon:=ticon.create;
   myicon.loadfromfile(icon1.ico);
   with icondata do
   begin
        cbsize:=sizeof(icondata);                 //
        wnd:=form1.handle;                        //
        uid:=myiconid;                            //
        uflags:=nif_icon;
        ucallbackmessage:=myiconevent;
        hicon:=handle;                           //change
        sztip:=my test icon;
        shell_notifyicon(nim_add,@icondata);
...
//做了标记的是改或删时要设的。

//precedure icononclick(msg:tmessage);message myiconevent;
if(msg.lparam=wm_rbuttondown) then
  getcursorpos(p);                              //p:tpoint;
  popupmenu1.popup(p.x,p.y);

 ↓相关文章:
© 2006-2008 All Rights Reserved