Showing tag results for Code

May 7, 2007
Post comments count0
Post likes count1

Drag and drop is a general purpose transfer model, not exclusive to Explorer directories

Raymond Chen

If you've designed your program so that it assumes that the the only thing a user can use drag/drop for is dropping your object into a file system directory, then you've already lost. piers wants to be able to determine the destination of a drag/drop operation. From the description, it appears that what piers really wants is the destination path,...

Code
May 4, 2007
Post comments count0
Post likes count1

How my lack of understanding of how processes exit on Windows XP forced a security patch to be recalled

Raymond Chen

Last year, a Windows security update got a lot of flack for causing some machines to hang, and it was my fault. (This makes messing up a demo at the Financial Analysts Meeting look like small potatoes.) The security fix addressed a category of attacks wherein people could construct shortcut files or other items which specified a CLSID that was neve...

Code
May 2, 2007
Post comments count0
Post likes count1

The old-fashioned theory on how processes exit

Raymond Chen

Life was simpler back in the old days. Back in the old days, processes were believed to be in control of their threads. You can see this in the "old fashioned" way of exiting a process, namely by exiting all the threads. This method works only if the process knows about all the threads running in it and can get each one to clean up when it's time ...

Code
Apr 30, 2007
Post comments count0
Post likes count1

The default verb is not necessarily "open"

Raymond Chen

If you hunt around the Internet you'll find lots of people† who hard-code the string as the second parameter to the function, indicating that they want to open the document specified as the third parameter. While that's a nice thing to want to do, it might not be the right thing. When the user double-clicks a document, the shell executes ...

Code
Apr 27, 2007
Post comments count0
Post likes count1

Stupid debugger tricks: Calling functions and methods

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 count1

The format of bitmap resources

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 count1

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

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 count1

What is the default version of the shell common controls?

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 count1

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

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 count1

What is the default version of a header file?

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