关于任务栏崩溃,托盘图标消失的问题

pengchao025 2012-08-21 10:55:34
小弟在网上看了个任务栏崩溃,重建托盘图标的代码,里面有个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;

procedure TForm1.FormCreate(Sender: TObject);
begin
TaskBarMSG := RegisterWindowMessage('HTaskBarCreated'); //注册任务栏恢复消息
end;

end.

...全文
129 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复

1,184

社区成员

发帖
与我相关
我的任务
社区描述
Delphi Windows SDK/API
社区管理员
  • Windows SDK/API社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