today Plugins with compact framework
The following today or home screen plugins for Windows Mobile are based on a work of CrisText at codeplex.
The codeplex sources provide a framework to create home screen plugins very easily.
You just start a Form or UserControl and add the attribute “[TodayScreenItem("a unique name")]” before the class. Further on, the framework looks for such plugins dynamically and you can add or remove plugins by just adding or removing DLLs.
I did two plugins, one shows the Intermec device ID and the other enables you to have buttons on the home screen to directly launch applications.
Show some information
The first plugin is very simple. An user control that just shows some static text (see the lower info on the screen shot):
public partial class todayDeviceID : UserControl
private Label label1;
private PictureBox pictureBox1;
int w = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Width;
int h = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Height;
int factor = w / this.Width;
this.Width = w;
this.Height = this.Height * factor;
this.pictureBox1.Height = this.Height - (pictureBox1.Top*2);
pictureBox1.Width = pictureBox1.Height;
label1.Width = this.Width - pictureBox1.Width;
label1.Height = this.Height;
label1.Text = ITC_DeviceID.getDeviceID();
The above simply has a label and a picturebox on a user control.
To get the above working on your device you must install the ChrisTec.WindowsMobile.TodayScreen cab file or at least the files:
And you must register the today plugin framework:
"DLL"="%CE1%\\Managed Today Screen Framework\\ManagedTodayScreenItem.dll"
All files should be placed inside “\Program Files\Managed Today Screen Framework\”.
Debug and deployment
You should setup your plugins to be deployed to the above directory. So you can easily update and test your plugins. Unfortunately you can not replace any existing plugin as long as Managed Items are enabled in Home screen settings. So I added a project and application that works similar to the plugin framework loader. You may use testPlugin to test and debug your plugin:
Then test your plugin by Start-Settings-Home:Items and enabling “Managed Items”:
If everything is correct, you will see your plugin on the home screen.
The other plugin I wrote is a program launcher. I started another Control Library SmartDevice project. Just add the attribute to let the framework know that this is another plugin:
public partial class todayApp1 : UserControl
theApps apps = new theApps();
allApps = apps.myAppList.ToArray();
The above uses a class to determine the application buttons to create. This theApps class uses a xml file to let you define launcher buttons:
<title>The File Explorer</title>
<iconFile>\Program Files\managed today screen framework\fexplore.gif</iconFile>
<iconFile>\Program Files\managed today screen framework\iexplore.gif</iconFile>
You can see that you can define the exe to start, arguments for the exe, a title and a symbol.
The todayApp user control adds buttons dynamically and will show a scroll bar if more than 4 apps are defined.
Now start your own home screen plugin the easy way.
Source code at: https://github.com/hjgode/todayPlugins
<!-- Social Bookmarks BEGIN -->
<!-- Social Bookmarks END -->