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
- 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:
-
http://www.pocketpcdn.com/sections/today.html
Section: Today
-
http://www.pocketpcdn.com/articles/changetodaytheme.html
QA: How to install a Today theme file?
- http://www.microsoft.com/mobile/developer/technicalarticles/todayapi.asp
Article: Using the Today API
- http://www.cshonline.com/pocketpc/#ProgrammingAdvice
Article: Today Screen Programming Advice
- http://www.microsoft.com/mspress/books/sampchap/5461a.asp#100
Article: Writing a Custom Today Screen Item
- http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnroad/html/road09122001.asp
Article: Two for the Road: Today the Pocket PC, Tomorrow the World!