QA: How to install/uninstall a Today plug-in?
By Joao Paulo Figueira, May 22, 2003.
Print version
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
- Copy the today_sample.dll file to the \Windows directory.
- Create a registry key under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Today\Items with
the name of your item (Sample Item).
- Under this key, create the following DWORD values: Type=4, Enabled=1, Options=1
(0 if the DLL does not support the Options dialog).
- Under the same key, create the SZ value: DLL=\Windows\today_sample.dll.
- 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:
- Delete the key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Today\Items\Sample Item.
- Use the magical touch: SendMessage(HWND_BROADCAST, WM_WININICHANGE, 0xF2, 0);
- 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:
Discuss
Discuss this article.
Here you can write your comments and read comments of other developers.
|