Our
scratch program
sets the background color to
by setting the class background brush as follows:
What's with the ?
Okay, first of all, let's backtrack a bit.
The real first question is,
"What's the deal with taking an integer ()
and casting it to a and expecting anything sane
to happen?"
The window manager wants to provide multiple w...
Suppose you have a program that is part of your workflow,
and it has the annoying habit of showing a message box
when it is finished.
You want to automate this workflow,
and part of that automation is dismissing the message box.
Let's start by writing the annoying program:
This annoying program pretends to do work for a little while,
and then...
Suppose you want your program to behave differently depending on whether it is launched from the Start menu, or by clicking the pinned icon on the taskbar, or by Scheduled Task, or from a service, or whatever. How can a program detect and distinguish these scenarios?
The answer is you don't. And you shouldn't try.
Instead of trying to guess how y...
Somebody with a rude name wonders what the flag does.
It does nothing.
The flag was introduced when porting the Windows 95 shell to Windows NT. It happened further back in history than I have permission to access the Windows source code history database, but I can guess how it got introduced.
One of the things that the porting team ...
If you have a string like , and you render it on an Arabic system, you might get ٠١٢٣٤ABCDE67890. The leading digits are rendered as Arabic-Indic digits, but the trailing digits are rendered as European digits. What's going on here?
This is a feature known as contextual digit substitution. You can specify whether Euro...
Today's Little Program logs the contents of every message box dialog,
or anything that vaguely resembles a message box dialog.
(Since there's no way for sure to know whether a dialog box is
a message box or not.)
This is the same pattern as the program we wrote last week,
but with different guts when the window opens.
This time, we see if the...
Say you have a collection of programs which work together. One of them is the "master" program that runs the show, and it has a bunch of "assistant" programs that it launches to accomplish various subtasks. These assistants are not meant to be run by themselves; they are meant to be run only by the master program. How do you design the assistant so...
A customer wanted to know how they could write a program that automatically checked and unchecked the box that appears on a file's property sheet on the General tab, clicking the Advanced button, and then checking or unchecking the item whose name keeps changing:
The checkbox maps to the file attribute formally known as , and informally known as...
If you create a static control with initial contents
(for example, by creating a or
control in a dialog template),
then the static control will load the contents upon
creation and destroy the contents upon destruction.
So at least in the case where you don't touch the
static control, things will work automatically.
But once you touch it, thing...