The Wonderful Icon

It's been YEARS since you updated this program! Is TWI dead?

Not at all! A new version (3.0) is under development and will eventually be released -- it's slowly aging like a fine cheese. In the mean time, there are hundreds of special abilities already built in to the program. A new website column, Tips and Tricks, will be updated every week (or three) to show you some of the neat lesser known features of the program.

If you have ideas or comments, I'd love to hear them. Your emails are the motivator that keeps me interested in updating the program.

What will be in the next version of the program?

The exact feature list is still being determined, but along with the usual batch of new commands, TWI 3.0 will also make some larger changes and improvements.

So what's the hold up? Well, the development is still far from complete, but another hold up is that I am waiting to get my hands on a copy of Windows Vista. Because this new Microsoft OS is so different from the previous OSes, extensive testing and updating might be required to make TWI work with Vista. I don't want to release the new version without being confident it will work on this OS.

You never answered my email! Are you dead?

Sorry about that. I did disappear for a couple of years there, and any email you sent during that time didn't reach me. But I'm back now! I still might not respond, due to a severe lack of time coupled with terrible laziness. But if you send suggestions or bug reports, I promise they'll end up on my "Potential Features" list for future consideration.

Why is your program called "The Wonderful Icon?"

The name has a long history -- the first version of the program was called "The Semi-Wonderful Icon". It ran under Windows 95, and was one of the first taskbar-tray-icon applications. This is what the "icon" in the title refers to. Eventually the program became completely wonderful, so I removed the "semi" from its name. Actually, the name is completely tongue-in-cheek: the first versions of the program used a horrible little icon that could barely be recognized as a flag, so the name was making fun of my inability to draw. Later, Mike Kujawa drew a much better flag for me, so the humor of the name is lost.

What are Document Windows? How do the "Document Window" commands differ from the "Main Window" commands?

Document Windows are used in some programs, such as some versions of Microsoft Word, to display documents. For instance, if you load several documents at once with Microsoft Word, or if you load several spreadsheets at once in Microsoft Excel, each document or spreadsheet will be displayed in its own Document Window. The Document Window commands work on the current program’s Document Windows instead of the program's Main Window. If the current program doesn't have any Document Windows, the command works on the Main Window instead.

Some of the confusion about Document Windows is my fault: before version 1.5, the Document Windows commands didn't work correctly in Microsoft Word or Microsoft Excel (but they worked correctly in other programs). In version 1.4D, I announced that this was fixed, but it was still partially broken. They all work now, with one exception: "Next Document Window" and "Previous Document Window" still don't work in Excel or Word (and are untested in the new upcoming Word 2007).

How can I configure The Wonderful Icon if I don't have a mouse?

Use the -C parameter. More specifically:

  1. Press Ctrl+Escape to bring up your Start Menu.
  2. Press the Up arrow key a few times until the “Run” item is selected.
  3. Now press Enter. The "Run" window will appear. (If you have one of the new keyboards with a "Windows" key on it, you can also press Windows+R to bring up the "Run" window.)
  4. Type "WONDERFL -C" (without the quotation marks) and press the Enter key. NOTE that WONDERFL doesn’t have a ‘U’ in it! (It is spelled this way for historical reasons: originally the name could only be eight letters long.)
Now The Wonderful Icon's configuration dialog should appear. Use the Tab key to move between the fields on the current page. Use Ctrl+Tab to switch to a different page. To get help about a particular field, press F1.

I need hotkeys for more than five custom programs! How do I get more?

(Referring to the "Start Program" hotkey: by default, there are five of these, and they can be configured to run any program.) If you need more than five of these, you will need to use the "Duplicate" command. This is an advanced feature, so go to the "Options" page of the configuration dialog and make sure the box next to the words "Show Advanced Features" is checked. Now go back to the Hotkeys page. There will be two buttons on this display, in a box labeled "Advanced:" the Duplicate button and the Delete button. Find one of your currently existing Start commands in the list, and click on it. Now press the "Duplicate" button. A new command should appear in the list, with all of the same information as the original command, but with "(2)" at the end of its name to indicate that it is a copy. Now click on the new command and change its command-line, starting directory, etc. as usual.

