Answers to exercises from Scrollbars Part 10
Answers to exercises from Scrollbars Part 10.
Answers to exercises from Scrollbars Part 10.
When your window is resized, Windows uses the message to determine where your window's client area lives inside your window rectangle. There are two forms of the message. The simple form merely takes a window rectangle and returns a client rectangle. This is useful for resizing a window to h...
When a document is displayed with scrollbars, the metaphor is that the window is a viewport onto the entire document, only a portion of which is visible at the moment. The default behavior of a resize, however, is to maintain the origin at the upper left corner of the client area, which breaks the metaphor when...
Another common question: "How do I find out where my program is? I want to be able to access support files in that same directory." Answer: GetModuleFileName(NULL, ...).
Occasionally, I'm asked, "I have to identify strings that are identical, case-insensitively. How do I do it?" The answer is, "Well, it depends. Whose case-mapping rules do you want to use?" Sometimes the reply is, "I want this to be language-independent." Now you h...
The great thing about timestamps is that there are so many to choose from.
The method described in the previous coding blog entry works great if you are using the window visibility state to control painting, since you're using the paint system itself to do the heavy lifting for you. To obtain this information outside of the paint loop, use and . The HDC that...
Sometimes you want to perform an activity, such as updating a status window, only as long as the window is not covered by another window. The easiest way to determine this is by not actually trying to determine it. For example, here's how the taskbar clock updates itself: ...
I get called on frequently to do troubleshooting, so I figure I'd share some entries from my private bag of tricks. (And there are some remarks for programmers hidden here too.) Problem 1. A folder like opens each time you log on. Reason: Your system contains two ...
Windows XP ships with a number of icon overlays. The black clock is particularly baffling because you sometimes see it even if your system is not equipped with Hierarchical Storage Management. When this happens, it's because some program (typicall...