Showing results for July 2004 - The Old New Thing

Jul 29, 2004
0
0

When should you use a sunken client area?

Raymond Chen
Raymond Chen

The WS_EX_CLIENTEDGE extended window style allows you to create a window whose client area is "sunken". When should you use this style? The Guidelines for User Interface Developers and Designers says in the section on the Design of Visual Elements that the sunken border should be used "to define the work area within a window". Spec...

Code
Jul 27, 2004
0
0

Norway, drunk on success, becomes a country of layabouts

Raymond Chen
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 27, 2004
0
0

Disabling the program crash dialog

Raymond Chen
Raymond Chen

If you don't want your program to display the standard crash dialog, you can disable it by setting the SEM_NOGPFAULTERRORBOX flag in the process error mode. The simple-minded way is just to do but this overwrites the previous error mode rather than augmenting it. In other words, you inadvertently turned off the other error modes! Unfortunat...

Code
Jul 26, 2004
0
0

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

Raymond Chen
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
0
0

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

Raymond Chen
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
0
0

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

Raymond Chen
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
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