Showing archive results for 2012

Sep 27, 2012
Post comments count0
Post likes count1

Why aren't environment variables being expanded in my RGS file?

Raymond Chen

A customer was having trouble with their RGS file. I want to include the below line in a .rgs file: When I do this, registering of the dll fails with 80002009. Any help? If I change it to then the registration succeeds (but of course now contains a hard-coded path). A common problem people have when asking a question is assuming that th...

Code
Sep 26, 2012
Post comments count0
Post likes count1

Sabotaging yourself: Closing a handle and then using it

Raymond Chen

A customer reported a problem with the function: I have a DLL with an function and an function. The code goes like this: Under certain conditions, the function is called twice, and the function is correspondingly called twice. Under these conditions, if I run the code on a single-processor system with hyperthreading disabled, then every...

Code
Sep 25, 2012
Post comments count0
Post likes count1

Why can't I set "Size all columns to fit" as the default?

Raymond Chen

A customer wanted to know how to set Size all columns to fit as the default for all Explorer windows. (I found an MSDN forum thread on the same subject, and apparently, the inability to set Size all columns to fit as the default is "an enormous oversight and usability problem.") The confusion stems from the phrasing of the option; it's not clear ...

Other
Sep 24, 2012
Post comments count0
Post likes count1

I brought this process into the world, and I can take it out!

Raymond Chen

Clipboard Gadget wants to know why normal processes can kill elevated processes via , yet they cannot do a trivial . "Only explorer seems to be able to do so somehow." There are several questions packed into this "suggestion." (As it happens, most of the suggestions are really questions; the suggestion is "I suggest that you answer my question." ...

Other
Sep 21, 2012
Post comments count0
Post likes count0

In vollen Zügen genießen

Raymond Chen

One of my friends bought me a souvenir one one of his trips to Germany. It is a beer mug from Bayerischer Bahnhof, a restaurant and brewery at the Leipzig Bayerischer Bahnhof. The mug carries the brewery's slogan In vollen Zügen genießen, which is a German idiom meaning "to enjoy to the fullest." Literally, "Das Leben in vollen Züg...

Non-Computer
Sep 21, 2012
Post comments count0
Post likes count1

How can I implement SAFEARRAY.ToString() without going insane?

Raymond Chen

A colleague needed some help with manipulating s. I have some generic code to execute WMI queries and store the result as strings. Normally, does the work, but doesn't know how to convert arrays (e.g. ). And there doesn't seem to be an easy way to convert the array element-by-element because expects a pointer to an object of the underlying ty...

Code
Sep 20, 2012
Post comments count0
Post likes count1

How do I invoke a verb on an IShellItemArray?

Raymond Chen

A customer wanted to invoke a command on multiple items at once. I have an , and I want to invoke a verb with that array as the parameter. I know that I can invoke a verb on a single by the code below, but how do I pass an entire array? The function invokes the command by extracting the pidl, then asking to invoke the command on the pidl...

Code
Sep 18, 2012
Post comments count0
Post likes count1

The day I stole Joe Belfiore's mouse

Raymond Chen

He's now the head demo-monkey/cheerleader for Windows Phone, but back in the old days, Joe Belfiore was the head demo-monkey/cheerleader for the Windows 95 user interface design. A team-wide meeting was held to show off the new interface that they had developed. Wow look, we have a Start menu (though it wasn't known by that name yet), a taskb...

OtherThe social skills of a thermonuclear device