Showing results for June 2011 - The Old New Thing

Jun 30, 2011
0
0

2011 mid-year link clearance

Raymond Chen
Raymond Chen

Another round of the semi-annual link clearance. And, as always, the obligatory plug for my column in TechNet Magazine:

Other
Jun 29, 2011
0
0

What happens to WPARAM, LPARAM, and LRESULT when they travel between 32-bit and 64-bit windows?

Raymond Chen
Raymond Chen

The integral types , , and 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 versa? There's really only one choice when converting a 64-bit value to a 32-bit value: Truncation. When a 64-bit process sends a message to a 32-bit window, the 64-bit ...

Code
Jun 28, 2011
0
0

A different way to win from one of those claw game

Raymond Chen
Raymond Chen

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 it. I asked the elder sibling how they arrived at this amazing skill. "As a teenager, I spent something like $20 pumping quarters into one of these m...

Non-Computer
Jun 28, 2011
0
0

How do I display the Find Printers dialog programmatically?

Raymond Chen
Raymond Chen

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 there's more than one way to do it. There's the lazy way and the overachieving way. The overachieving way is to use the method. The sample function spe...

Code
Jun 27, 2011
0
0

There's more to workflow than hitting F5 in the IDE

Raymond Chen
Raymond Chen

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 accommodations for programs that didn't understand the new dialog template requirements for property sheet pages. For one thing, this model assumes that al...

Other
Jun 24, 2011
0
0

Why doesn't my MessageBox wrap at the right location?

Raymond Chen
Raymond Chen

A customer reported that the function was wrapping text "at the wrong location." Our program displays a message with the function, and we use the '\n' character to force line breaks at positions we choose. But we've found that starting in Windows Vista, the line breaks we placed are not working. The function is inserting its own line break...

Code
Jun 23, 2011
0
0

What happens when applications try to copy text by sending Ctrl+C

Raymond Chen
Raymond Chen

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 dictionary. It was also smart in that it would detect the current selected text and immediately search the dictionary for that term. One day I was running...

Other
Jun 22, 2011
0
0

How do I compress files (via NTFS compression) from the command line?

Raymond Chen
Raymond Chen

A customer wanted to know whether there was a way to compress files and directories (in the sense of NTFS compression) from a script or from the command line. They knew about the Properties dialog, but they wanted something scriptable. The command-line tool for this is . Type for usage information. The customer liaison was grateful for this info...

Tips/Support
Jun 21, 2011
0
0

How to get Windows Media Player to single-step a video

Raymond Chen
Raymond Chen

I always forget how to do this, so I'm going to write it down so I can look it up later. When a video is playing, right-click the volume control slider and select Enhancements, then Play speed settings. (Actually, it also works if you right-click the speaker icon, the Stop button, the Replay button, or the Shuffle button, but the volume control sl...

Tips/Support