Posts by this author

Dec 5, 2003
Post comments count0
Post likes count0

Why do I have to return this goofy value for WM_DEVICECHANGE?

To deny a device removal query, you must return the special value BROADCAST_QUERY_DENY, which has the curious value 0x424D5144. What's the story behind that? Well, we first tried following the pattern set by WM_QUERYENDSESSION, where returning TRUE allows the operation to proceed and returning FALSE causes the operation to fail. But when we did t...

History
Dec 4, 2003
Post comments count0
Post likes count0

Which access rights bits belong to whom?

Each ACE in a security descriptor contains a 32-bit access mask. Which bits belong to whom? The access rights mask is a 32-bit value. The upper 16 bits are defined by the operating system and the lower 16 bits are defined by the object being secured. For example, consider the value 0x00060002 for the access rights mask. This breaks down as the sy...

Code
Dec 3, 2003
Post comments count0
Post likes count0

Which window style bits belong to whom?

There are 64 bits of styles in the parameters to CreateWindowEx. Which ones belong to whom? Windows defines the meanings of the high word of the dwStyle parameter and all of the bits in the dwExStyle parameter. The low 16 bits of the dwStyle parameter are defined by the implementor of the window class (by the person who calls RegisterClass). In W...

Code
Dec 2, 2003
Post comments count0
Post likes count0

The New Old New Thing

This is the (future) new home of The Old New Thing. Just kicking the tires right now.

Other
Dec 2, 2003
Post comments count0
Post likes count0

Which message numbers belong to whom?

Valid window messages break down into four categories. 0 .. 0x3FF (WM_USER-1): System-defined messages. The meanings of these messages are defined by the operating system and cannot be changed. Do not invent new messages here. Since the meanings are defined by Windows, the operating system understands how to parse the WPARAM and LPARAM paramet...

Code
Dec 1, 2003
Post comments count0
Post likes count0

What are these strange values returned from GWLP_WNDPROC?

GetWindowLongPtr(hwnd, GWLP_WNDPROC) [or GetWindowLong(hwnd, GWL_WNDPROC) if you haven't yet made your code 64-bit compatible] is supposed to return the current window procedure. Why do I sometimes get wacko values? Because sometimes "you can't handle the truth". If the current window procedure is incompatible with the caller of GetWindowLongPtr,...

History
Nov 28, 2003
Post comments count0
Post likes count0

Hello Sweden, you're on fire

(Geek talk resumes on Monday.) The longstanding tradition of Norwegians telling Swedish jokes and vice versa, was recently refueled by a border story. A Norwegian man called Sweden on his mobile phone to tell them they had a forest fire. Not only did the firefighters not know about the blaze, they didn't recognize the name of the place on fire. ...

Non-Computer
Nov 27, 2003
Post comments count0
Post likes count0

It's like the Swedes don't want you to learn their language

(It's a holiday in the States today and tomorrow, so I'm not going to talk about geek stuff. That'll resume on Monday.) If you pay a visit to Deutsche Welle, the German international broadcasting service, you will find a wide array of online German learning materials, such as the daily news in slowly- and clearly-enunciated German (including tra...

Non-Computer
Nov 26, 2003
Post comments count0
Post likes count0

Other tricks with WM_GETDLGCODE

The WM_GETDLCODE message lets you influence the behavior of the dialog manager. A previous entry on using WM_GETDLGCODE described the flag which controls whether edit control content is auto-selected when focus changes. I was going to write a bit about the other flags, but it turns out that Knowledge Base Article 83302 already covers this, so I...

Code