Showing results for April 2014 - The Old New Thing

Apr 30, 2014
0
0

The StartRunNoHOMEPATH policy affects whether the user's HOME path is the current directory when you use Start.Run, but make sure you read that carefully

Raymond Chen
Raymond Chen

A customer (via the customer liaison) discovered that even though they had set the policy, they found "if the user creates a Notepad file, the file is searched in the user's HOME directory, in contradiction of policy," I asked the liaison to confirm: "The steps you describe are rather vague. Are you saying that the problem occurs when the user ...

Tips/Support
Apr 29, 2014
0
0

Why does the common file save dialog create a temporary file and then delete it?

Raymond Chen
Raymond Chen

When you call , the common file save dialog will ask the user to choose a file name, and just before it returns it does a little create/delete dance where it creates the file the user entered, and then deletes it. What's up with that? This is a leftover from the ancient days of 16-bit Windows 3.1, back when file systems were real file systems...

History
Apr 28, 2014
0
0

Showing a balloon tip at a specific position, then removing it

Raymond Chen
Raymond Chen

Today's Little Program shows a balloon tip at a specific position, then manually removes it. Start with our scratch program and make these changes: When our main window is created, we also create a balloon-style tooltip and add a tracking tool. Normally, the tooltip control appears and disappears automatically, at a position of the tooltip's ...

Code
Apr 25, 2014
0
0

A discovered quirk is just few steps away from becoming a feature

Raymond Chen
Raymond Chen

Commenter Cherry wonders who invented all those strange syntaxes, like to show all environment variables, including the hidden ones. An interesting historical note is the origin of the convention in unix that files whose names begin with a dot are hidden by default (here's the relevant portion). That article highlights how a discovered quirk ...

Other
Apr 23, 2014
0
0

How do I programmatically create folders like My Pictures if they were manually deleted?

Raymond Chen
Raymond Chen

A corporate customer had a problem with their employees accidentally deleting folders like Videos and Pictures and are looking for a way to restore them, short of blowing away the entire user profile and starting over. They found some techniques on the Internet but they don't always work consistently or completely. What is the recommended way of ...

Code
Apr 22, 2014
0
0

Le Chatelier's Principle in action: Administrative overrides

Raymond Chen
Raymond Chen

Today we have another example of Le Chatelier's Principle as interpreted by John Gall: Every system resists its proper functioning. There was a video card manufacturer which was using the key so that they could inject their DLL into every process. I have no idea why. Perhaps to get a nice bonus. In Windows Vista, the registry key was ...

Other
Apr 21, 2014
0
0

How can I get information about the items in the Recycle Bin from script?

Raymond Chen
Raymond Chen

Today we'll do a scripting version of an old C++ program: Printing information about the items in the Recycle Bin. (How you wish to act on the information is up to you.) This is a pattern we've seen a lot. Bind to a folder, enumerate its contents, extract properties. Wow, that was way easier than doing it in C++! Just for fun, I'll do it ...

Code
Apr 18, 2014
0
0

Raymond's house rules for Easter Egg Hunts

Raymond Chen
Raymond Chen

One of my colleagues frustrates his family by hiding the eggs for the annual Egg Hunt way too well. "Apparently, drawers and freezers are out of bounds in the traditional egg hunt." Here are my house rules for Easter Egg Hunts: Personally, I like to hide eggs in plain sight. It's surprising how long it can take somebody to find a yellow egg ...

Non-Computer
Apr 18, 2014
0
0

How do I set a breakpoint on a function whose name contains spaces or other special characters?

Raymond Chen
Raymond Chen

If you use one of the command line debuggers based on the Debugger Engine, you can set a breakpoint on a function whose name contains spaces or other special characters by quoting the symbol name. The trick here is that you do not quote the entire string; you quote only the symbol name. Note that the quotation marks do not go around the part...

Other