If my window hosts multiple windowless ActiveX controls, which one do I call...
Commenter Farproc asks how one goes about hosting two windowless ActiveX controls in a single window. In particular, "none of the documentation explains how to choose which control to send...
View ArticleHazards of spelling autocorrection: defiance
On an internal mailing list, a colleague asked for some recommendations on a webcam. I was wondering if there are any models I should avoid or defiantly get. I got this mental image of my colleague...
View ArticleWhat does a STATUS_OBJECT_TYPE_MISMATCH exception in LeaveCriticalSection mean?
It means the same thing as a STATUS_INVALID_HANDLE exception.
View ArticleWhat happens if I call KillTimer with a NULL hwnd?
A customer discovered a bug in their code and wanted some information on how serious it was, so they could assess how urgently they need to issue a fix. We have code that calls SetTimer with a valid...
View ArticleHow do I prefetch data into my memory-mapped file?
A customer created a memory mapping on a large file and found that when the memory manager wanted to page in data from that file, it did so in 32KB chunks. The customer wanted to know if there was a...
View ArticleThe time I watched a total lunar eclipse from the top of a mountain
One of my colleagues loves doing outdoorsy things, and he also loves space and astronomy. Many years ago, he invited a small number of us on an outing that combined both of his interests: A hike up a...
View ArticleWhy does PrintWindow hate CS_PARENTDC? Because EVERYBODY hates CS_PARENTDC!
Commenter kero wants to know why the PrintWindow function hates CS_PARENTDC. (And CS_CLASSDC, and CS_OWNDC.) Because everybody hates CS_PARENTDC! (And CS_CLASSDC, and CS_OWNDC.) We saw earlier...
View ArticleMicrospeak: Turds
In Microspeak, a turd is a graphics glitch which results in old pixels appearing on the screen when they shouldn't. Perhaps they are not being erased properly, or instead of being erased, they move to...
View ArticleDon't be helpless: What might be the reason for a "Path not found" error?
Internally at Microsoft, we have a programmer's tool which I will call Program Q. On the peer-to-peer mailing list for Program Q, somebody asked the following question: When I try to do a q edit...
View ArticleEventually the window manager simply says that enough is enough
Many window manager operations are recursive, and eventually the window manager will simply say that enough is enough when the recursion goes too deep. We've seen this when you nest windows more than...
View ArticleHow can I determine the underlying cause of a EXCEPTION_IN_PAGE_ERROR exception?
A customer was using memory-mapped files and installed an exception handler to log in-page errors in the memory-mapped file region. They wanted to know how they could obtain the real disk error that...
View ArticleWhy do you have to wait for Windows Error Reporting to check for solutions...
Leo Davidson wonders why you have to wait for Windows Error Reporting to check for solutions before it restarts the application. Why not do the two in parallel? Well, for one thing, when the...
View ArticleFabio coming to Redmond. Also: Whey Protein
Mark your calendars: Fabio Lanzoni, better known to the world as simply Fabio, will be at the Redmond Whole Foods Market on June 21 to promote his whey protein product. (Now made with real Fabio!) And...
View ArticleMicrosoft Dynamics in a soda can, sort of
It is not uncommon for a product team to produce some custom soda cans (really, carbonated water) for distribution at Microsoft cafeterias. Last year, the Microsoft Dynamics™ CRM 2011 team put some...
View ArticleWhy don't all of my folder customizations roam with my profile?
A customer reported some inconsistency in how folder customizations are handled by roaming profiles. Log onto Server1 with a roaming profile. Open the following folders and in each one, customize the...
View ArticleNow that Windows makes it harder for your program to block shutdown, how do...
Up until Windows XP, applications could intercept the WM_QUERYENDSESSION message and tell Windows, "No, don't shut down." If they were polite about it, they would also inform the user which...
View ArticleGlobalization quiz: In honor of, well, that's part of the quiz
The Corporate Citizenship Tools; Microsoft Local Language Program Web site contains a map of the world, coded by region. There was a bug on the map. See if you can spot it: Asia Europe Middle...
View ArticleWhat is the history of the GetRandomRgn function?
An anonymous commenter was curious about how the GetRandomRgn function arrived at its strange name, what the purpose of the third parameter is, and why it is inconsistent between Windows 95 and...
View ArticleIt's not a good idea to give multiple controls on a dialog box the same ID
When you build a dialog, either from a template or by explicitly calling CreateWindow, one of the pieces of information about each control is a child window identifier. And it's probably in your best...
View ArticleWhen embedding a dialog inside another, make sure you don't accidentally...
The WS_EX_CONTROLPARENT extended style (known in dialog templates as DS_CONTROL) instructs the dialog manager that the dialog's children should be promoted into the dialog's parent. This is easier to...
View Article