The Old New Thing

When should you use a sunken client area?

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...
Comments are closed.0 0
Code

Norway, drunk on success, becomes a country of layabouts

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 ...

Disabling the program crash dialog

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! ...
Comments are closed.0 0
Code

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

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 ...

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

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 ...
Comments are closed.0 0
Code

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

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 ...
Comments are closed.0 0
Code

Why can't you trap TerminateProcess?

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 ...