C# IShellLink COM Interop Example #1

I recently needed to use C# to programmatically create a shortcut (.LNK file) to a console executable. This is easily done in native C/C++ using the ShellLink CoClass, the IShellLink interface and their related interfaces. I looked around and couldn’t find a good C# COM interop example for the related native COM interfaces so I…


WPF: Styling the Expander Control

I recently needed to style a WPF expander control for a prototype project. Our team’s UX designer came up with a nice visual design.    So, I began to build my prototype and match his visual style (mocked up in Visio) in WPF.   I thought it would be easy…   it was, once I spent all morning …


BizzySpinner 2 – A WPF Spinning Busy State Indicator (with source)

I’ve made a key improvement to my BizzySpinner control form my last post.  It now starts and stop smoothly instead of abruptly.  This is quite visually attractive.  But it was somewhat non-trivial to do.   In my first example, I had a single simple animation that was either running or stopped.  The animation behavior is now…


BizzySpinner – A WPF Spinning Busy Sate Indicator (with source)

I’ve been working on a pet project that does a lot of network I/O and database queries.   One of the things I need to do is run long running things in the background – off the UI thread and keep the UI responsive.  So, I’ve built a spinning busy state indicator.  I’ve included the source…


Stack Walking in Xperf

Bruce Dawson is a performance analyst on the client performance team.  He has written this guest post on enabling stack walking using xperf for both 32-bit and 64-bit Windows systems (Vista and Win7).  For more posts on xperf see this page. Introduction When I first started working with xperf I was confused by the many…


StackOverflow answer – why learn multi-core programming? #2

In my last post I talked about how multi-threading can be used to improve responsiveness while loading a file.    I’ve put together a sample program (source included) that shows how to do this in C# 3.0, .NET 3.5, and WPF using Visual Studio 2008.  You can find a zip file with a complete project attached….


StackOverflow answer – why learn multi-core programming?

I must admit, I’m addicted to Stackoverflow.  Its a great site, being both interesting and easy to use. Recently, I ran across this question “Are you concerned about multicore”.   HenryR, a PhD candidate at Cambridge is asking if the “developer on the street” needs to concern him/herself with multi-core development  practices.   Henry’s question has a…


So just what is in a trace? Using the xperf trace dumper

There is a lot of information in a typical kernel trace.  While the Performance Analyzer tool is quite powerful and makes it easy to view a trace graphically, sometimes you just need to see what is in the trace directly.  Xperf makes this easy. First, its important to understand that a trace file (.ETL) is…


XPerf Articles

Here is a chronological list of the my posts about the xperf tools.  If you are new to the tools, or simply want to find a specific article, this is a good place to start.  I’ve listed each article’s title and first paragraph.   The title is the link to the post.  Xperf, a new tool…


Using the Windows Sample Profiler with Xperf

Using the xperf tools, ETW, and the kernel sample profile interrupt all together provides a very effective and easy to use sample profiler for the analysis of both application and system wide performance.  At each sample interrupt, the ETW sub-system captures the instruction pointer and the stack.  This data is lazily and efficiently logged to…