Round_Watch (C) by Vlaimir Kladov, 2004

This fine looking round watch (no? well, our tastes are different a bit...) supports plugins. So, it is possible to write some extensions for it. E.g., controlling other windows via mouse clicks on tray icons and watcher face. Or, showing some diagrams over face watch (CPU load, Memory usage, Internet or network traffic). Or, adding watcher-specific functions: reminders, wake-up, visual time change, etc.

A plugin should be placed in the directory where Round_Watch program located. It should have a name *.dll, and it must have at least an entry Watcher_Ini:

****************************************************************************************
  procedure Watch_Ini( mainwnd: HWnd; mainpopupmenu, traypopupmenu: HMenu; 
DLLFileName: PChar ); stdcall;
****************************************************************************************

  mainwnd - a handle of the main window. Can be used to add some child windows if necessary. It is also possible to extend drawing procedure instead, using entry Watcher_Draw, see below.
  mainpopupmenu - a handle of the pop up menu, activated on right mouse click over the watcher face floating on the desktop. It is possible to use this handle to add some items to it.
  traypopupmenu - a handle of the pop up menu, activated on right mouse click over tray icons showing current time.
  DLLFilename - passed to a plugin and it can store this name for some purposes (e.g., it should know actual DLL name to call GetModuleHandle).

Other entries are optional. Mainly, those are event handlers, which are called in some specific cases, and it can extend watch behavior as defined in the plugin. All the plugins are sorted by its name, and all its functions are called from the first plugin to the last for each event. Be careful, do not use a lot of CPU and other resources while performing your functions.

****************************************************************************************
  procedure Watch_Timer( ); stdcall; 
****************************************************************************************
- called 10 times a second to perform some periodic checks if necessary.

****************************************************************************************
  function Watch_Draw( DC: HDC; Width, Height: Integer; BackColor, ForeColor, TrayColor: TColor; Stage: Integer ): Boolean; stdcall;
****************************************************************************************
- this entry is called in OnPaint procedure, when all painting is already done on the memory bitmap. Your entry can add some drawing over it, if necessary.
  Stage parameter in a call defines on which stage of drawing a plugin is called:
  0 - before draw;
  1 - after drawing face, but before drawing clock arrows;
  2 - after drawing face and clock arrows.
  If a function returns FALSE, following draw stage is skept (so, it is possible to replace correspondent stage in a plugin totally with your own).

****************************************************************************************
  function Watch_FaceMouseEvent( MouseEvent: Integer; ClientX, ClientY: Integer ): Boolean; stdcall;
****************************************************************************************
- this function is called before handling all the mouse events in the floating face watch. If FALSE is returned by the function, handling the event is continued, otherwise (TRUE returned) other handling stopped. Possible MouseEvent values are: WM_LBUTTONDOWN, WM_RBUTTONDOWN, WM_MBUTTONDOWN, WM_MOUSEMOVE, WM_MOUSEWHEEL.

****************************************************************************************
  function Watch_TrayMouseEvent( MouseEvent: Integer ): Boolean; stdcall;
****************************************************************************************
- this function is called before handling all the mouse events in the tray icons provided by the main window.

****************************************************************************************
  procedure Watch_Fin; stdcall; 
****************************************************************************************
- this entry is called when the application is about to finish. Place your finalization here if necessary.

****************************************************************************************
  procedure Watch_Translate( FromStr, ToStr: PChar ); stdcall; 
****************************************************************************************
- called to translate strings used in a plugin. Translations are loaded by the main program from special file Languages.ini depending on what Language is selected by a user. A plugin should not suppose that these calls are made only on initialisation, but at any time when the user selected another language from the main program menu. File Languages.ini should have following structure:
[LanguageName]
[PluginName].VerbName=Text
...

e.g.:

[English]
.About=&About
.Plugins=&Plugins
.Plugins.Wnd_Mover=Wnd_Mover
.Plugins.Wnd_Trayer=Wnd_Trayer
.View=&View
.View.Seconds=&Seconds
.View.Keep Ratio=&Keep Ratio
.View.Border=&Border
.View.Color=&Color
.View.Color.Silver=Silver
.View.Color.Red=Red
.View.Color.Green=Green
.View.Color.Blue=Blue
.View.Color.Magenta=Magenta
.View.Color.Yellow=Yellow
.View.Color.White=White
.View.Color.Black=Black
.View.Transparent=&Transparent
.Exit=E&xit
.Restore=&Restore
.Seconds=&Seconds
Wnd_Trayer.Show=&Show
Wnd_Trayer.Hide=&Hide
Wnd_Trayer.Restore=&Restore
Wnd_Trayer.Exit=E&xit

[Russian]
.About= 
.Plugins=
.Plugins.Wnd_Mover=  (Wnd_Mover)
.Plugins.Wnd_Trayer=    (Wnd_Trayer)
.View=
.View.Seconds=
.View.Keep Ratio= 
.View.Border=
.View.Color=
.View.Color.Silver=
.View.Color.Red=
.View.Color.Green=
.View.Color.Blue=
.View.Color.Magenta=
.View.Color.Yellow=
.View.Color.White=
.View.Color.Black=
.View.Transparent=
.Exit=
.Restore=
.Seconds= 
Wnd_Trayer.Show=
Wnd_Trayer.Hide=
Wnd_Trayer.Restore= 
Wnd_Trayer.Exit=

  Each plugin should have in its description a list of strings which should be defined in Languages.ini file to provide translating the plugin to other languages (if it supports translation).


http://bonanzas.rinet.ru
bonanzas@online.sinor.ru
