windows – 除了ICON_BIG之外,如何让Delphi 10.2 Tokyo尊重ICON_
发布时间:2021-03-07 18:25:48 所属栏目:站长百科 来源:网络整理
导读:副标题#e# 如何在Delphi 10.2中实现以下目标:我需要Delphi自动设置大图标,而不是每个窗口的大小图标.我需要有机会,对于某些表单,以及TApplication,在运行时更改图标.我希望在不修改VCL.Forms.pas的情况下完成此操作(小图标是在窗口标题栏中显示的图标,从窗
TBaseForm = class(TForm)
private
procedure WMSetIcon(var Message: TWMSetIcon); message WM_SETICON;
...
procedure TBaseForm.WMSetIcon(var Message: TWMSetIcon);
begin
if (Message.Icon <> 0) and (BorderStyle <> bsDialog) then
begin
// this big icon is being set by the framework
if Message.BigIcon then
begin
// FBigIcon := LoadImage/LoadIcon...
// if needed set Message.Icon to return a different big icon
// Message.Icon := FBigIcon;
// in practice create a virtual method to handle this section so your child forms can override it if needed
inherited;
FSmallIcon := LoadImage/LoadIcon...
// set small icon - this will also re-trigger WMSetIcon
Perform(WM_SETICON,FSmallIcon);
end else
inherited;
end
else
inherited;
end;
这应该可以让你了解所有情况. (编辑:网站开发网_安阳站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
站长推荐

