Showing archive results for 2004

Jul 27, 2004
Post comments count0
Post likes count0

Norway, drunk on success, becomes a country of layabouts

Raymond Chen

Norwegians have it so good that they've started getting lazy: Before the oil boom, when Norway was mostly poor and largely isolated, the country survived on its hard work and self-reliance, two stalwart Scandinavian virtues. Now, with the country still bulging from three decades of oil money, Norway is discovering that sudden we...

Non-Computer
Jul 26, 2004
Post comments count0
Post likes count0

A twenty-foot-long computer

Raymond Chen

Pushing the specification to extremes.

History
Jul 26, 2004
Post comments count0
Post likes count0

Slightly closer to a proper football (i.e., soccer) match

Raymond Chen

This weekend, I attended a soccer match between Chelsea FC and Celtic FC at Seahawks Stadium Qwest Field. The game was the opener of the 2004 ChampionsWorld Series, wherein some of the top soccer teams from Europe tour North America to give us yanks a chance to see how football is done for real. From reading the team's web sites bef...

Non-Computer
Jul 23, 2004
Post comments count0
Post likes count0

Why do some process stay in Task Manager after they've been killed?

Raymond Chen

When a process ends (either of natural causes or due to something harsher like TerminateProcess), the user-mode part of the process is thrown away. But the kernel-mode part can't go away until all drivers are finished with the thread, too. For example, if a thread was in the middle of an I/O operation, the kernel signals to the driver res...

Code
Jul 23, 2004
Post comments count0
Post likes count0

Why do some process stay in Task Manager after they’ve been killed?

Raymond Chen

When a process ends (either of natural causes or due to something harsher like TerminateProcess), the user-mode part of the process is thrown away. But the kernel-mode part can't go away until all drivers are finished with the thread, too. For example, if a thread was in the middle of an I/O operation, the kernel signals to the driver res...

Code
Jul 22, 2004
Post comments count0
Post likes count1

Why can't you trap TerminateProcess?

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 22, 2004
Post comments count0
Post likes count0

Why can’t you trap TerminateProcess?

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
Post comments count0
Post likes count0

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

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
Post comments count0
Post likes count1

Querying information from an Explorer window

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
Post comments count0
Post likes count0

Wrapper templates to make writing callback functions slightly easier

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