Showing results for January 2010 - The Old New Thing

Jan 29, 2010
0
0

How do I suppress full window drag/resize for just one window?

Raymond Chen
Raymond Chen

A customer asked, Is there a way to turn off Full Window Drag on a single window? I have a resizable control that I would like not update itself while resizing. It so happens that I wrote a sample program ages ago to illustrate how to do this. You can find it in the Platform SDK under . The source code is also reproduced in this Knowledge ...

Code
Jan 29, 2010
0
0

Microsoft phenomenon: The annual award that winds up being awarded only once

Raymond Chen
Raymond Chen

The Grammy Awards will be handed out this upcoming weekend, an annual award that seems to have survived. A not uncommon phenomenon at Microsoft is the annual award that winds up being awarded only once. Because all the excitement is in the announcement, not in the actual award. Every year, we want to uniquely call out and recognize a set of ...

Non-Computer
Jan 28, 2010
0
0

What idiot would hard-code the path to Notepad?

Raymond Chen
Raymond Chen

There seemed to be a great deal of disbelief that anybody would hard-code the path to Notepad. Here's one example and here's another. There's a large class of problems that go like this: I'm running Program X, and when I tell it to view the error log, I get this error message: What is wrong and how do I fix it? Obviously, the file is ...

Code
Jan 27, 2010
0
0

If you are trying to understand an error, you may want to look up the error code to see what it means instead of just shrugging

Raymond Chen
Raymond Chen

A customer had a debug trace log and needed some help interpreting it. The trace log was generated by an operating system component, but the details aren't important to the story. I've attached the log file. I think the following may be part of the problem. Any ideas? Thanks, Bob Smith Senior Test Engineer Tailspin Toys What struck me ...

Tips/Support
Jan 26, 2010
0
0

Microspeak: Zap

Raymond Chen
Raymond Chen

You may hear an old-timer developer use the verb zap. That proposed fix will work. Until everybody gets the fix, they can just zap the assert. The verb to zap means to replace a breakpoint instruction with an appropriate number of NOP instructions (effectively ignoring it). The name comes from the old Windows 2.x kernel debugger. (Actually, ...

CodeMicrospeak
Jan 25, 2010
0
0

Why doesn't the window manager have a SetClipboardDataEx helper function?

Raymond Chen
Raymond Chen

Jonathan Wilson asks why the clipboard APIs still require GlobalAlloc and friends. Why is there not a or something that does what does but without needing to call ? Okay, here's your function: Whoop-dee-doo. Historically, Windows doesn't go out of its way to include functions like this because you can easily write them yourself, or you ...

Code
Jan 22, 2010
0
0

During process termination, the gates are now electrified

Raymond Chen
Raymond Chen

It turns out that my quick overview of how processes exit on Windows XP was already out of date when I wrote it. Mind you, the information is still accurate for Windows XP (as far as I know), but the rules changed in Windows Vista. What about critical sections? There is no "Uh-oh" return value for critical sections; doesn't have a...

Code
Jan 21, 2010
0
0

Historically, Windows didn't tend to provide functions for things you can already do yourself

Raymond Chen
Raymond Chen

Back in the old days, programmers were assumed to be smart and hardworking. Windows didn't provide functions for things that programs could already do on their own. Windows worried about providing functionality for thing that programs couldn't do. That was the traditional separation of responsibilities in operating systems of that era. If you ...

Other
Jan 20, 2010
0
0

The wrong way to determine the size of a buffer

Raymond Chen
Raymond Chen

A colleague of mine showed me some code from a back-end program on a web server. Fortunately, the company that wrote this is out of business. Or at least I hope they're out of business...

Code
Jan 19, 2010
0
0

The hardest part of writing the video game Monty Python's Complete Waste of Time

Raymond Chen
Raymond Chen

Many years ago, I happened to have lunch with one of the programmers who worked on the video game Monty Python's Complete Waste of Time (read a review). This program was notable in many ways, most geekily that it was brought on board the Mir space station by astronaut Michael Foale. Anyway, during the course of lunch, I learned something unusual...

Non-Computer

Feedback

  翻译: