Showing results for July 2004 - Page 2 of 5 - The Old New Thing

Jul 22, 2004
0
0

Why can’t you trap TerminateProcess?

Raymond Chen
Raymond Chen

If a user fires up Task Manager and clicks "End Task" on your program, Windows first tries to shut down your program nicely, by sending WM_CLOSE messages to GUI programs and CTRL_CLOSE_EVENT events to console programs. But you don't get a chance to intercept TerminateProcess. Why not? TerminateProcess is the low-level process killing function. It...

Other
Jul 21, 2004
0
0

Why was nine the maximum number of monitors in Windows 98?

Raymond Chen
Raymond Chen

Windows 98 was the first version of Windows to support multiple monitors. And the limit was nine. Why nine? Because that allowed you to arrange your monitors like this. You have early seventies television to thank. [Raymond is currently on vacation; this message was pre-recorded.]

History
Jul 20, 2004
0
1

Querying information from an Explorer window

Raymond Chen
Raymond Chen

Sometimes software development is inventing new stuff. But often, it's just putting together the stuff you already have. Today's puzzle is one of the latter type of problem. Given a window handle, you can you determine (1) whether it is an Explorer window, and if so (2) what folder it is viewing, and (3) what item is currently foc...

Code
Jul 19, 2004
0
0

Wrapper templates to make writing callback functions slightly easier

Raymond Chen
Raymond Chen

I previously discussed why callback functions must be static if they are member functions. Writing the correct prototype for the callback function is usually somewhat clumsy. It's not hard. Just clumsy. (If you read my previous article, you'd recognizing sticking a __stdcall in the declaration for RealThreadProc as a micro-optimization.) Every c...

Code
Jul 16, 2004
0
0

How to display a string without those ugly boxes

Raymond Chen
Raymond Chen

You've all seen those ugly boxes. When you try to display a string and the font you have doesn't support all of the characters in it, you get an ugly box for the characters that aren't available in the font. Start with our scratch program and add this to the function: That string contains the first three letters from three different alphab...

Code
Jul 15, 2004
0
1

Don’t forget to #define UNICODE if you want Unicode

Raymond Chen
Raymond Chen

I answered this comment directly, but it deserves reiteration with wider visibility. If you don't #define UNICODE, you get ANSI by default. If you want to see characters beyond the boring 7-bit ASCII, make sure you are using a font that can display those characters. I am assuming a level of competence where issues like this go without s...

Code
Jul 15, 2004
0
0

Why “Under Construction” should be made illegal on the web

Raymond Chen
Raymond Chen

The site www.emr.fr has been "under construction" for over eight years. I noticed it in June 1996 and check back on it periodically. Still Under Construction. Another site that I noticed as "Under Construction" in June 1996 is www.leary.com. And as of this writing, it is still under construction.

Other
Jul 15, 2004
0
1

Don't forget to #define UNICODE if you want Unicode

Raymond Chen
Raymond Chen

I answered this comment directly, but it deserves reiteration with wider visibility. If you don't #define UNICODE, you get ANSI by default. If you want to see characters beyond the boring 7-bit ASCII, make sure you are using a font that can display those characters. I am assuming a level of competence where issues like this go without s...

Code
Jul 15, 2004
0
0

Why "Under Construction" should be made illegal on the web

Raymond Chen
Raymond Chen

The site www.emr.fr has been "under construction" for over eight years. I noticed it in June 1996 and check back on it periodically. Still Under Construction. Another site that I noticed as "Under Construction" in June 1996 is www.leary.com. And as of this writing, it is still under construction.

Other