Showing tag results for Code

Oct 17, 2006
Post comments count0
Post likes count0

What does the letter "T" in LPTSTR stand for?

Raymond Chen

The "T" in comes from the "T" in . I don't know for certain, but it seems pretty likely that it stands for "text". By comparison, the "W" in probably comes from the C language standard, where it stands for "wide".

Code
Oct 12, 2006
Post comments count0
Post likes count0

How do I prevent multi-line edit controls from eating the Enter key?

Raymond Chen

You might decide to put a multi-line edit control in a dialog box, not because you want the user to input multi-line data, but because it's a convenient way to display multi-line text. When you do that, you may notice that the Enter key does not invoke the default dialog button, as you might normally expect. That's because the multi-line edit contr...

Code
Oct 10, 2006
Post comments count0
Post likes count0

When something is available for the user, which user are we talking about?

Raymond Chen

Some people have taken issue with the term for the name of the base of the message range that is the province of the window class implementor. (Refresher for those who forget which messages belong to whom.) The complaint is that the user can't use them since they belong to the window class. Aha, but the real question is, "Who is the user?" In oth...

Code
Oct 6, 2006
Post comments count0
Post likes count0

A very brief return to part 6 of Loading the Chinese/English dictionary

Raymond Chen

Back in Part 6 of the first phase of the "Chinese/English dictionary" series (a series which I intend to get back to someday but somehow that day never arrives), I left an exercise related to the member of the union. Alignment is one of those issues that people who grew up with a forgiving processor architecture tend to ignore. In this case,...

Code
Sep 28, 2006
Post comments count0
Post likes count0

When you crash, make sure you crash in the right place

Raymond Chen

Last time, I recommended that functions should just crash when given invalid pointers. There's a subtlety to this advice, however, and that's making sure you crash in the right place. If your function and your function's caller both reside on the same side of a security boundary, then go ahead and crash inside your function. If the caller is a bad...

Code
Sep 26, 2006
Post comments count0
Post likes count0

Isn't DDE all asynchronous anyway?

Raymond Chen

"Isn't DDE all asynchronous anyway?" asks commenter KaiArnold. It's mostly asynchronous, but not entirely. You can read about how DDE works in MSDN, but since it seems people are reluctant to read the formal documentation, I'll repeat here the points relevant to the discussion. The DDE process begins with a search for a service provider. This i...

Code
Sep 25, 2006
Post comments count0
Post likes count0

Waiting until the dialog box is displayed before doing something

Raymond Chen

Last time, I left you with a few questions. Part of the answer to the first question was given in the comments, so I'll just link to that. The problem is more than just typeahead, though. The dialog box doesn't show itself until all message traffic has gone idle. If you actually ran the code presented in the original message, you'd find that it ...

Code
Sep 22, 2006
Post comments count0
Post likes count0

Things you already know: How do I wait until my dialog box is displayed before doing something?

Raymond Chen

One customer wanted to wait until the dialog box was displayed before displaying its own dialog box. (Personally, I think immediately displaying a doubly-nested dialog box counts as starting off on the wrong foot from a usability standpoint, but let's set that issue aside for now.) The customer discovered that displaying the nested dialog box in r...

Code