Quantcast
Channel: The Old New Thing
Browsing all 3085 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

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

View Article


Image may be NSFW.
Clik here to view.

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

View Article


Image may be NSFW.
Clik here to view.

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

View Article

Image may be NSFW.
Clik here to view.

How do I programmatically create folders like My Pictures if they were...

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

View Article

Image may be NSFW.
Clik here to view.

I thought you could use SWP_FRAMECHANGED to force a control to recalculate...

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

View Article


Image may be NSFW.
Clik here to view.

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

View Article

Image may be NSFW.
Clik here to view.

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: #pragma comment(linker, \...

View Article

Image may be NSFW.
Clik here to view.

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

View Article


Image may be NSFW.
Clik here to view.

The StartRunNoHOMEPATH policy affects whether the user's HOME path is the...

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

View Article


Image may be NSFW.
Clik here to view.

How do I extract an icon at a nonstandard size if IExtractIcon::Extract tells...

Commenter Ivo notes that if you ask IExtract­Icon::Extract to extract an icon at a particular size, the function can return S_FALSE which means "Go jump in a lake do it yourself." But how can you do...

View Article

Image may be NSFW.
Clik here to view.

If a lot of settings are ignored when set in a DLL, why bother even letting...

There are many settings that are ignored when set in a DLL. /LARGE­ADDRESS­AWARE. Size­Of­Stack­Reserve and Size­Of­Stack­Commit. There are plenty of others. Commenter 640k asks why these settings...

View Article

Image may be NSFW.
Clik here to view.

Getting the location of the Close button in the title bar

Today's Little Program locates the × button in the corner of the window and, just to show that it found it, displays a balloon tip pointing at it. Let's start with the program from last week, the one...

View Article

Image may be NSFW.
Clik here to view.

Warehouse holding 1000 cans of surströmming burns to the ground, insert punch...

A warehouse in Sweden holding 1000 cans of surströmming burned to the ground last week. No people were injured. The cans of surströmming, already prone to violent decompression under normal...

View Article


Image may be NSFW.
Clik here to view.

Letting the boss think your project is classier than it really is

Once upon a time, there was a team developing two versions of a product, the first a short-term project to ship soon, and the other a more ambitious project to ship later. (Sound familiar?) They chose...

View Article

Image may be NSFW.
Clik here to view.

Why does saving a file in Notepad fire multiple FindFirstChangeNotification...

Many people have noticed that the Read­Directory­ChangesW and Find­First­Change­Notification functions (and therefore their BCL equivalent File­System­Watcher and WinRT equivalent...

View Article


Image may be NSFW.
Clik here to view.

How can you use both versions 5 and 6 of the common controls within the same...

Commenter Medinoc was baffled by the statement that the decision to use the visual-styles-enabled version of the common controls library is done on a window-by-window basis. " Isn't it rather on a...

View Article

Image may be NSFW.
Clik here to view.

When was the WM_COPYDATA message introduced, and was it ported downlevel?

Gabe wondered when the WM_COPY­DATA message was introduced. The WM_COPY­DATA message was introduced by Win32. It did not exist in 16-bit Windows. But it was there all along. The The WM_COPY­DATA...

View Article


Image may be NSFW.
Clik here to view.

Even if you're the President, your mother still has the power to embarrass you

Last year, in honor of Mother's Day (the United States version), the John F. Kennedy Library shared a letter sent by President Kennedy to his mother. Mrs. Kennedy had contacted Premier Khrushchev...

View Article

Image may be NSFW.
Clik here to view.

Enumerating bit sequences with isolated zero-bits via the Fibonacci recurrence

Today's Little Program enumerates bit sequences of a particular length subject to the constraint that you cannot have consecutive 0-bits. This may sound kind of arbitrary, but it is important in...

View Article

Image may be NSFW.
Clik here to view.

How do I change among the three levels of play in Space Cadet Pinball?

Many many years ago, a customer presumably was taking advantage of the unlimited support part of their support contract when they asked In the documentation for Space Cadet Pinball, it says... The...

View Article
Browsing all 3085 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>