The Old New Thing

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

A customer (via the customer liaison) discovered that even though they had set the Start­Run­No­HOME­PATH policy, they found "if the user creates a Notepad file, the file is searched in the user's HOME directory, in contradiction of Start­Run­No­HOME­PATH policy," I asked the liaison to confirm: "The steps you...

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

When you call GetSaveFileName, 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 ...

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

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

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

Commenter Cherry wonders who invented all those strange syntaxes, like set " 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 ...

I thought you could use SWP_FRAMECHANGED to force a control to recalculate its properties after a change in styles

Simon Cooke dug back into his memory and asked, "Doesn't calling Set­Window­Pos with SWP_FRAME­CHANGED cause a recreate and re-apply of the styles?" The SWP_FRAME­CHANGED flag does not recreate anything, but it does reapply the styles, as far as it knows. Recall that the bits in the window style break into two parts. There ...
Comments are closed.0 0
Code

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

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

Le Chatelier's Principle in action: Administrative overrides

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

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

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

Raymond's house rules for Easter Egg Hunts

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

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

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

Feedback usabilla icon