Alarm++ is an automation server. You can use it to create alarms from an application or script. The typeid is 12noon.Alarm.Document.
A type library is included with Alarm++ to help you use Alarm++'s automation support in a development environment that can use type libraries, such as Microsoft's Visual Studio.
In order to avoid the mail profile selection dialog box when starting Alarm++ as an automation server, you should disable mail support or select a mail profile to use every time. (See the section on the Options Mail page.)
You can obtain a pointer to the currently running instance of Alarm++ by retrieving it from the Running Object Table. If multiple instances of Alarm++ are running, this will retrieve the pointer to the first instance.
This is the object model:
Every object has the following properties:
| IDispatch* | Application | return the Application object |
|---|---|---|
| IDispatch* | Parent | return the "containing" object |
IID_IAlarmPlusPlusApplication
| BSTR | Name | return name of application | (read-only) |
|---|---|---|---|
| IDispatch* | Parent | return Application object | (read-only) |
| BSTR | FullName | return path to executable | (read-only) |
| boolean | Visible | the visibility of main window | |
| IDispatch* | ActiveDocument | return current Document object | (read-only) |
| void | Quit() | exit application (server) |
|---|---|---|
| IDispatch* | New() | create a new document, returns Document object
Note: To avoid having the autosave feature of Alarm++ prompt the user for a filename, you must save this new document before creating any alarms. |
| IDispatch* | Open(BSTR bstrFilename, BSTR bstrPassword) | open existing document, returns the Document object |
| boolean | Register(BSTR szName, BSTR szKey) |
register application with passed name and key This method is no longer supported. |
IID_IAlarmPlusPlusDocument
| IDispatch* | Parent | return Application object | (read-only) |
|---|---|---|---|
| BSTR | FullName | return name of saved document | (read-only) |
| BSTR | Path | return path to saved document | (read-only) |
| boolean | Saved | indicate if document has been modified | (read-only) |
| IDispatch* | Alarms | return Alarms object | (read-only) |
| boolean | CheckingAlarms | whether or not Alarm++ is checking alarms to determine if they should go off
Note: When using the Automation features of Alarm++, this is initially set to FALSE. If you want Alarm++ to have alarms go off, you should set this to TRUE. |
| void | SaveAs(BSTR bstrFilename) | save document to specified path |
|---|---|---|
| void | Save() | save document |
| void | Activate() | activate document (nop) |
| void | Print(short nFrom, short nTo, short nCopies) | (not implemented) |
| void | Close(boolean bSaveChanges, BSTR bstrFilename) | save document and create new one |
IID_IAlarmPlusPlusAlarms
| IDispatch* | Parent | return Document object | (read-only) |
|---|---|---|---|
| long | Count | return number of alarms in collection | (read-only) |
| IDispatch* | Item(long lIndex) | return Alarm object at the specified index (NULL if error) |
|---|---|---|
| IDispatch* | Add() | create new alarm in collection and return Alarm object |
| void | Remove(long lIndex) | remove Alarm object at the specified index |
| void | Refresh() | update the information in the main window. You should call this after modifying any alarm information. If this is not called, the information in the main window will not be updated (although the alarm information will still be correct). |
IID_IAlarmPlusPlusAlarm
| IDispatch* | Parent | (not implemented) | (read-only) |
|---|---|---|---|
| BSTR | Name | Name of the alarm. | |
| BSTR | Message | Message of the alarm. | |
| DATE | Time | Time of day that the alarm is to go off. The date component is undefined. |
|
| DATE | Date | Date the alarm is to go off. The time component is undefined. |
|
| boolean | RepeatDisabled | Indicates whether or not the alarm is active (i.e., has any events left). If TRUE is passed, the alarm is set to have one event |
|
| long | NumberOfEvents | The number of events for the alarm (greater than 0). If the alarm is disabled, repeats until, or repeats forever, this value is undefined. |
|
| DATE | RepeatUntil | ||
| boolean | RepeatForever | Indicates whether or not the alarm repeats forever. If FALSE is passed, the alarm is disabled. |
|
| long | RepeatIntervalNumber | The number of intervals between events. (For example, every 2 weeks.) |
|
| boolean | RepeatIntervalMinutes | Set the repeat interval to minutes. If FALSE is passed, nothing happens. |
|
| boolean | RepeatIntervalHours | Set the repeat interval to hours. If FALSE is passed, nothing happens. |
|
| boolean | RepeatIntervalDays | Set the repeat interval to days. If FALSE is passed, nothing happens. |
|
| boolean | RepeatIntervalWeeks | Set the repeat interval to weeks. If FALSE is passed, nothing happens. |
|
| boolean | RepeatIntervalMonths | Set the repeat interval to months. If FALSE is passed, nothing happens. |
|
| boolean | RepeatIntervalYears | Set the repeat interval to years. If FALSE is passed, nothing happens. |
|
| boolean | Weekday(short nIndex) | Indicates whether or not the alarm is to go off
on the specified weekday. 0 - Sunday 6 - Saturday |
|
| boolean | RunOnManual | Indicates whether or not the alarm is to run the specified application when the user presses the Run button on the event window. | |
| boolean | RunOnEvent | Indicates whether or not the alarm is to run the specified application when the event occurs | |
| boolean | RunOnSnoozeEvent | Indicates whether or not the alarm is to run the specified application when the event occurs after being snoozed one or more times | |
| boolean | RunOnSnoozeButton | Indicates whether or not the alarm is to run when the user presses the Snooze button after the event occurs | |
| boolean | RunOnOffButton | Indicates whether or not the alarm is to run when the user presses the Off button after the event occurs | |
| BSTR | RunApplication | Path to the application to run when the alarm goes off. This value is not validated. |
|
| BSTR | RunArguments | Arguments to the application. | |
| long | SnoozeIntervalNumber | The number of intervals between snoozes. (For example, every 2 hours.) |
|
| boolean | SnoozeIntervalMinutes | Set the snooze interval to minutes. If FALSE is passed, nothing happens. |
|
| boolean | SnoozeIntervalHours | Set the snooze interval to hours. If FALSE is passed, nothing happens. |
|
| boolean | SnoozeIntervalDays | Set the snooze interval to days. If FALSE is passed, nothing happens. |
|
| long | ExpirationNumber | The number of units before an event expires and is not displayed. | |
| boolean | ExpirationMinutes | Set the expiration interval to minutes. If FALSE is passed, nothing happens. |
|
| boolean | ExpirationHours | Set the expiration interval to hours.
If FALSE is passed, nothing happens. |
|
| boolean | ExpirationDays | Set the expiration interval to days.
If FALSE is passed, nothing happens. |
|
| boolean | ExpirationWeeks | Set the expiration interval to weeks.
If FALSE is passed, nothing happens. |
|
| boolean | DeleteAfterLastEvent | Specify whether the alarm is to be deleted after its last event occurs (or is skipped). |
(none)