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

Image may be NSFW.
Clik here to view.

How do you deal with an input stream that may or may not contain Unicode data?

Dewi Morgan reinterpreted a question from a Suggestion Box of times past as "How do you deal with an input stream that may or may not contain Unicode data?" A related question from Dave wondered how...

View Article


Image may be NSFW.
Clik here to view.

The day I stole Joe Belfiore's mouse

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

View Article


Image may be NSFW.
Clik here to view.

Does the CopyFile function verify that the data reached its final destination...

A customer had a question about data integrity via file copying. I am using the File.Copy to copy files from one server to another. If the call succeeds, am I guaranteed that the data was copied...

View Article

Image may be NSFW.
Clik here to view.

How do I invoke a verb on an IShellItemArray?

A customer wanted to invoke a command on multiple items at once. I have an IShellItemArray, and I want to invoke a verb with that array as the parameter. I know that I can invoke a verb on a single...

View Article

Image may be NSFW.
Clik here to view.

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

A colleague needed some help with manipulating SAFEARRAYs. I have some generic code to execute WMI queries and store the result as strings. Normally, Variant­Change­Type(VT_BSTR) does the work, but...

View Article


Image may be NSFW.
Clik here to view.

In vollen Zügen genießen

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

View Article

Image may be NSFW.
Clik here to view.

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

Clipboard Gadget wants to know why normal processes can kill elevated processes via TerminateProcess, yet they cannot do a trivial Show­Window(hwnd, SW_MINIMIZE). "Only explorer seems to be able to do...

View Article

Image may be NSFW.
Clik here to view.

A classification of faces with eyes open and closed in Dr. Seuss's ABC based...

A classification of faces with eyes open and closed in Dr. Seuss's ABC: An Amazing Alphabet Book! based on the nature of the character Narrators OtherUnspectacled OtherBespectacled Eyes Open Closed...

View Article


Image may be NSFW.
Clik here to view.

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

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

View Article


Image may be NSFW.
Clik here to view.

Sabotaging yourself: Closing a handle and then using it

A customer reported a problem with the WaitForSingleObject function: I have a DLL with an Initialize() function and an Uninitialize() function. The code goes like this: HANDLE FooMutex; BOOL...

View Article

Image may be NSFW.
Clik here to view.

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

A customer was having trouble with their RGS file. I want to include the below line in a .rgs file: val HandlerPath = s '%windir%\system32\awesome.dll'. When I do this, registering of the dll fails...

View Article

Image may be NSFW.
Clik here to view.

The Ride to Rio: Bicycling from Los Angeles to Rio de Janeiro

An acquaintance of mine remarked that he sold his bicycle in Seattle a few months ago to some guy who explained, "I'm going to ride it to South America." "Okay," my acquaintance said, probably with...

View Article

Image may be NSFW.
Clik here to view.

Data in crash dumps are not a matter of opinion

A customer reported a problem with the System­Time­To­Tz­Specific­Local­Time function. (Gosh, why couldn't they have reported a problem with a function with a shorter name! Now I have to type that...

View Article


Image may be NSFW.
Clik here to view.

2012 Q3 link clearance: Microsoft research edition

My Q1 and Q3 link clearances are traditionally for links to other Microsoft bloggers, but this time I'm going to link to a few Microsoft research papers I found interesting. Why do Nigerian scammers...

View Article

Image may be NSFW.
Clik here to view.

What's the difference between F5 and F8 at the boot screen?

Ian B wondered what the difference is between pressing F5 and F8 while Windows is booting. I have no idea either. My strategy was to just mash on the function keys, space bar, DEL key, anything else I...

View Article


Image may be NSFW.
Clik here to view.

Microspeak: Granular

Today's Microspeak word is granular. Here are some citations. Please bring your cost estimates at the granularity of 3, 5 or 10 days. The archive function archives all data older than the date...

View Article

Image may be NSFW.
Clik here to view.

How do I suppress the default animation that occurs when I hide or show a...

A customer wanted to know how they can disable the default fade-in/fade-out animation that occurs when a window is hidden or shown. "I don't want to use WS_EX_TOOL­WINDOW because that causes my window...

View Article


Image may be NSFW.
Clik here to view.

Why does RegOpenKey sometimes (but not always) fail if I use two backslashes...

A customer reported that on Windows XP, they observed that their program would very rarely get the error ERROR_INVALID_ARGUMENT when they passed two backslashes instead of one to the Reg­Open­Key­Ex...

View Article

Image may be NSFW.
Clik here to view.

An unexpected application of negative numbers to gift-giving

A college classmate of mine informed me that one of his colleagues had planned his wedding so far in advance that on his negative-first anniversary (i.e., precisely one year before his anticipated...

View Article

Image may be NSFW.
Clik here to view.

How do I override the default icon selection algorithm?

The usual way of loading an icon from a resource is to use the Load­Icon or Load­Image function and letting the window manager's icon selection algorithm decide which image to use based on the images...

View Article
Browsing all 3085 articles
Browse latest View live