Showing archive results for 2004

Mar 2, 2004
Post comments count0
Post likes count0

Went to a Seattle Thunderbirds game this weekend

Raymond Chen

This past weekend I fell into tickets to a Seattle Thunderbirds game. (The Seattle Thunderbirds belong to the "U.S. Division" of the otherwise-Canadian Western Hockey League, one of the three Major Junior Leagues.) I hadn't been to a hockey game since my college days. It was quite enjoyable and I may very well do it again. On the messa...

Non-ComputerThe wisdom of seventh graders
Mar 2, 2004
Post comments count0
Post likes count1

Why are HANDLE return values so inconsistent?

Raymond Chen

If you look at the various functions that return s, you'll see that some of them return (like ) and some of them return (like ). You have to check the documentation to see what each particular function returns on failure. Why are the return values so inconsistent? The reasons, as you may suspect, are historical. The values were chosen to be c...

History
Mar 1, 2004
Post comments count0
Post likes count2

Why 16-bit DOS and Windows are still with us

Raymond Chen

Many people are calling for the abandonment of 16-bit DOS and 16-bit Windows compatibility subsystems. And trust me, when it comes time to pull the plug, I'll be fighting to be the one to throw the lever. (How's that for a mixed metaphor.) But that time is not yet here. You see, folks over in the Setup and Deployment group have gone and visi...

History
Feb 27, 2004
Post comments count0
Post likes count0

The correct order for disabling and enabling windows

Raymond Chen

If you want to display modal UI, you need to disable the owner and enable the modal child, and then reverse the procedure when the modal child is finished. And if you do it wrong, focus will get all messed up. If you are finished with a modal dialog, your temptation would be to clean up in the following order: But if you do that, you'll...

Code
Feb 26, 2004
Post comments count0
Post likes count1

Why do timestamps change when I copy files to a floppy?

Raymond Chen

Floppy disks use the FAT filesystem, as do DOS-based and Windows 95-based operating systems. On the other hand, Windows NT-based systems (Windows 2000, XP, 2003, ...) tend to use the NTFS filesystem. (Although you can format a drive as FAT on Windows NT-based systems, it is not the default option.) The NTFS and FAT filesystems store times...

HistoryTime
Feb 25, 2004
Post comments count0
Post likes count0

Why can't I put hotlinks in notification icon balloon tips?

Raymond Chen

The short answer: "Because there is no NIF_PARSELINKS flag." The long answer: When balloon tips were first developed, there was no ability to embed links. Consequently, programs were free to put insecure text in balloon tips, since there was no risk that they would become "live". So, for example, a virus scanner might say "The document 'XYZ' has...

History
Feb 24, 2004
Post comments count0
Post likes count0

What's so special about the desktop window?

Raymond Chen

The window returned by GetDesktopWindow() is very special, and I see people abusing it all over the place. For example, many functions in the shell accept a window handle parameter to be used in case UI is needed. IShellFolder::EnumObjects, for example. What happens if you pass GetDesktopWindow()? If UI does indeed need to be displaye...

Code
Feb 23, 2004
Post comments count0
Post likes count0

Invalid thread and process IDs

Raymond Chen

Perhaps you want a value to use as a sentinel, which you want to be guaranteed is never a valid thread ID or process ID. What values can you use? Nothing is explicitly written about this topic, but you can put on your logic cap and figure it out. If you need an invalid thread ID, you can use zero. How do you know that zero is an invalid thr...

Code
Feb 21, 2004
Post comments count0
Post likes count3

Raymond's comment policy

Raymond Chen

Okay, I was hoping it wasn't going to be needed but it takes only one bad apple... Here are the ground rules. Things that increase the likelihood that your comment will be edited or deleted: If a wave of comment spam is under way, I may choose to moderate or even close comments until the problem subsides. More rules may be added later, but ...

Non-Computer