(If you want to remove this command, you can use the Delete button. Don't worry, you can never delete the last copy of a command. Thus, if you have only one copy of the "Do Nothing" command, for instance, you won't be able to delete it, but if you duplicate the "Do Nothing" command, you'll be able to delete one or the other copy of it.)

If seeing the Duplicate and Delete buttons bothers you, just go back to the "Options" page and un-check the "Show Advanced Features" box. (This just hides the buttons; any duplicates you've made using the buttons will still exist.)>

How do I hide the red flag icon in the taskbar tray?

This is a pretty advanced feature. It should only be attempted by people who are comfortable with command-line parameters and Windows shortcuts.

To stop the little flag from appearing in your taskbar-tray, you will need to start The Wonderful Icon with the -Q command-line parameter. (If The Wonderful Icon starts up automatically, you will need to alter the shortcut that appears in your StartUp folder.) Find that shortcut (it will probably be in C:\Windows\Start Menu\Programs\StartUp or something similar). Right-click on the shortcut and choose "Properties" from the menu that appears. Click on the "Shortcut" tab. At the end of text in the "Target" field, add a space, then -Q. The finished text might read like this:

"C:\program files\Wonderfl\wonderfl.exe" -Q

Now press Enter and restart your machine to see the effect.

I intentionally made this feature difficult to get to, because I don't want people accidentally hiding the icon and not being able to get it back. In fact, if you run WONDERFL.EXE again after it's been started up, it will un-hide its flag icon, even if the -Q parameter is specified. (If you really don't want to un-hide the icon, you can use -K, which means "Keep quiet.")

I know this is confusing, and I'm considering better methods that are both safe for inexperienced users and easy-to-explain for more experienced users. But for now, to recap: use the -Q parameter to hide the icon when you first run it. On subsequent runs, use -K to keep the icon hidden.

Another way of thinking of it is this: if you want the icon to always stay hidden, add both -Q and -K each time you run WONDERFL.EXE.

Is The Wonderful Icon Shareware? How do I pay for it?

The Wonderful Icon is not shareware; it is freeware, meaning that it is free. You never need to send any money to use this program. The program is not "public domain," however, so I retain the copyright on the program, and no one has the right to reverse-engineer it, alter it, sell it, etc. The program is also without any warranty of any kind: use it at your own risk.

Well, if you really want to send me money, I'd be happy to accept it ;) but more important are encouragements, bug reports, and ideas for new features. E-mail me at:

I'm a programmer who wants my program to minimize windows to the tray like The Wonderful Icon does. How do I do this?

There's no built-in way to do this; The Wonderful Icon does it via a long sequence of steps. There is only one API function that deals with the tray: Shell_NotifyIcon(). This function adds, removes, or updates an icon on the tray.
Explaining all the exact details is beyond the scope of this FAQ, but here’s a quick algorithm for minimizing programs to the tray (I'm preparing a more complete web page about this topic, which should be done in a month year or so):

  1. Find the HWND of the program you want to minimize to the tray. This is easy if you want to minimize your own program. If you want to minimize another program, you’ll need to figure a way to get its HWND. I can’t be much more specific than that, since each program will be different.
  2. Find the icon for the window you want to minimize. If you’re minimizing your own program, this should be easy to figure out. If you’re minimizing another program, you can use this algorithm to find the most appropriate icon. First, send it a WM_GETICON message, specifying FALSE for the WPARAM. This will return an HICON. If it returns NULL, it means that the window doesn’t process the message for small icons. As a second attempt, try sending it a WM_GETICON specifying TRUE for the WPARAM. If this also returns NULL, try a third method: call GetClassLong(hwindow, GCL_HICONSM). If this returns false, try GetClassLong(hwindow, GCL_HICON). If this too returns false, give up and load a default icon by calling LoadIcon(NULL, MAKEINTRESOURCE(IDI_APPLICATION)).

    hIcon = (HICON)SendMessage(hWin, WM_GETICON, FALSE, 0);
    if (hIcon == NULL)
    hIcon = (HICON)SendMessage(hWin, WM_GETICON, TRUE, 0);
    if (hIcon == NULL)
    hIcon = (HICON)GetClassLong(hWin, GCL_HICONSM);
    if (hIcon == NULL)
    hIcon = (HICON)GetClassLong(hWin, GCL_HICON);
    if (hIcon == NULL)

  3. Next, you must use the CopyIcon() API function to map a copy of the icon into your process’ address space. (Don’t forget to clean up this icon with DestroyIcon() when you’re finished with it!) [Currently, this step is only actually needed if you retrieve the icon via WM_GETICON, but the Microsoft documentation suggests that you should call it even if you retrieve the icon via GetClassLong(). I always call it, just to be on the safe side, unless I load the dummy icon via LoadIcon().] hTrayIcon = CopyIcon(hIcon);
  4. Hide the program's window using ShowWindow().
  5. Add the icon to the tray using Shell_NotifyIcon().
  6. If you want to, you can play the "minimize" sound using PlaySound(): PlaySound("Minimize", NULL, SND_ALIAS | SND_NODEFAULT);
    This isn't as important as it once was, since sound effects for things like minimizing and maximizing windows went out of vogue long ago. But it's nice to be thorough.
  7. When you receive a mouse-down message over the icon (you tell Shell_NotifyIcon() what message to send you when a mouse event occurs over the icon), "restore" the program by removing the tray icon, un-hiding the window, and playing the "Restore" sound if appropriate.
  8. When your program exits, don’t forget to "restore" all programs in the tray!

You'll probably need to tinker with it a bit to get the effect you want, but that's the basic algorithm.

Is the source code available?

No, though I may make it available in the future.