developing windows vista gadgets isdc workshop, november 9 th 2007. mark blomsma software architect...
Post on 22-Dec-2015
213 views
TRANSCRIPT
Developing Windows Vista gadgets
iSDC Workshop, November 9th 2007.
Mark BlomsmaSoftware architect Develop-One
© 2007 Develop-One 2
Agenda
Introduction Objectives Basic development cycle Demo Progamming gadgets Settings and gadgets Security Demo
08-nov-2007
© 2007 Develop-One 3
Mark Blomsma
Professional developer since 1992 Microsoft Certified Professional
(MCP) Microsoft Most Valuable Professional
(MVP) for four years running Author, Speaker & Software
Architect at Develop-One
Instructor for DevelopMentor
08-nov-2007
© 2007 Develop-One 4
Objectives
Know how to develop a gadget Basics Settings page
Know how to deploy a gadget
08-nov-2007
© 2007 Develop-One 5
Basic development cycle
Create an HTML page Create gadget manifest (XML) Zip files & Rename to .gadget Install Test Loop:
Close, Fix, Install & Test
08-nov-2007
© 2007 Develop-One 6
Gadget HTML design
Sidebar is 130px wide Minimum height for a gadget is
57px This is the height of the button panel
08-nov-2007
© 2007 Develop-One 7
Gadget Tags
Additional HTML tags g:background g:image g:text
08-nov-2007
© 2007 Develop-One 8
gadget.xml
08-nov-2007
<?xml version="1.0" encoding="utf-8" ?><gadget> <name>XDriveInfo</name> <namespace>DevelopOne.Windows.Vista.Gadgets</namespace> <version>1.1.0.0</version> <author name="Mark Blomsma, Develop-One."> <info url="http://www.develop-one.com" /> <logo src="logo.png" /> </author> <copyright>© 2007, Develop-One</copyright> <!-- The description displays in the Gadget Tile window when the Gadget is selected --> <description>XDriveInfo display the amount of free space available on your AOL
XDrive.</description> <icons> <icon height="48" width="48" src="icon.png" /> </icons> <hosts> <host name="sidebar"> <base type="HTML" apiVersion="1.0.0" src="XDriveInfo.html" /> <permissions>Full</permissions> <platform minPlatformVersion="1.0" /> </host> </hosts></gadget>
© 2007 Develop-One 9
Installation
Double click a .gadget file Installed in:
c:\users\<name>\appdata\microsoft\windows sidebar\gadgets
08-nov-2007
© 2007 Develop-One 10
Demo
Build an ‘Hello World!’ gadget.
08-nov-2007
© 2007 Develop-One 11
Quiz
What is the correct filename for the gadget manifest:
A. gadget.manifestB. gadget.xmlC. gadget.zip
08-nov-2007
© 2007 Develop-One 12
Programming
HTML JavaScript
‘alert(..)’ is disabled
DHTML CSS Images
ActiveX controls Silverlight Adobe Flash (not
on x64)
Gadget Object Model
08-nov-2007
© 2007 Develop-One 13
Gadget Object Model
Events Dock, Undock Settings
Functionality System.Debug System.Diagnostic
s System.Environme
nt System.Gadget
Presentation g:background g:image g:text
08-nov-2007
© 2007 Develop-One 14
Settings
08-nov-2007
// wire up the settings pageSystem.Gadget.settingsUI = "settings.html";
// hook into closing eventSystem.Gadget.onSettingsClosing = settingsClosing;
// write a settingSystem.Gadget.Settings.write(“name", _name);
// read a setting_name = System.Gadget.Settings.read(“name");
© 2007 Develop-One 15
Settings.ini
Gadget settings are stored in:
c:\users\<name>\appdata\microsoft\windows sidebar\settings.ini
Warning: Gadget settings are not encrypted Gadget setting ARE accessible from
other gadgets using ActiveX.
08-nov-2007
© 2007 Develop-One 16
Security
All gadgets sit on the local machine and run in ‘Full trust’
User Account Control interaction Local Machine Zone security
configuration Group policies
Turn off Windows Sidebar Disable unpacking and installation of
unsigned gadgets Turn off user installed gadgets Override ‘More Gadgets’-link
08-nov-2007
© 2007 Develop-One 17
Demo
Add a settings page. Use ActiveX to read the settings.ini
file.
08-nov-2007
© 2007 Develop-One 18
Signing gadgets
08-nov-2007
© 2007 Develop-One 19
Gadget Resources
http://microsoftgadgets.com/build/ http://blogs.msdn.com/sidebar/ http://msdn2.microsoft.com/en-us/library/aa965853.aspx http://msdn2.microsoft.com/en-us/library/bb498012.aspx http://blogs.msdn.com/sidebar/archive/2006/08/31/733880.aspx http://www.pantaray.com/signcode.html http://blog.develop-one.com
08-nov-2007
© 2007 Develop-One 2008-nov-2007
www.develop-one.com
http://blog.develop-one.com