Showing tag results for Code

Apr 27, 2007
Post comments count0
Post likes count0

Stupid debugger tricks: Calling functions and methods

Raymond Chen
Raymond Chen

Back in the old days, if you wanted to call a function from inside the debugger, you had to do it by hand: Save the registers, push the parameters onto the stack (or into registers if the function uses or ) push the address of the function, move the instruction pointer to the start of the function you want to call, then hit "g" to resume executi...

Code
Apr 20, 2007
Post comments count0
Post likes count0

The format of bitmap resources

Raymond Chen
Raymond Chen

The next entry in the continuing sporadic series on resource formats is the bitmap. You thought accelerator tables were simple; bitmaps are even simpler. A bitmap resource takes the same form as a file, except that there is no . That's all.

Code
Apr 18, 2007
Post comments count0
Post likes count0

Psychic debugging: Why you can't control page navigation when using PSP_DLGINDIRECT

Raymond Chen
Raymond Chen

Here's a problem that floated past a few years ago. We switched our wizard from using dialog resource IDs to using because [reasons deleted since they aren't important]. But once we did that, the Next button doesn't work! Anybody have any ideas what's going on? I made things a little easier by deleting the information that isn't relevant to the...

Code
Apr 12, 2007
Post comments count0
Post likes count0

What is the default version of the shell common controls?

Raymond Chen
Raymond Chen

It depends on what you mean by default. As we saw earlier, the convention for Windows header files is that if you don't specify a particular version, then you get the most recent version. The shell common controls header file follows this convention, so if you include the Windows XP version of , you get functions, messages, and structures de...

Code
Apr 11, 2007
Post comments count0
Post likes count0

What's the difference between WINVER, _WIN32_WINNT, _WIN32_WINDOWS, and _WIN32_IE?

Raymond Chen
Raymond Chen

Okay, so there are all these different ways you can specify what version of the Windows header files you want.† Let's take them in order. The symbol is the earliest one. That's the symbol that 16-bit Windows used to control the versioning of its header files, and its use carried forward into the 32-bit header files, presumably from t...

Code
Apr 10, 2007
Post comments count0
Post likes count0

What is the default version of a header file?

Raymond Chen
Raymond Chen

The general rule with Windows header files is that if you don't specify which version of the header file you want, you get the latest version. For example, if you have the Windows XP Platform SDK header files and you , you're going to get the Windows XP function prototypes, the Windows XP structures, the the Windows XP flags, a...

Code
Apr 9, 2007
Post comments count0
Post likes count0

Why doesn't the taskbar return to its original size when I return my settings to their original values?

Raymond Chen
Raymond Chen

Commenter Gareth asked why, when the system metrics change and the taskbar changes size to match, the taskbar doesn't return to its original size when the metrics return to their previous values. Because the taskbar doesn't remember the path of changes that led to its current state. It just knows its current state. Let's say the taskbar is 30 pi...

Code
Apr 5, 2007
Post comments count0
Post likes count0

Why can't I display a tooltip for a disabled window?

Raymond Chen
Raymond Chen

Here's a question that floated past my field of view some time ago: When the mouse hovers over a disabled window, the tooltip associated with that window does not appear. Why is this? Why isn't this documented in MSDN? Actually, you already know the answer, and it is documented. You just have to connect the dots. When a window is disabled, it d...

Code
Mar 29, 2007
Post comments count0
Post likes count0

The buffer size parameter to GetFileVersionInfo is the size of your buffer, no really

Raymond Chen
Raymond Chen

The function takes a pointer to a buffer () and a size (), and that size is the size of the buffer, in bytes. No really, that's what it is. The application compatibility folks found one popular game which wasn't quite sure what that parameter meant. The programmers must have thought it meant "The size of the version resources you want to loa...

Code