Showing archive results for 2014

May 6, 2014
Post comments count0
Post likes count1

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

Raymond Chen

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 to assign the projects code names Ren and Stimpy, in honor of the lead characters from the eponymous cartoon series. Over time, the two projects me...

History
May 5, 2014
Post comments count0
Post likes count0

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

Raymond Chen

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 conditions, exploded over a period of six hours. Some of them turned into projectiles and shot through the air. No information on what effect this ...

May 5, 2014
Post comments count0
Post likes count1

Getting the location of the Close button in the title bar

Raymond Chen

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 that displays a balloon tip, then make these changes: Instead of positioning the balloon at the cursor position, we put it at the center ...

Code
May 2, 2014
Post comments count0
Post likes count1

If a lot of settings are ignored when set in a DLL, why bother even letting you set them on a DLL?

Raymond Chen

There are many settings that are ignored when set in a DLL. . and . There are plenty of others. Commenter 640k asks why these settings even exist for DLLs if they has no effect. Because they are settings for PE modules in general. If there were separate file formats for EXEs and DLLs, then there would have to be two different module loaders, ...

Other
May 1, 2014
Post comments count0
Post likes count1

How do I extract an icon at a nonstandard size if IExtractIcon::Extract tells me to go jump in a lake?

Raymond Chen

Commenter Ivo notes that if you ask to extract an icon at a particular size, the function can return which means "Go jump in a lake do it yourself." But how can you do it yourself? The and functions don't let you specify a custom size, and doesn't work with icon indices (only resource IDs). The function comes to the rescue. This takes all...

Code
Apr 30, 2014
Post comments count0
Post likes count1

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

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
Post comments count0
Post likes count2

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

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
Post comments count0
Post likes count1

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

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
Post comments count0
Post likes count1

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

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 24, 2014
Post comments count0
Post likes count1

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

Raymond Chen

Simon Cooke dug back into his memory and asked, "Doesn't calling with cause a recreate and re-apply of the styles?" The 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 are the styles managed by the window manager, which are in the upper ...

Code