Showing results for 2010 - Page 4 of 36 - The Old New Thing

Dec 1, 2010
0
0

How do I delete bytes from the beginning of a file?

Raymond Chen
Raymond Chen

It's easy to append bytes to the end of a file: Just open it for writing, seek to the end, and start writing. It's also easy to delete bytes from the end of a file: Seek to the point where you want the file to be truncated and call . But how do you delete bytes from the beginning of a file? You can't, but you sort of can, even though you can't. ...

Other
Nov 30, 2010
0
0

Microspeak: Take-away

Raymond Chen
Raymond Chen

At Microsoft, the take-away is the essential message of a presentation or the conclusion that you are expected to draw from a situation. It is something you are expected to remember when the whole thing is over, a piece of information you take away with you as you leave the room. XYZ demo take away (title of a document) The preferred intensifier...

Non-ComputerMicrospeak
Nov 29, 2010
0
0

What were Get/SetMessageExtraInfo ever used for?

Raymond Chen
Raymond Chen

KJK::Hyperion asks, "Could you shed some light on Get/SetMessageExtraInfo? It's almost like nobody on earth used them, ever, and I can't get some sample code." Yup, that's about right. Nobody on earth (to within experimental error) ever used them. These functions were introduced on July 20, 1990 (I'm looking at the change history right now) at th...

History
Nov 26, 2010
0
0

Watching the game of Telephone play out in five seconds

Raymond Chen
Raymond Chen

Some time ago, I spent the Thanksgiving holiday with my nieces (ages 3 and 5 at the time), and I overheard this conversation between them. "Thanksgiving is over." — Christmas is coming! "It's Christmas time!" — Today is Christmas!

Non-Computer
Nov 26, 2010
0
0

The easy way out is to just answer the question: What is the current Explorer window looking at?

Raymond Chen
Raymond Chen

A customer had the following question: We have an application which copies and pastes files. Our problem is that we want to paste the files into the folder which corresponds to the currently active Windows Explorer window. Right now, we're using , but we find this method unsatisfactory because we want to replace Explorer's default file copy engine...

Code
Nov 25, 2010
0
0

What if two programs did this? Practical exam

Raymond Chen
Raymond Chen

A customer who doesn't read this blog had the following question: The requirement for our application is that it must be on top of all other windows, even in the presence of other windows with the topmost style. In our and messages, we set ourselves to topmost, and then call to bring ourselves to the front, and then we ourselves just to make...

Other
Nov 24, 2010
0
0

You can filter the Common File dialog with wildcards

Raymond Chen
Raymond Chen

A customer reported an apparent inconsistency in the shell common file dialogs: The question mark appears to be treated differently from other invalid file name characters. I tried to save a file in Paint under the name but instead of telling me that I had an invalid character in the file name (as it does with other characters like and ) or nav...

Tips/Support
Nov 23, 2010
0
1

But who's going to set up their own email server?

Raymond Chen
Raymond Chen

Many many years ago, back in the days when Microsoft's email address had exclamation points, an internal tool was developed to permit Microsoft employees to view and update their Benefits information from the comfort of their very own offices. Welcome to the paperless office! One of my friends noticed an odd sentence in the instructions for using ...

Non-Computer
Nov 22, 2010
0
1

Consequences of using variables declared __declspec(thread)

Raymond Chen
Raymond Chen

As a prerequisite, I am going to assume that you understand how TLS works, and in particular how variables work. There's a quite thorough treatise on the subject by Ken Johnson (better known as Skywing), who comments quite frequently on this site. The series starts here and continues for a total of 8 installments, ending here. That last page al...

Code
Nov 19, 2010
0
0

What's the difference between the Windows directory and the System directory?

Raymond Chen
Raymond Chen

(Windows was released on November 20, 1985, twenty-five years ago tomorrow. Happy birthday!) You have and you have . Why do we need both? They're both read-only directories. They are both searched by . They seem to be redundant. (There are other directories like which are not relevant to the discussion.) Back in the old days, the distinction wa...

History