| home | support |contact | forum | |
| Zhorn Software | |
|
API Commands
Text in <angle brackets> is a parameter - in a command, it will need to be filled in when the command is sent. In a return value, it will change according to the current state of Stickies. There are very many commands and events which Stickies could respond to, and send. The set below is quite incomplete. Adding a new command to the API is a simple task, but rather than code in potentially several hundred routine, most of which will never get used, instead if your application needs something which is not here, let me know, I can add it, and get an updated executable to you for development.
do ping Check a connection to Stickies Return values
000 pong Remarks Check that you are able to send commands to, and receive a reply from Stickies. This command will have no other effect on Stickies. If the client has successfully registered for events with Stickies, then the second return string will be recieved. Otherwise it will be the former.   do new sticky <text> Create a new sticky, with the default style Return values
000 OK created: <uniqueid> Remarks With no content specified, a new blank sticky is created. Otherwise, the sticky will have the contents specified at the end of the command. The sticky id is supplied in the reply, so that additional attributes can be set if required.   do manage open Open the Manage dialog Return values
000 opened Remarks Open the Manage dialog   do manage close Close the manage dialog Return values
000 closed Remarks Close the manage dialog   do stickymenuadd <command> <menu text> Add an item to the right-click menu of each sticky which generates an API event when clicked Return values
000 added Remarks Create a hook back to your code from a sticky with this command. The menu text you supply will be added as an item to the bottom of each sticky menu, and when the user selects that menu item, an event with the code "command" as specified here is sent to all API clients which have registered for events. The command has the identifier of the sticky for which the user caused the menu to show in it. If the command specified already exists as a menu in Stickies, no changes are made, and the error is returned.   do stickymenudel <command> Remove an item previously added to the right-click menu of each sticky Return values
000 removed Remarks Removes a menu command previously added by the "do stickymenuadd" command. As the item has then been removed, it can no longer be clicked by the user, so no more events with the specified code will be received.   do stickiesmenuadd <command> <menu text> Add an item to the task-tray menu of Stickies which generates an API event when clicked Return values
000 added Remarks Create a hook back to your code from Stickies with this command. The menu text you supply will be added as an item to the main Stickies menu, and when the user selects that menu item, an event with the code "command" as specified here is sent to all API clients which have registered for events. If the command specified already exists as a menu in Stickies, no changes are made, and the error is returned.   do stickiesmenudel <command> Remove an item previously added to the task-tray menu of Stickies Return values
000 removed Remarks Removes a menu command previously added by the "do stickiesmenuadd" command. As the item has then been removed, it can no longer be clicked by the user, so no more events with the specified code will be received.   set skin <pathname> Set the Stickies skin to be the file specified Return values
000 set Remarks The Stickies skin is set to the pathname in the command, and all stickies are refreshed with the new look. The skin can be either an ini file, or a ssk. A failure will mean the default skin is loaded, and the 997 error message returned.   get skin Get the loaded Stickies skin file Return values
001 <skinfile_path> Remarks Return the path to the currently loaded skin. If this is blank, then the default skin is loaded.   get version Get the version of Stickies which is running Return values
001 <version> Remarks Return the Stickies version, in the format "Stickies vX.XX"   get desktop <uniqueid> title Get the title of the specified desktop sticky Return values
001 <current title> Remarks Return the title of the specified desktop sticky   get desktop <uniqueid> source Get the source of the specified desktop sticky Return values
001 <current source> Remarks Return the source of the specified desktop sticky   get desktop <uniqueid> colour Get the colour of the specified desktop sticky Return values
001 <red,green,blue> Remarks Return the colour of the specified desktop sticky. The returned string is three comma-separated numbers which give the red, green and blue values.   get desktop <uniqueid> text Get the contents of the specified desktop sticky Return values
001 <text> Remarks Return the text of the specified desktop sticky. The returned string is plain text, and contains no formatting   get desktop <uniqueid> position Get the screen location of the specified desktop sticky Return values
001 <x,y> Remarks Return the location in virtual screen co-ordinates of the specified desktop sticky. This means that one or both of the values may be negative.   get desktop <uniqueid> size Get the dimensions of the specified desktop sticky Return values
001 <231x89> Remarks Return the size in pixels of the specified desktop sticky. If the sticky is rolled, the current height of the just the title bar is returned, not the full height when the sticky is unrolled.   set desktop <uniqueid> title <title> Set the title of the specified desktop sticky Return values
000 title set Remarks Set the title of the specified desktop sticky   set desktop <uniqueid> source <source> Set the source of the specified desktop sticky Return values
000 source set Remarks Set the source of the specified desktop sticky   set desktop <uniqueid> colour <red,green,blue> Set the colour of the specified desktop sticky Return values
000 colour set Remarks Set the colour of the specified desktop sticky. The colour should be in the format red,green,blue   set desktop <uniqueid> text <text> Set the contents of the specified desktop sticky Return values
000 text set Remarks Set the contents of the specified desktop sticky. The input is plain text.   set desktop <uniqueid> position <x,y> Set the contents of the specified desktop sticky Return values
000 text set Remarks Set the contents of the specified desktop sticky. The input is plain text.   get list desktop Get a list of unique ids of the stickies currently active on the desktop Return values
002 <uniqueid,uniqueid,uniqueid...> Remarks The id of each desktop sticky is separated by a comma. The list is terminated with a comma. Desktop stickies are those which appear in the Desktop category in the Manage dialog.   do register Request notification of events within Stickies Return values
000 will send events your way Remarks The command adds the calling application to the list of windows to which Stickies will send a notification when an event within Stickies occurs. A list of events can be found here. The calling application must fill in the window handle parameter of the SendMessage Windows API call, so that Stickies can send events to that window when they occur. If at any point Stickies tries to send a message to your application and fails, then it will be removed from its list of API clients.   do deregister Cease sending of events Return values
000 no more events will be sent Remarks No more events will be sent from Stickies to your application. Making this call as your application exits is neat, but not essential, as Stickies will stop trying to send events once it's tried to do so once and failed.   Other commandsThe above list is certainly not complete. There are very many other attributes and commands which Stickies can handle. I've only implemented the above set of commands so that you can check out the API. The following list of potential commands gives an idea of why I've not coded them all into the app yet - each routine is a simple quick thing to write, but it would take a while to get them all done, and many would never be used.So, if you've looked at the API, and think you can use it, and would like access to more Stickies internals, drop me a line, I can add the commands you're interested in and send you an updated exe. Potential commands
| |
| © Tom Revell 2007 | |