Showing results for February 2004 - The Old New Thing

Feb 27, 2004
Post comments count0
Post likes count0

The correct order for disabling and enabling windows

Raymond Chen
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
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
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
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
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 count1

Raymond's comment policy

Raymond Chen
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
Feb 19, 2004
Post comments count0
Post likes count1

Sorry the posts are late lately

Raymond Chen
Raymond Chen

Somehow the server is in a wonky state and my autopilot script that posts a new article at 7 every morning is getting error 500 back (internal server error). So I'm posting manually for the nonce. Expect erratic posting times until the problem is resolved.

Non-Computer
Feb 19, 2004
Post comments count0
Post likes count1

No code is an island

Raymond Chen
Raymond Chen

Norman Diamond noted in a comment that on Windows 2003 Server, the Display Adapter Troubleshooting slider still lists "full acceleration" as the recommended setting even though the default for Server is "full minus one". This is one of those "Oh, that's an easy change" bugs. The discussion probably went like this: Some guy whose idea this was...

History