Showing tag results for Code

Mar 13, 2007
Post comments count0
Post likes count0

The only thing you can do with display names is display them

Raymond Chen
Raymond Chen

There are many functions that return strings called "display names". And the only thing you can do with display names is display them. Don't assume that the string actually means anything, because it doesn't. Theoretically, a function like could be implemented as and your program should still work. (Of course, this is merely a ground rule. S...

Code
Mar 8, 2007
Post comments count0
Post likes count0

The GETDISPINFO notifications tell you what information they want

Raymond Chen
Raymond Chen

The notifications used by the common controls are used when the control asks its parent to generate information that had been marked as delay-rendered, either explicitly via values such as or implicitly by being an owner-data control, for example. In fact the control is really just the middle man between the code that requested information about...

Code
Feb 26, 2007
Post comments count0
Post likes count0

Please feel free to stop using DDE

Raymond Chen
Raymond Chen

A commenter asked, "As an application programmer, can I really ignore DDE if I need to interact with explorer/shell?" The answer is, "Yes, please!" While it was a reasonable solution back in the cooperatively-multitasked world of 16-bit Windows where it was invented, the transition to 32-bit Windows was not a nice one for DDE. Specifically, the ...

Code
Feb 22, 2007
Post comments count0
Post likes count0

With what operations is LockWindowUpdate not meant to be used?

Raymond Chen
Raymond Chen

Okay, now that we know what operations is meant to be used with, we can look at various ways people misuse the function for things unrelated to dragging. People see the "the window you lock won't be able to redraw itself" behavior of and use it as a sort of lazy version of the message. Though sending the message really isn't that much harder ...

Code
Feb 21, 2007
Post comments count0
Post likes count0

With what operations is LockWindowUpdate meant to be used?

Raymond Chen
Raymond Chen

As I noted earlier, the intended purpose of can be captured in one word: dragging. The simplest case of is used by the window manager when you move or resize a window and "Show window contents while dragging" is disabled. When you start the move/size operation, the window manager locks the entire desktop so it can draw the dotted-rectangle feed...

Code
Feb 20, 2007
Post comments count0
Post likes count0

How is LockWindowUpdate meant to be used?

Raymond Chen
Raymond Chen

Now that we know how works, we can look at what it is for. Actually, the intended purpose of can be captured in one word: dragging. But we'll get to that a little later. The purpose of is to allow a program to temporarily take over the responsibility of drawing a window. Of course, in order to do this, you have to prevent the window procedure...

Code
Feb 19, 2007
Post comments count0
Post likes count0

What does LockWindowUpdate do?

Raymond Chen
Raymond Chen

Poor misunderstood . This is the first in a series on , what it does, what it's for and (perhaps most important) what it's not for. What does is pretty simple. When a window is locked, all attempt to draw into it or its children fail. Instead of drawing, the window manager remembers which parts of the window the application tried to draw into...

Code
Feb 16, 2007
Post comments count0
Post likes count0

Why don't I use any class libraries in my sample code?

Raymond Chen
Raymond Chen

As a general rule, I avoid using any class libraries in my sample code. This isn't because I'm opposed to class libraries, but rather because I don't want to narrow my audience to "people who use MFC" (to choose one popular class library). If I were to start using MFC for all of my samples, I'd probably lose all the people who don't use MFC. "Oh, ...

Code
Feb 8, 2007
Post comments count0
Post likes count0

Why does my property sheet blink and the immediately disappear?

Raymond Chen
Raymond Chen

Occasionally, a customer will ask, "I'm trying to display a property sheet, but when I call the function, the property sheet blinks onto the screen and then immediately disappears. What is wrong?" Recall that displaying a property sheet entails filling out a structure, which in turn contains a pointer to either an array of s, or more often, an a...

Code