How can I tell whether a window is modal?
A customer wanted a way to determine whether a particular window is modal. They listed a few methods they had tried but found that it didn't work and asked for assistance. As Eric Lippert is fond of...
View ArticleWhat is the API for accessing content on SkyDrive?
The last time I mentioned programmatic access to SkyDrive was last June, where I noted that the interface was given the confusing name Messenger Connect. At least now they renamed it to Live Connect,...
View ArticleOnline gift ordering + enthusiastic kids at the keyboard + Unicode, wait......
I was completing an online gift order for my young nephew's birthday, and I was in the middle of typing Happy birthday into the gift card message when an enthusiastic child reached for the keyboard...
View ArticleThe peculiar cadence of executive mail messages
When there's a piece of mail sent from a senior executive to the entire product team, it tends to follow a set pattern. It starts out with a history of Group X and commends them on what a great job...
View ArticleNot even making it to the airtight hatchway: Execution even before you get there
Today's dubious security vulnerability comes from somebody who reported that the LoadKeyboardLayout function had a security vulnerability which could lead to arbitrary code execution. This is a...
View ArticleProgrammatically controlling which handles are inherited by new processes in...
In unix, file descriptors are inherited by child processes by default. This wasn't so much an active decision as it was a consequence of the fork/exec model. To exclude a file descriptor from being...
View ArticlePaint messages will come in as fast as you let them
There is a class of messages which are generated on demand rather than explicitly posted into a message queue. If you call GetMessage or PeekMessage and the queue is empty, then the window manager...
View ArticleMicrospeak: Offline (noun)
Sure, any noun can be verbed, and any verb can be nouned. But today, we're going to noun an adjective. I have no written citations of this usage; the only report was via a colleague who overheard it...
View ArticleDeftly solving compatibility problems by withholding information
One of the continuing compatibility problems that plagued Direct3D was the way it reported texture formats. Historically, the way an application checked which texture formats were available was by...
View ArticleHow do I determine programmatically whether a particular language is LTR or RTL?
Given an LCID, how does one determine whether the language lays out left-to-right or right-to-left? One suggestion was simply to hard-code the list of known right-to-left languages, and if the...
View ArticleHow do I get the full path for the target of a shortcut file?
A customer was having trouble obtaining information from a shortcut file. "Here is a sample program that tries to print the target of a shortcut file, but it only gets the file name without a...
View ArticleWhy is the file size reported incorrectly for files that are still being...
The shell team often gets questions like these from customers: Attached please find a sample program which continuously writes data to a file. If you open the folder containing the file in Explorer,...
View ArticleCelebrating the end of the gluttony season, but the effects linger
The Washington State Ferry system has reduced the rated carrying capacity of its fleet because people have gotten fatter: The average weight of an adult passenger has been officially revised from 160...
View ArticleIntroducing the for-if anti-pattern
Over the years, I've seen a bunch of coding anti-patterns. I figured maybe I'll share a few. Today, I'll introduce what I'm calling the for-if anti-pattern, also known as "We'll sell you the whole...
View ArticleUsing the MNS_DRAGDROP style: Dragging out
Windows 2000 introduced the MNS_DRAGDROP menu style, which permits drag/drop operations in a menu. Nobody uses this style, probably because it's totally undiscoverable by the end-user. But I'll write...
View ArticleUsing the MNS_DRAGDROP style: Dropping in
Last time, we looked at using the MNS_DRAGDROP style for dragging items out of a menu. Today, we'll look at dropping them in. Take the program from last time and make the following additions. First,...
View ArticleUsing the MNS_DRAGDROP style: Menu rearrangement
In order to do drag-drop rearrangement of menus, you need four things, most of which we already know how to do. Dragging an item out of a menu. Check. Dropping an item into a menu. Check. Connecting...
View Article2011 year-end link clearance
Another round of the semi-annual link clearance. Slate's Negotiation Academy is a ten-episode podcast which teaches a few simple rules for improving your negotiation and haggling skills. Each episode...
View ArticleWhy wasn't the Windows 95 shell prototyped on Windows NT?
Carlos wonders why the Windows 95 shell was prototyped as 16-bit code running on the still-under-development 32-bit kernel, USER, and GDI as opposed to being prototyped as fully 32-bit code on Windows...
View ArticleExploiting the inattentive: The Xbox Kinect Premium Starter Kit
The name of the product is the Xbox Kinect™ Premium Starter Kit. The promotional images and box images show an Xbox Kinect device. But if you look closely, you'll see that the Xbox Kinect™ Premium...
View Article