Welcome to MSDN Blogs Sign in | Join | Help

Browse by Tags

All Tags » Nifty Win32 tricks.   (RSS)
About a year or so ago, I wrote a post that talked about the Windows shutdown experience.   A couple of the people reading the post asked for more details, and it turns out that the performance folks have just issued this paper which describes (in Read More...
I just fixed a bug in our UI that was caused by a misunderstanding of the API contract for the NM_CUSTOMDRAW handler for some of the common controls. On of October 3rd, 2008 The common control documentation for the NM_CUSTOMDRAW message says: lpNMCustomDraw Read More...
I just noticed this while working on a bug fix. We have some code that attempts to determine the size of a piece of text by calling DrawThemeText with the DT_CALCRECT format value. According to this page (as of 9/30/2008) the DT_CALCRECT option determines Read More...
Because the alternative is often much worse.   Several months ago, I got a bug report that if you launched mmsys.cpl then set the “Select” sound to a value, then cleared the sound, the reporters application would ding whenever you moved around their Read More...
Someone just wandered over to my office and he had noticed the following pattern in his code: PlaySound(NULL, NULL, SND_NODEFAULT); PlaySound( ".Default" , NULL, SND_SYSTEM | SND_ASYNC | SND_NODEFAULT); He was wondering why on earth the code Read More...
I just spent a half an hour debugging a heisenbug and thought I’d pass on what was happening.   I was running my unit tests for one of my features and they were reliably failing.  Unfortunately the instant I ran the test case under the debugger, Read More...
Yesterday I mentioned WM_PRINTCLIENT and how awesome it is when trying to strictly control the drawing of your application. Part of the reason it took over a week to change the drawing model is that there are a number of serious gotcha’s associated with Read More...
As I’ve mentioned before, I’ve been fuddling around doing UI programming recently – it’s a bit different from my usual work deep in the bowels of the <insert whatever subsystem Larry happens to be working on (redirector, audio stack, POP3 server, whatever)>. Read More...
I didn’t find this in the documentation for the static standard window so I figured I’d put it out in my blog in the hopes that someone else won’t get stuck on this problem. The Windows “static” control has a number of styles that control how the control Read More...
The other day, I wrote about measuring the dimensions of a piece of text using the DrawText API . My code worked just great when I initially tested it (obviously it’s a part of a larger chunk of code that does more complicated work).  The problem Read More...
Recently I’ve been working on something that I’ve never done before in my almost 24 years at Microsoft.    For the past 23ish years, I’ve been a plumber – all the work I’ve done has been under the covers.  But for the next version of Windows, Read More...
A co-worker came by to ask what he thought was a coding "style" question that turned into a correctness issue, and I thought I'd share it. Someone had defined two COM interfaces: interface IFoo : IUnknown { HRESULT FooMethod1(); HRESULT FooMethod2(); Read More...
After I posted my article on the SHAutoComplete , I mentioned it to one of my co-workers. His response "I'm not surprised - The shell gets all the cool APIs". And they do. For instance, my "new favorite" Win32 API : RegGetValue began it's life as the Read More...
For whatever reason, most of the toy applications I tend to write seem to end up being dialog based applications. I'm not 100% sure why, it probably has to do with the fact that the dialog box editor makes it really easy to drop controls on a page. One Read More...
We recently got an internal report from someone using the internal audio notification APIs that they were leaking memory and they wanted to help from us debugging the problem. I took a look and discovered that the problem was a circular reference that Read More...
More Posts Next page »
 
Page view tracker