Showing results for 2005 - Page 36 of 40 - The Old New Thing

Feb 24, 2005
Post comments count0
Post likes count0

Modality, part 5: Setting the correct owner for modal UI

Raymond Chen
Raymond Chen

Here is the very simple fix for the buggy program we presented last time. We have fixed the problem by passing the correct owner window for the modal UI. Since is modal, it disables the owner while the modal UI is being displayed, thereby preventing the user from destroying or changing the owner window's state when it is not expecting it. ...

CodeModality
Feb 23, 2005
Post comments count0
Post likes count0

Modality, part 4: The importance of setting the correct owner for modal UI

Raymond Chen
Raymond Chen

If you decide to display some modal UI, it is important that you set the correct owner for that UI. If you fail to heed this rule, you will find yourself chasing some very strange bugs. Let's return to our scratch program and intentionally introduce a bug related to incorrect owner windows, so that we can see the consequences. Run this prog...

CodeModality
Feb 22, 2005
Post comments count0
Post likes count0

Modality, part 3: The WM_QUIT message

Raymond Chen
Raymond Chen

After our two quick introductions to modality, we're now going to dig in a little deeper. The trick with modality is that when you call a modal function, the responsibility of message dispatch is handled by that function rather than by your main program. Consequently, if you have customized your main program's message pump, those customizatio...

CodeModality
Feb 21, 2005
Post comments count0
Post likes count0

Modality, part 2: Code-modality vs UI-modality

Raymond Chen
Raymond Chen

Last time, we saw an example of code that was UI-modal but not code-modal. The opposite is also true: You can have code-modality without UI-modality. In fact, this is far more common than the UI-modal-but-not-code-modal scenario. You encounter modal loops without a visible change in UI state when you drag the scroll bar thumb, drag the window capt...

CodeModality
Feb 18, 2005
Post comments count0
Post likes count0

Modality, part 1: UI-modality vs code-modality

Raymond Chen
Raymond Chen

From the end-users' point of view, modality occurs when the users are locked into completing a task once it is begun, with the only escape being to cancel the entire operation. Opening a file is an example of a modal operation: Once the "Open" command has been selected, users have no choice but to select a file for opening (or to cancel the operat...

CodeModality
Feb 16, 2005
Post comments count0
Post likes count0

Limitations of the shell animation control

Raymond Chen
Raymond Chen

The Animation control in the shell common controls library supports only a very limited class of AVI files. Why all these restrictions? Because the purpose of the Animation control is to be able to show simple animations. If you have a complex animation, you should be using one of the more advanced animation controls, like the MCIWnd window c...

Code
Feb 15, 2005
Post comments count0
Post likes count0

You cannot globally reserve user-mode address space

Raymond Chen
Raymond Chen

Occasionally, somebody asks for a way to reserve user-mode address space globally. In other words, they want to allocate address space in all processes in the system (current and future). Typically this is because they want to map some memory into each process and don't want to go through the trouble of designing the shared memory blocks so that t...

Code
Feb 14, 2005
Post comments count0
Post likes count0

How to act like you know Chinese even though you don't

Raymond Chen
Raymond Chen

I was riding in a car with a friend when a Chinese pop album spun up on the CD. I made a remark about the song, and my friend, knowing that I was studying Mandarin, asked me, "Do you know what she's singing about?" I immediately replied, "She's singing about love." "Wow," my friend responded. "Your Chinese is quite good." "Nope," I said. "But a...

Non-ComputerExcursions into East Asian pop music
Feb 14, 2005
Post comments count0
Post likes count0

LoadLibraryEx(DONT_RESOLVE_DLL_REFERENCES) is fundamentally flawed

Raymond Chen
Raymond Chen

There is a flag to the function called . The documentation says, If this value is used, and the executable module is a DLL, the system does not call DllMain for process and thread initialization and termination. Also, the system does not load additional executable modules that are referenced by the specified module. If you are planning onl...

Code