The Old New Thing

The UseUrl attribute in the App Paths key indicates that your application can accept a URL on the command line

Setting the attribute in your 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 confusing blend of raw documentation, guidance, history, and an example. Let's tease the parts apart so you won't confuse the example with the contract. The raw ...
Comments are closed.0 0
Code

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

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-...
Comments are closed.0 0
Code

A 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 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 ...

How 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 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 ...
Comments are closed.0 0
Code

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

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

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 ...
Comments are closed.0 0
Code

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 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 ...

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

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...

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

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 ...