The Old New Thing

It'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 Create­Window, one of the pieces of information about each control is a child window identifier. And it's probably in your best interest to make sure two controls on the dialog don't have the same ID number. Of course, one consequence of giving two control the same ...
Comments are closed.0Code

What is the history of the GetRandomRgn function?

An anonymous commenter was curious about how the Get­Random­Rgn function arrived at its strange name, what the purpose of the third parameter is, and why it is inconsistent between Windows 95 and Windows NT. The sense of word "random" here is hacker slang rather than its formal probabilistic definition, specifically sense&...

Globalization 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: After I pointed out the error, they fixed the map on their Web page, so no fair clicking through to the Local Language Program Web page and comparing the pictures! ...
Comments are closed.0Other

Now that Windows makes it harder for your program to block shutdown, how do you block shutdown?

Up until Windows XP, applications could intercept the WM_QUERY­END­SESSION message and tell Windows, "No, don't shut down." If they were polite about it, they would also inform the user which application blocked system shutdown and why. And if they were really polite about it, they would even provide a way for the user to say, "I ...
Comments are closed.0Code

Why 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. Why doesn't the C:\Temp customization roam? Well, if you think about it, it makes sense that the setting for C:\Temp doesn't roam because C:\Temp doesn't roam either! The C:\Temp on Server1 is not the same directory as the C:\Temp on ...

Microsoft 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 custom cans of sparkling water in the coolers extoling the virtues of their new product. It took the form of a side-by-side feature ...

Fabio 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 unlike Martha, he will let you take a picture of him. By the way, ladies, he's available...

Why do you have to wait for Windows Error Reporting to check for solutions before it restarts the application?

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 application restarts, it might freak out if it sees a dead copy of itself. I know for sure that I would freak out if I woke up one morning and saw my ...
Comments are closed.0Other

How 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 resulted in the memory manager not being able to page-in the requested data. Finding the answer isn't that hard. A quick search for ...
Comments are closed.0Code

Eventually 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 50 levels deep or nest menus more than 25 levels deep, for example. (Note also that these limits may change in the future, so don't rely on ...
Comments are closed.0Code