Showing tag results for Code

Mar 10, 2008
Post comments count0
Post likes count1

Why isn't there a GetDlgItemFloat function?

Raymond Chen
Raymond Chen

Jonathan Wilson asks, "Do you know why there is a GetDlgItemInt and a SetDlgItemInt but not a GetDlgItemFloat and a SetDlgItemFloat?" Give people five dollars and they'll ask why you didn't give them ten. Let's start with the first question. Why is there a function? After all, doesn't do anything you couldn't already do with and . Well, read...

Code
Mar 3, 2008
Post comments count0
Post likes count1

Why does scheduling a task require a password?

Raymond Chen
Raymond Chen

Kevin asks, "Windows XP lets me install applications, delete files, etc., so why does scheduling a task requires a password?" (I guess the answer to this question wasn't obvious since nobody answered it in the suggestion box.) Because scheduled tasks run after you have logged off. All those other operations occur while you are logged on. Yo...

Code
Feb 29, 2008
Post comments count0
Post likes count1

Why can't I get FormatMessage to load my resource string?

Raymond Chen
Raymond Chen

A common mistake I see is people confusing message tables with string resources. This basically shows up in one place: . The folks who were designing Win32 decided that plain string resources weren't fancy enough, so they invented message tables, which is just another way of storing strings in resources. Why string resources weren't good enough ...

Code
Feb 27, 2008
Post comments count0
Post likes count1

If you ask for STANDARD_RIGHTS_REQUIRED, you may as well ask for the moon

Raymond Chen
Raymond Chen

One of the predefined security access masks is . You see it used in defining the masks for various objects. Here are just a few examples: The mask is meant to be used when defining access masks for object types. I'm guessing it's called because it's the set of access masks that all securable objects must support. Look at the documentation o...

Code
Feb 20, 2008
Post comments count0
Post likes count1

There can be more than one (or zero): Converting a process to a window

Raymond Chen
Raymond Chen

A common question I see is "How do I find the window that corresponds to an ?" This question comes pre-loaded with the assumption that there is only one window that corresponds to an , which is true for only the most rudimentary of Win32 programs. Even a simple program like Notepad has more than one window with the same , as Spy quickly reveals. ...

Code
Feb 18, 2008
Post comments count0
Post likes count1

Why does Explorer show a + sign even if there are no child folders?

Raymond Chen
Raymond Chen

Mike Williams asked in the Suggestion Box why Explorer shows a + sign next to a folder even though it doesn't have any children. Mind you, this wasn't a suggestion; it was just a random question. I don't enjoy answering random questions about specific details of user interface elements since, as it turns out, I did not write every single user inte...

Code
Feb 15, 2008
Post comments count0
Post likes count1

There's more to switching stacks than just loading a new stack pointer

Raymond Chen
Raymond Chen

Sometimes people think they can switch stacks by just loading a new value into the register. This may seem to work but in fact it doesn't, because there is more to switching stacks than just loading a new value into . On the x86, the exception chain is threaded through the stack, and the exception dispatch code verifies that the exception chain...

Code
Feb 5, 2008
Post comments count0
Post likes count1

Who decides what can be done with an object or a control?

Raymond Chen
Raymond Chen

This is one of those things that is obvious to me, but perhaps is not obvious to everyone. An object establishes what can be done with it. Any rights granted by the object go to the creator. The creator can in turn grant rights to others. But if you're a third party to the object/creator relationship, you can't just step in and start messing around...

Code