How would a guy at Microsoft...

  • Thread starter Thread starter nano2k
  • Start date Start date
N

nano2k

....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.
 
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).
 
Back
Top