Windows 7 Like circular loader?
i was just wondering if anyone has made anything for C# similarly looking to the circular loading thing used almost everywhere in Windows 7 and Vista.
circular loading thing http://img600.imageshack.us/img600/3127/a7ff394fb1d04795b9a2a21.png
Edit:
Ive noticed alot of comments about cursors but that is not related at all to what im trying to do. I am trying to create a loading circle, drawn to my window as a custom control (or something like that.)
What Ive tried so far:
Ive attempted to extract the loading images from the following dll %SystemRoot%\System32\imageres.dll
with no success, using the link provided by Mark Pim (this one)
i tried it, and was able to successfully extract A image from the dll, but i can not determine how to extract the specific image that i need. being the circle animation listed in the dll as Bitmap/5004
.
here is some code ive tried
public struct SHFILEINFO
{
public IntPtr hIcon;
public in开发者_运维知识库t iIcon;
public uint dwAttributes;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
public string szDisplayName;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 80)]
public string szTypeName;
};
[DllImport("Shell32.dll")]
public static extern IntPtr SHGetFileInfo(string pszPath, uint dwFileAttributes, ref SHFILEINFO psfi, int cbFileInfo, uint uFlags);
public Image GetImage()
{
IntPtr hImgLarge;
SHFILEINFO shinfo = new SHFILEINFO() { };
string FileName = @"C:\Windows\System32\imageres.dll";
System.Drawing.Icon myIcon;
hImgLarge = SHGetFileInfo(FileName, 0, ref shinfo, Marshal.SizeOf(shinfo), 0x100);
myIcon = System.Drawing.Icon.FromHandle(shinfo.hIcon);
return myIcon.ToBitmap();
}
im not sure how to manipulate the SHGetFileInfo to return the correct image. any ideas?
It looks like the images are available in %SystemRoot%\System32\imageres.dll
I used this application to browse that DLL, and manually verify that I saw the spinner animations:
http://www.wilsonc.demon.co.uk/d10resourceeditor.htm
See this question on how to insert these into your winforms application:
How can I access to system icons like "folder", "file" etc.?
精彩评论