QA: How to install/uninstall a Today plug-in?

Joao Paulo Figueira (joao.fig@mail.telepac.pt), May 22, 2003.

Question

How do I programmatically install or remove a Today item plug-in?

Answer

Today plug-ins or Items, as Microsoft calls them, are DLLs stored in the \Windows directory. Let's assume you have a Today Item to install. It is implemented in the today_sample.dll file, and its name is 'Sample Item'. To install it, do the following:

Install

  1. Copy the today_sample.dll file to the \Windows directory.
  2. Create a registry key under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Today\Items with the name of your item (Sample Item).
  3. Under this key, create the following DWORD values: Type=4, Enabled=1, Options=1 (0 if the DLL does not support the Options dialog).
  4. Under the same key, create the SZ value: DLL=\Windows\today_sample.dll.
  5. Use the magical touch: SendMessage(HWND_BROADCAST, WM_WININICHANGE, 0xF2, 0);.

The Today Item should be visible in the Today screen.

Uninstall

Removing the Today Item is simpler:

  1. Delete the key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Today\Items\Sample Item.
  2. Use the magical touch: SendMessage(HWND_BROADCAST, WM_WININICHANGE, 0xF2, 0);
  3. Now, you may be able to delete the today_sample.dll file. If the system refuses to delete the file, wait for a little while before trying again (it may still be open and locked by the operating system).

That's it!

Related resources: