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 ArticleHow 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 ArticleLe 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 ArticleHow 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 ArticleI thought you could use SWP_FRAMECHANGED to force a control to recalculate...
Simon Cooke dug back into his memory and asked, "Doesn't calling SetWindowPos with SWP_FRAMECHANGED cause a recreate and re-apply of the styles?" The SWP_FRAMECHANGED flag does not recreate...
View ArticleA 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 ArticleShowing 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 ArticleWhy 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 ArticleThe 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 StartRunNoHOMEPATH policy, they found "if the user creates a Notepad file, the file is searched in the user's...
View ArticleHow do I extract an icon at a nonstandard size if IExtractIcon::Extract tells...
Commenter Ivo notes that if you ask IExtractIcon::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 ArticleIf 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. /LARGEADDRESSAWARE. SizeOfStackReserve and SizeOfStackCommit. There are plenty of others. Commenter 640k asks why these settings...
View ArticleGetting 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 ArticleWarehouse 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 ArticleLetting 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 ArticleWhy does saving a file in Notepad fire multiple FindFirstChangeNotification...
Many people have noticed that the ReadDirectoryChangesW and FindFirstChangeNotification functions (and therefore their BCL equivalent FileSystemWatcher and WinRT equivalent...
View ArticleHow 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 ArticleWhen was the WM_COPYDATA message introduced, and was it ported downlevel?
Gabe wondered when the WM_COPYDATA message was introduced. The WM_COPYDATA message was introduced by Win32. It did not exist in 16-bit Windows. But it was there all along. The The WM_COPYDATA...
View ArticleEven 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 ArticleEnumerating 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 ArticleHow 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