/修改
var
Form1: TForm1;
StartButton: hWnd;
Oldbitmap: THandle;
NewImage: TPicture;
/ 将代码放入FormCreate事件
procedure TForm1.FormCreate(Sender: Tobject);
begin
NewImage := TPicture.create;
NewImage.LoadFromFile('C:windowsCircles.BMP');
StartButton := FindWindowEx
(FindWindow(
'shell_TrayWnd', nil),
0,'Button', nil);
OldBitmap := SendMessage(StartButton,
BM_SetImage, 0,
NewImage.Bitmap.Handle);
end;
/还原
procedure TForm1.FormDestroy(Sender: TObject);
begin
SendMessage(StartButton,BM_SetImage,0,OldBitmap);
NewImage.Free;
end;
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10752043/viewspace-990416/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/10752043/viewspace-990416/
本文介绍了一种使用Delphi 5.0修改Windows (适用于Win98SE) 开始按钮图标的编程方法。通过发送消息给开始按钮并利用TPicture加载自定义图片,实现了按钮图标的替换,并提供了还原功能。
3053

被折叠的 条评论
为什么被折叠?



