组件制作之五(托盘组件)[13]

[入库:2005年8月18日] [更新:2007年3月24日]

本文简介:选择自 linzhengqun 的 blog

 if not (csdesigning in componentstate) then

 if (msg.msg=wm_syscommand) and(factive) then

 begin

   if msg.wparam=sc_minimize then

    begin

    //设置了这个属性后,窗口最小化就不会停在任务栏了,而是停在屏幕,

    //位置由setwindowplacement来决定

     showwindow(application.handle,sw_hide);

     setwindowlong(application.handle,gwl_exstyle      ,ws_ex_toolwindow);

     getwindowplacement(application.handle,@placement);

     placement.flags:=wpf_setminposition;

     placement.ptminposition.x:=1050;

     placement.ptminposition.y:=800;

     setwindowplacement(application.handle,@placement);

     settray(nim_add );

   end;

 end;

end;

 

procedure tmytray.seticon(value:ticon);

begin

   ficon.assign(value);

本文关键:组件制作之五(托盘组件)
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top