想学些Sidebar Gadget编程,发现网上相关的资料太少了,基本上都是入门教程,连个参考手册都没有。于是把MSDN上的资料整理一下,列出Sidebar Gadget可用的系统对象及相关的属性和函数:
System.Contact Object
System.ContactManager Object
System.Debug Object
System.Diagnostics.EventLog Object
System.Environment Object
System.Gadget Object
System.Gadget.Flyout Object
System.Gadget.Settings Object
System.Gadget.Sidebar Object
System.Gadget.SideShow Object
System.Machine Object
System.Machine.CPU Object
System.Machine.PowerStatus Object
System.MessageStore Object
System.MessageStoreFolder Object
System.MessageStoreMessage Object
System.Network.Wireless Object
System.Shell Object
System.Shell.Folder Object
System.Shell.Item Object
System.Shell.RecycleBin Object
System.ShellDrive Object
System.Sound Object
System.Time Object
System.Time.TimeZone Object

下面是具体信息和用法:

System.Contact Object

________________________________________
Enables a Microsoft Windows Sidebar gadget to determine the attributes associated with the store of personal contacts. Once an object is created with System.ContactManager.Contacts, that object's information can be read with the associated System.Contact attributes.

 

Property
city
country
defaultEmail
displayName
filePath
homePhone
mobilePhone
pobox
postalCode
state
street
workPhone

 

System.ContactManager Object

________________________________________
Enables a Microsoft Windows Sidebar gadget to retrieve information from the store of personal contacts, from a single index location within the store, and returned as an object which can be used with the System.Contact object and methods.
 
Collection
System.ContactManager.Contacts

 

 

System.Debug Object

________________________________________
Exposes a method that allows for debugging functionality of a running Microsoft Windows Sidebar gadget by outputting strings containing debugging information.

 

Method
outputString

 

System.Diagnostics.EventLog Object

________________________________________
Returns the contents of the specified Event Viewer event log.

 

Method
writeEntry(strEventLogEntry [, strEventType])

 

System.Environment Object

________________________________________
Used to derive environment information regarding the user's current session in which Microsoft Windows Sidebar is running. Any value that can be viewed using the Microsoft? disk operating system (DOS) SET command from inside of a CMD.EXE shell can be obtained with this interface.

 

Property
machineName

Method
getEnvironmentVariable(strEnv)

 

System.Gadget Object

________________________________________
Defines methods, events and properties that are used to identify and specify gadget configuration options within the Microsoft Windows Sidebar environment.

 

Property
background
docked
name
opacity
path
platformVersion
version

Event
onDock
onSettingsClosed
onSettingsClosing
onShowSettings
onUndock

Method
beginTransition
close
endTransition

 

System.Gadget.Flyout Object

________________________________________
Used within a Microsoft Windows Sidebar gadget to determine flyout prompt properties.
 
Property
document
file
show

 

Event
onHide
onShow

 

System.Gadget.Settings Object

________________________________________
This object and its methods are used to see if there are stored settings for the gadget, such as when settings are checked and loaded that were previously saved from an earlier session of a particular gadget instance.

 

Method
read
readString
write
writeString

Property
settingsUI

 

System.Gadget.Settings.ClosingEvent Object

________________________________________
Defines properties and methods that are used to identify and specify cancellation handlers for the gadget settings process.

 

Property
action
cancel
cancellable
closeAction

 


System.Gadget.Sidebar Object

________________________________________
This object contains properties and events that allow a gadget to customize its behavior to the Microsoft Windows Sidebar. For instance, the user can place the Sidebar on the left side of the screen, and a gadget developer can instead opt to implement left-aligned graphics.

 

Event
onDockSideChanged

Property
dockSide

 

System.Gadget.SideShow Object

________________________________________
Allows gadget script code to provide and retrieve information applicable to the SideShow information appliance on portable devices, including text and images.

 

Event
applicationEvent

Method
addImage
addText
remove
removeAll
setFriendlyName

Property
enabled

 

System.Machine Object

________________________________________
Exposes properties used to determine the characteristics associated with the processor hardware and memory configuration of the physical machine on which Microsoft Windows Sidebar is running the current gadget.

 

Collection
System.Machine.CPUs

