小弟在网上看了个任务栏崩溃,重建托盘图标的代码,里面有个settryico未定义,不知道需要包含什么,哪位大哥告知下。
还是settryico是自己写的?代码如下:
unit Unit1;
 
interface
 
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs;
 
type
  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
  private
    procedure WndProc(var msg: Tmessage); override; //任务栏恢复消息(继承)
  public
    { Public declarations }
  end;
 
var
  Form1: TForm1;
  TaskBarMSG: Dword; //任务栏恢复消息
 
implementation
 
{$R *.dfm}
 
{ TForm1 }
 
procedure TForm1.WndProc(var msg: Tmessage); //任务栏恢复消息
begin
  if msg.msg = TaskBarMSG then SetTryico(Handle, Icon.Handle, AppTray); //重设ICON
  inherited WndProc(msg);
end;
end;
 
procedure TForm1.FormCreate(Sender: TObject);
begin
  TaskBarMSG := RegisterWindowMessage('HTaskBarCreated'); //注册任务栏恢复消息
end;
 
end.