Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / October 2007

Tip: Looking for answers? Try searching our database.

How would a guy at Microsoft...

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
nano2k - 09 Oct 2007 14:19 GMT
...open Windows's Calc?
I want to integrate a shortcut to Windows Calc in my application.
Ok, it seems quite str8 forward:
1. put a button / link label, whatever on a form
2. grab Calc's icon from system32\calc.exe and attach it to the
button, etc, if needed.
3. Call Process.Start("calc.exe") when the button is clicked.

Anyway, I wonder how a guy at MS would:
1. Get Calc's icon. That is, is there another way of "stealing" the
icon?
2. Start Calc.
Peter Bromberg [C# MVP] - 09 Oct 2007 15:09 GMT
Well! I'm not a "guy at Microsoft", but:

1) If you absolutely *must* have the actual icon from Calc.exe, there are a
number of freeware programs that will extract icons for you. Or, just find an
icon you like and use that (much easier).
2) Is correct.
-- Peter
Recursion: see Recursion
site:  http://www.eggheadcafe.com
unBlog:  http://petesbloggerama.blogspot.com
BlogMetaFinder:    http://www.blogmetafinder.com

> ....open Windows's Calc?
> I want to integrate a shortcut to Windows Calc in my application.
[quoted text clipped - 8 lines]
> icon?
> 2. Start Calc.
Nicholas Paldino [.NET/C# MVP] - 09 Oct 2007 15:15 GMT
In order to get the icon of any file, you should call the SHGetFileInfo
API function through the P/Invoke layer.  It is the only function that will
take into account things like shell namespace handlers, registry entries,
and the like to give you the proper icon for any file (or any ^type^ of
file, for that matter).

Signature

         - Nicholas Paldino [.NET/C# MVP]
         - mvp@spam.guard.caspershouse.com

> ...open Windows's Calc?
> I want to integrate a shortcut to Windows Calc in my application.
[quoted text clipped - 8 lines]
> icon?
> 2. Start Calc.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.