Showing results for August 2013 - The Old New Thing

Aug 30, 2013
0
0

Can an x64 function repurpose parameter home space as general scratch space?

Raymond Chen
Raymond Chen

We saw some time ago that the x64 calling convention in Windows reserves space for the register parameters on the stack, in case the called function wants to spill them. But can the called function use the memory for other purposes, too? You sort of already know the answer to this question. Consider this function: How would a naïve comp...

Code
Aug 29, 2013
0
0

How can I write to a file only as long as nobody's looking?

Raymond Chen
Raymond Chen

A customer wanted to know how to detect that the user has opened Notepad to view a particular file. They had come up with method based on polling and sniffing the Notepad title bar, but they found that it consumed a lot of CPU. (They hadn't noticed yet that it doesn't localize, and that it can trigger false positives since Notepad shows only the fi...

Code
Aug 28, 2013
0
0

The format of data and custom resources

Raymond Chen
Raymond Chen

Continuing the highly-sporadic series of Win32 resource formats, today we'll look at the format of resources, which are declared in resource files as . Also the format of custom resources, which are declared in resource files by just giving the custom resource name or ordinal as the second word on the declaration. The format is very simple: It's ...

Code
Aug 27, 2013
0
0

How can I find out which process and user is modifying a file?

Raymond Chen
Raymond Chen

When troubleshooting a problem, you may discover that a file is being modified that shouldn't, and you figure out would be nice if there were some way of finding out which process is modifying the file (so you can get it to stop). Enter the security auditing system. Every securable object has an associated system access control list (SACL) which ...

Tips/Support
Aug 26, 2013
0
0

The challenge of improvisational historical comedy

Raymond Chen
Raymond Chen

I dreamed that one of my friends signed me up for some sort of combination Punk'd/Thank God You're Here improv show without my knowledge, and I had to explain how her husband had unwittingly coined some nonspecific Internet meme.

Non-ComputerDream
Aug 26, 2013
0
0

Why doesn't the "Automatically move pointer to the default button in a dialog box" work for nonstandard dialog boxes, and how do I add it to my own nonstandard dialog boxes?

Raymond Chen
Raymond Chen

The Mouse control panel has a setting called Automatically move pointer to the default button in a dialog box, known informally as Snap to default button or simply Snap To. You may have discovered that it doesn't work for all dialog boxes. Why not? The Snap To feature is implemented by the dialog manager. When the window is shown and the setting...

CodeTips/Support
Aug 21, 2013
0
0

Adding a confirmation dialog to every drag/drop operation does not solve the problem

Raymond Chen
Raymond Chen

A customer wanted to know how to enable a confirmation dialog whenever the user inadvertently perform a drag/drop operation in Explorer to move files within a volume. For example, if I have an S drive mapped to \\server\share, I would like to display the confirmation dialog when users inadvertently drag and drop a file or folder within the S drive...

Tips/Support
Aug 20, 2013
0
0

Microspeak: The train

Raymond Chen
Raymond Chen

Hop on board, don't be late, or you'll have to catch the next one.

OtherMicrospeak