Caching StockIcons for Windows Presentation Framework…

Here is what I’ve added to the code to handle the BitmapSource cache and hopefully (yes, I have sined by not measuring anything, before or after) improve performance: using BitmapSourceDictionary = System.Collections.Generic.Dictionary<int, System.Windows.Media.Imaging.BitmapSource>;   namespace VistaBridge.UI {    public class StockIcon : MarkupExtension { …       static BitmapSourceDictionary _cache;         static StockIcon() {          _cache…

0

Building the Windows SDK samples on Vista…

Well, because of UAC, one needs to change the folders and files’ ACLs under “%ProgramFiles%\Microsoft SDKs\Windows\v6.0\Samples” in order to be able to create files (e.g. executables, object files, …). So this time I decided I would give ICACLS a try and it worked beautifully. Under the parent folder, I ran: C:\Program Files\Microsoft SDKs\Windows\v6.0>icacls samples /T…

0

StockIcons for Windows Forms?

This is what I had written to better understand the API, in C++/CLI and for Windows Forms. One could use it like this: System::Void Form1_Load(System::Object^  sender, System::EventArgs^  e) {    Drawing::Icon ^ ic = StockIcons::GetIcon(StockIconIdentifier::Shield, StockIconFlag::ShellSize);    button->ImageList =  gcnew ImageList();    button->ImageList->Images->Add(ic);    button->ImageIndex = 0; }   If you would rather have this…

0

StockIcons for Windows Presentation Framework?

Windows Vista introduces a new native API that allows you to retrieve system-defined Shell icons: SHGetStockIconInfo. Those icons are stored in %SystemRoot%\System32\ImageRes.dll. To understand that API documentation, I read About Icons again: last time was 15+ years ago (thank you Charles Petzold). Now, armed with that knowledge and the help of numerous knowledgeable people, I worked…

1