The challenges in changing the way Explorer hosts shell extensions
Various types of shell extensions such as thumbnail extractors are run in a separate process, and if one of those shell extensions crashes, it takes out the COM Surrogate rather than the main Explorer...
View ArticleFontography term or pretentious blather?
Fontography is like wine. The connoisseurs speak in a language that only superficially resembles English. Here's a list of words. Which of them are terms used in fontography, and which are just...
View ArticleHow can I tell whether a COM pointer to a remote object is still valid?
A customer asked the rather suspicious question, "How do I check whether a pointer is valid in another process?" This question should make your head boggle with bewilderment. First of all, we've moved...
View ArticleWhy can't I install this DLL via Regsvr32 /i?
A customer asked for help installing a particular DLL. They ran the command regsvr /i SomeDll.dll but got the error "SomeDll.dll was loaded, but the DllInstall entry point was not found. This file can...
View ArticleWhy does Internet Explorer not call DLL_PROCESS_DETACH on my DLL when I call...
A customer asked a question, but as is often the case, the question was much more telling than the answer. We have an Internet Explorer plug-in which calls ExitProcess to force Internet Explorer to...
View ArticleWhy not use animated GIFs as a lightweight alternative to AVIs in the...
Commenter Vilx- wondered why animated GIFs weren't used as the animation format for the shell animation common control. After all, "they are even more lightweight than AVIs." Animated GIFs are...
View ArticleThe Control Panel search results understand common misspellings, too
Here's a little trick. Open your Start menu and type scrensaver into the search box. That's right, spell it with only one e. Hey, it still found the Control Panel options for managing your screen...
View ArticleIt is not unreasonable to expect uninitialized garbage to change at any time,...
A customer admitted that they had a bug in their code: #define UNICODE #define _UNICODE #include <windows.h> // error checking removed for expository purposes // code that writes out the data...
View ArticleHow can I extend the deadline for responding to the PBT_APMSUSPEND message?
A customer observed that starting in Windows Vista, the deadline for responding to the PBT_APMSUSPEND message was reduced from twenty seconds to two seconds. Their program needs more than two seconds...
View ArticleHow to insert a large number of items into a treeview efficiently
Just a quick tip today. If you need to insert a large number of items into a treeview, like tens of thousands, then it's much more efficient to insert them "backwards". (I'm ignoring for now the...
View ArticleWhy is CLIPFORMAT defined to be a WORD rather than a UINT?
Commenter Ivo wants to know if the RegisterClipboardFormat function returns a UINT, why is the CLIPFORMAT data type defined to be a WORD? Since a WORD is smaller than a UINT, you have to stick in a...
View ArticleThings I've written that have amused other people, Episode 8
In a technical discussion, I opened a reply with Bob's paper which I haven't yet read points out that... Some people wrote to me to say that the've added this quote to their file in the hopes of being...
View ArticleIf you protect a write with a critical section, you may also want to protect...
It is common to have a critical section which protects against concurrent writes to a variable or collection of variables. But if you protect a write with a critical section, you may also want to...
View ArticleOur code needs to run on multiple platforms with different rules, so we...
A customer was encountering sporadic crashes in their 64-bit application, and upon investigation, the problem was traced to a misaligned RSP register. We saw some time ago that the Windows x64 calling...
View ArticleDon't let more than one process try to read from stdin at the same time
A customer reported a problem with a program that ran a series of other programs in parallel. We have a main program (call it main.exe) that runs a bunch of child processes with stdout and stderr...
View ArticleWhy does my program still show up in the Programs and Features folder after...
A customer reported that they were having problems with their program entry in the Programs and Features folder (formerly known as Add and Remove Programs, formerly known as Add/Remove Programs). When...
View ArticleA feature I didn't even know existed much less had a name: Color hot-track
I hadn't even noticed this until somebody pointed it out: When you hover your mouse over a button in the Windows 7 taskbar which corresponds to a running application, the taskbar button lights up in a...
View ArticleGetParent, just as confusing as EnumClaw, but it's an actual function!
The function EnumClaw, documented as returning "the child or the parent of the window", was a joke, but there's a function whose behavior is just as confusing as the joke function EnumClaw:...
View ArticleWhat does it mean when my program exits with the message "This application...
You're running your program, and then it suddenly exits with the message This application has requested the Runtime to terminate it in an unusual way. What happened? That message is printed by the C...
View ArticleSure, I'm supposed to pass WT_EXECUTELONGFUNCTION if my function takes a long...
A customer contacted me to tell a story and ask a question. The customer discovered that in their code base, all calls to QueueUserWorkItem passed the WT_EXECUTELONGFUNCTION flag, regardless of...
View Article