不知你所说WINDOWS系统图标指什么?但在WINDOWS中,很多应用程序的图标都是从MORICONS.DLL中取出的,它存放在WINDOWS目录中。可用LOADLIBRARY把这个DLL装入,然后用FINDRESOURCE和LOADRESOURCE,LOCKRESOURCE这些API把资源装入。其它的WINDOWS图标也可用此方法装入,然后利用其资源图标。观察EXE和DLL中图标可用RESOURCE WORKSHOP 或VC中的资源编辑器来完成。
调试欢乐多
IDI_ASTERISK Same as IDI_INFORMATION.
IDI_ERROR Hand-shaped icon.
IDI_EXCLAMATION Same as IDI_WARNING.
IDI_HAND Same as IDI_ERROR.
IDI_INFORMATION Asterisk icon.
IDI_QUESTION Question icon.
IDI_WARNING Exclamation point icon.
IDI_WINLOGO Windows logo icon. LoadIcon(NULL,IDI_XXX);(C++)
loadicon(nil,IDI_XXX);(pascal)
w95filelist可以在深度历险的范例中找到。procedure Createimages; // Sets the system's imagelists for the listview
var
SysIL: uint;
SFI: TSHFileInfo;
begin
{ Credits to Brad Stowers [email protected] or 72733,3374 on CompuServe.}
{ I ripped most of the shell-stuff of this app from his components. But because I'm quite
worry about the C-design of shellapi and shlobj, i use only the shell-routines i really
need for this program. Maybe a few other Delphi-programmers have also trouble with ^TIID...}
{ Create the image list. We don't really "create" one. We fool SHGetFileInfo into
giving us the system's image list and use it's handle. You'd think it would be
easier to get the handle of the system image list.... } Larges := TImageList.Create(form1);
SysIL := SHGetFileInfo('', 0, SFI, SizeOf(SFI), SHGFI_SYSICONINDEX or SHGFI_LARGEICON);
if SysIL <> 0 then begin
Larges.Handle := SysIL;
Larges.ShareImages := TRUE; // DON'T FREE THE SYSTEM IMAGE LIST!!!!! BAD IDEA (tm)!
end;
Smalls := TImageList.Create(form1);
SysIL := SHGetFileInfo('', 0, SFI, SizeOf(SFI), SHGFI_SYSICONINDEX or SHGFI_SMALLICON);
if SysIL <> 0 then begin
Smalls.Handle := SysIL;
Smalls.ShareImages := TRUE; // DON'T FREE THE SYSTEM IMAGE LIST!!!!! BAD IDEA (tm)!
end; { Setting the imagelists for the ListView} form1.files.smallimages := smalls;
form1.files.largeimages := larges;end; // End createimages