|
-
Jul 3rd, 2008, 08:54 AM
#1
Thread Starter
Lively Member
[2.0] Reading Icons within C#
How could I read the application icon and extract it from another application to use it as icon or any other image format or drawing it in a picture box within the calling application. If there could I read a specific size for the icon or read all and use one size into another tool. I mean could I read all the sizes of the icon and can I use them separately in my application?
-
Jul 4th, 2008, 01:36 AM
#2
Hyperactive Member
Re: [2.0] Reading Icons within C#
Why would you need to read the icon from another application?
-
Jul 4th, 2008, 07:36 AM
#3
Thread Starter
Lively Member
Re: [2.0] Reading Icons within C#
I'd like to make an application to run another applications by callig them with shell and I want to make it dynamic to have the shortcuts for the other applications with thier icons to be clearly to the users, so the number and the application itself I don't know and they can modify at any time so I need to read the applications icons to show to the user to select from.
-
Jul 7th, 2008, 02:56 PM
#4
Re: [2.0] Reading Icons within C#
If you just want to get the icon, you can use the ExtractAssociatedIcon method:
Code:
System.Drawing.Icon oIcon = System.Drawing.Icon.ExtractAssociatedIcon(@"C:\Program files\Microsoft Office\Office12\winword.exe");
button1.Image = oIcon.ToBitmap();
oIcon = System.Drawing.Icon.ExtractAssociatedIcon(@"C:\Windows\system32\calc.exe");
button2.Image = oIcon.ToBitmap();
-
Jul 9th, 2008, 10:25 AM
#5
Thread Starter
Lively Member
Re: [2.0] Reading Icons within C#
Thanks Negative it works but is there any other way to read a specific size for the Icon like 16X16, 23X23... etc. I tried your sample and it reads the size 32X32 only.
-
Jul 9th, 2008, 12:19 PM
#6
Re: [2.0] Reading Icons within C#
You could try this code from the Codebank, I haven't looked at it, but it appears to use the API:
http://www.vbforums.com/showthread.php?t=330985
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|