What happens when applications try to copy text by sending Ctrl+C
I'm stealing this story from one of my colleagues. I remember one app from a long time ago that had a feature where you could hit a global short cut key (or something like that) to launch the...
View ArticleWhy doesn't my MessageBox wrap at the right location?
A customer reported that the MessageBox function was wrapping text "at the wrong location." Our program displays a message with the MessageBox function, and we use the '\n' character to force line...
View ArticleThere's more to workflow than hitting F5 in the IDE
Commenter Stu suggested that instead of having code to auto-correct dialog templates, why not have a program that corrects them at build time? That way, Windows wouldn't have to make all these...
View ArticleHow do I display the Find Printers dialog programmatically?
A customer wanted to display the Find Printers dialog programmatically to let the user pick a printer from Active Directory and wanted to know whether this was possible. Yes, it's possible, and...
View ArticleA different way to win from one of those claw game
I know two people (siblings) who are experts at those claw games. They can look at a claw game, assess the situation, decide whether there is a winnable toy, and if so, drop in their quarter and grab...
View ArticleWhat happens to WPARAM, LPARAM, and LRESULT when they travel between 32-bit...
The integral types WPARAM, LPARAM, and LRESULT are 32 bits wide on 32-bit systems and 64 bits wide on 64-bit systems. What happens when a 32-bit process sends a message to a 64-bit window or vice...
View ArticleThe UseUrl attribute in the App Paths key indicates that your application can...
Setting the UseUrl attribute in your App Paths key indicates that your application can accept a URL on the command line as the document to be opened. The documentation for this attribute is a...
View Article2011 mid-year link clearance
Another round of the semi-annual link clearance. James Michael Hare has a very well-written blog on programming in C#/.NET, with tips, tricks, and discussion. News flash: People at sporting events...
View ArticleThe list of heaps returned by GetProcessHeaps is valid when it returns, but...
A customer had a problem involving heap corruption. In our code, we call GetProcessHeaps and then for each heap, we call HeapSetInformation to enable the low fragmentation heap. However, the...
View ArticleA handful of trips through the time machine
A few trips through the time machine: 24 years of Windows package design. Boot screens through the ages Microsoft producivity applications through the decades. (Warning: Marketing video.) Many of the...
View ArticleThe historical struggle over control of the Portuguese language
Portugal has been going through a rough patch. Its international stature has diminished over the years, its economy has always struggled to remain competitive, the government had to accept a bailout...
View ArticleBe careful when redirecting both a process's stdin and stdout to pipes, for...
A common problem when people create a process and redirect both stdin and stdout to pipes is that they fail to keep the pipes flowing. Once a pipe clogs, the disturbance propagates backward until...
View ArticleAnd... that cadence means it's halftime, concert-goers!
In college, one of my classmates (who is now the conductor of an orchestra, so I guess that whole music thing worked out for him) coined the term halftime to refer to a resounding cadence in the first...
View ArticleWe've traced the pipe, and it's coming from inside the process!
We saw last time one of the deadlocks you can run into when playing with pipes. Today we'll look at another one: Our program runs a helper process with stdin/stdout/stderr redirected. The helper...
View ArticleWindows has supported multiple UI languages for over a decade, but nobody...
In the early days of Windows, there was a separate version of Windows for each language, and once you decided to install, say, the French version of Windows, you were locked into using French. You...
View ArticleAt least it'll be easy to write up the security violation report
Many years ago, Microsoft instituted a new security policy at the main campus: all employees must visibly wear their identification badge, even when working in their office. As is customary with with...
View ArticleWhat does the executable timestamp really mean?
A customer was looking for some information on the executable timestamp: I would like my program to display the date it was linked. The IMAGE_FILE_HEADER.TimeDateStamp looks like what I need. Is...
View ArticleThe tradition of giving cute names to unborn babies
Many of my friends gave names to their unborn babies. Most of them were based on various objects that were the size of the adorable little parasite¹ at the time they discovered that they were...
View ArticleWhat is that horrible grinding noise coming from my floppy disk drive?
Wait, what's a floppy disk drive? For those youngsters out there, floppy disks are where we stored data before the invention of the USB earring. A single floppy disk could hold up to two seconds of...
View ArticlePhotoshop meme: Mark Reynolds casually eating sunflower seeds
July 7, 2011: David Ortiz hits a home run against the Baltimore Orioles. As he rounds third base, Orioles third baseman Mark Reynolds casually finishes off a package of sunflower seeds (photo 6 in the...
View Article