Property
availableMemory
processorArchitecture
totalMemory

 

System.Machine.CPU Object

________________________________________
Exposes properties used to determine the characteristics associated with the central processing units of the machine hosting the gadget.

 

Property
name
usagePercentage

 


System.Machine.PowerStatus Object

________________________________________
Enables the ability within a Microsoft Windows Sidebar gadget to determine power characteristics of the current machine. Detects whether or not a battery is actually present (or detectable) in the system, but only if the system is not currently on AC power. The AC power state is mutually exclusive to the battery state.

 

Event
powerLineStatusChanged

Property
batteryCapacityRemaining
batteryCapacityTotal
batteryPercentRemaining
batteryStatus
enumBatteryStatus
isBatteryCharging
isPowerLineConnected

 

System.MessageStore Object

________________________________________
Enables the ability within a Microsoft Windows Sidebar gadget to determine folder characteristics of a given folder within the system message store.

 

Collection
Folders

 

System.MessageStoreFolder Object

________________________________________
Enables the ability within a Microsoft Windows Sidebar gadget to determine message characteristics, given a folder in the system's message store.

 

Collection
System.MessageStoreFolder.Messages

 

System.MessageStoreMessage Object

________________________________________
Enables properties for a Microsoft Windows Sidebar gadget that determine the properties associated with the store of personal contacts. Once an object is created with System.MessageStoreFolder.Messages, that object can be used with the associated System.MessageStoreMessage properties.

 

Property
body
from
subject
to

 


System.Network.Wireless Object

________________________________________
This object's properties and events allow a gadget to discover wireless network interface settings on the Microsoft Windows system currently running the gadget.

 

Event
connectionChanged
signalStrengthChanged

Property
address
ipv6Address
primaryDNSAddress
secureConnection
signalStrength
ssid

 

System.Shell Object

________________________________________
Enables the ability within a Microsoft Windows Sidebar gadget to use properties and objects from the Windows shell.

 

Method
chooseFile
chooseFolder
drive
execute
itemFromFileDrop
itemFromPath
knownFolder
knownFolderPath
refreshDesktop
saveFileDialog

 

System.Shell.Folder Object

________________________________________
Provides a means to programmatically allow a Microsoft Windows Sidebar gadget to mimic Windows Explorer file management operations, such as copying, moving, and obtaining item information within folders.

 

Collection
System.Shell.Folder.Items

Method
copyHere
moveHere
newFolder
parse

Property
Parent
Self

 

System.Shell.Item Object

________________________________________
Enables properties to use with a System.Shell.Folder.System.Shell.Folder.Items object to determine a shell item's characteristics.

 

Method
invokeVerb
metadata

Property
isFile
isFileSystem
isFolder
isLink
link
modifyDate
name
path
SHFolder
size
type

 

System.Shell.RecycleBin Object

________________________________________
Allows a Microsoft Windows Sidebar gadget to determine the Recycle Bin behaviors and settings (for example, file count and folder count).

 

Event
onRecycleBinChanged

Method
deleteItem
emptyAll
showRecycleSettings

Property
fileCount
folderCount
sizeUsed

 

System.ShellDrive Object

________________________________________
Enables a Microsoft Windows Sidebar gadget to gain access to properties and methods associated with an instance of a drive object, previously created with the System.Shell.drive method, for use within a Sidebar gadget script. Drive characteristics of the retrieved object (for example, type of drive, or volume label) can be determined.

 

Property
driveFormat
driveLetter
driveType
freeSpace
isReady
rootDirectory
totalFreeSpace
totalSize
volumeLabel

 

System.Sound Object

________________________________________
Allows a gadget to determine sound characteristics such as volume and the location from which a sound file should be played.

 

Method
beep
playSound

 

System.Time Object

________________________________________
Allows a gadget to determine time standards based on characteristics of the system.
 
Collection
System.Time.TimeZones

 

Method
getLocalTime

Property
currentTimeZone

 

System.Time.TimeZone Object

________________________________________
Represents a time zone object from a collection.

 

Property
bias
displayName
DSTBias
DSTDate
DSTName
name
standardBias
standardDate
STDName

posted on 2007-04-05 20:32  小生杂谈  阅读(5402)  评论(2编辑  收藏  举报