API Calendar Methods          

Here is a list of functions you can call inside the DLL we have decided to make public. All the functions are in gicscal.dll. The functions were test successfully in Visual Basic and Visual C++.

API Methods
Examples
Sample Projects

 

API Methods

View gicscaldll header

#define ICSO_IGNORE_TIME 1
#define ICSO_CHECK_DATABASES 2

#define IC_MONDAY 32
#define IC_TUESDAY 16
#define IC_WEDNESDAY 8
#define IC_THURSDAY 4
#define IC_FRIDAY 2
#define IC_SATURDAY 1

#define IC_RUN_ON_START 1
#define IC_RUN_ON_TIME 2
#define IC_RUN_ON_DAY 4
#define IC_RUN_ON_WEEKDAY 8

#define MAX_OCC_LEN 20                 // The maximum length of an occasion name
#define MAX_USER_NAME_LEN 40 // The maximum length of user name
#define MAX_MESSAGE_LEN 160    // The maximum length of a message
#define MAX_PROG_NAME_LEN 40 // The maximum name of an external program added

typedef unsigned long ICHANDLE;

/////////////////////////////////////////////////////////////////////////////
// Method : SaveOccasion
// Purpose : Saves an occasion to the calendar database
// Parameter(s) : [in] COleDateTime oleDateTime - The time for the occasion
// [in] char* szMessage - The occasion message.
// [in] int nNotifyFlag - The user wants to be notified of occasion
// [in] char cOccasion - The character id of the occasion
// [in] int p_nAttrib - Occasion attributes
// IC_IGNORE_TIME - Does not use the hour and minute parameters.
// ICSO_CHECK_DATABASES - Checks the databases for the next ocurring occasion.
// [in] char* p_szUserName - The user to add the occasion to.
// Returns     : TRUE if successful
/////////////////////////////////////////////////////////////////////////////

BOOL ICSaveOccasion(COleDateTime oleDateTime, const char* szMessage,
int nNotifyFlag, char cOccasion, int p_nAttrib, const char* p_szUserName);

/////////////////////////////////////////////////////////////////////////////
// Method : SaveOccasionEx
// Purpose : Saves an occasion to the calendar database
// Parameter(s) : [in] int p_nYear
// [in] int p_nMonth
// [in] int p_nDay
// [in] int p_nHour
// [in] int p_nMinute
// [in] char* szMessage - The occasion message.
// [in] int nNotifyFlag - The user wants to be notified of occasion
// [in] char cOccasion - The character id of the occasion
// [in] int p_nAttribs - Occasion attributes
// IC_IGNORE_TIME - Does not use the hour and minute parameters.
// ICSO_CHECK_DATABASES - Checks the databases for the next ocurring occasion.
// [in] char* p_szUserName - The user to add the occasion to.
// Default is NULL (default user).
// Returns     : BOOL
/////////////////////////////////////////////////////////////////////////////
BOOL ICSaveOccasionEx(int p_nYear, int p_nMonth, int p_nDay, int p_nHour, int p_nMinute,
const char* p_szMessage,
int p_nNotifyFlag, char p_cOccasion, int p_nAttribs, const char* p_szUserName = NULL);

/////////////////////////////////////////////////////////////////////////////
// Method : GetUserPath
// Purpose : Retrieves the database path for the selected user.
// Parameter(s) : [in] char* szUserName - the user to retrieve the path for.
// [out] char* szUserPath - the selected user's path
// [in] int nSize - the size of the szUserPath string
// Returns     : True if successful
/////////////////////////////////////////////////////////////////////////////

BOOL ICGetUserPath(const char* p_szUserName, char* p_szUserPath, int p_nSize);

/////////////////////////////////////////////////////////////////////////////
// Method : GetProgramPath
// Purpose : Retreives the program path for IDEAL Calendar.
// Parameter(s) : [out] char* szProgramPath - returns the program path
// [in] int nSize - the size of the program path char array
// Returns     : True if successful
/////////////////////////////////////////////////////////////////////////////
BOOL ICGetProgramPath(char* pszProgramPath, int nSize);

/////////////////////////////////////////////////////////////////////////////
// Method : SetOccasionName
// Purpose : Sets the occasion name and character id
// Parameter(s) : [in] char p_cOccasion - the occasion character
// [in] char* p_szOccasion - The occasion name
// Returns     : TRUE if successful
/////////////////////////////////////////////////////////////////////////////

BOOL ICSetOccasionName(char p_cOccasion, const char* p_szOccasion);

/////////////////////////////////////////////////////////////////////////////
// Method : DeleteOccasionName
// Purpose : Deletes the occasion name
// Parameter(s) : [in] char cOccasion
// Returns     : BOOL
/////////////////////////////////////////////////////////////////////////////

BOOL ICDeleteOccasionName(char p_cOccasion);

/////////////////////////////////////////////////////////////////////////////
// Method : GetOccasionName
// Purpose :
// Parameter(s) : [in] char cOccasion - The occasion character
// [out] char* pszOccasion - The occasion name
// [in] int nOccSize - The size of the pszOccasion string
// Returns     : TRUE if successful
/////////////////////////////////////////////////////////////////////////////

BOOL ICGetOccasionName(char cOccasion, char* pszOccasion, int nOccSize);

/////////////////////////////////////////////////////////////////////////////
// Method : GetCurrentUser
// Purpose : Gets the current user of IDEAL Calendar.
// Parameter(s) : [out] char* pszUser - returns current user name
// [in] nSize - the size of the pszUser array.
// Returns     : TRUE (1) if successful
/////////////////////////////////////////////////////////////////////////////

BOOL ICGetCurrentUser(char* pszUserName, int nSize);

/////////////////////////////////////////////////////////////////////////////
// Method : AddProgram
// Purpose : Adds a program menu item to the calendar menu
// Parameter(s) : [in] const char* szName - The display name for the program
// [in] const char* szPath - program path
// Returns     : BOOL
/////////////////////////////////////////////////////////////////////////////

BOOL ICAddProgram(const char* szName, const char* szPath);

/////////////////////////////////////////////////////////////////////////////
// Method : DeletesProgram
// Purpose : Deletes a program menu item from the calendar menu
// Parameter(s) : [in] const char* szName - The display name for the program
// Returns     : BOOL
/////////////////////////////////////////////////////////////////////////////

BOOL ICDeleteProgram(const char* szName);

/////////////////////////////////////////////////////////////////////////////
// Method : AddTool
// Purpose : Adds a tool menu item to the calendar menu
// Parameter(s) : const char* szName - The display name for the program
// const char* szPath - program path
// Returns     : BOOL
/////////////////////////////////////////////////////////////////////////////
BOOL ICAddTool(const char* szName, const char* szPath);

/////////////////////////////////////////////////////////////////////////////
// Method : ICDeleteTool
// Purpose : Deletes a tool menu item from the calendar menu
// Parameter(s) : const char* szName - The display name for the program
// Returns     : BOOL
/////////////////////////////////////////////////////////////////////////////

BOOL ICDeleteTool(const char* szName);

/////////////////////////////////////////////////////////////////////////////
// Method : ICAddAutoRun
// Purpose : Saves information into a autorun database.
// The calendar then starts/loads the program.
// Parameter(s) : const char* p_szProgramPath - program path
// const char* p_szParameters - parameters used for program
// int p_nRunType - Situation to run the program in
// int p_nWindowState - Minimized | Maximized | Hidden | Normal
// int p_nDay - The day of the month to run the program.
// (OR) - The days of the week to run the occasion.
// int p_nStartHour - The hour to start the program
// int p_nStartMinute - The minute to start the program
//
// You have three options for the run type: Run when IDEAl Calendar starts
// (IC_RUN_ON_START), run on a day of the month (IC_RUN_ON_DAY), or run on
// specified weekdays (IC_RUN_ON_WEEKDAY). When you choose to run on a certain
// day instead of run when the calendar starts, you can also specify a time.
// (IC_RUN_ON_TIME).
//
// The day parameter is where the day of the month or days of the week should
// be passed.
//
// Returns     : BOOL
/////////////////////////////////////////////////////////////////////////////
BOOL ICAddAutoRun(const char* p_szProgramPath, const char* p_szParameters, int p_nRunType, int p_nWindowState, int p_nDay,
int p_nStartHour, int p_nStartMinute);

/////////////////////////////////////////////////////////////////////////////
// Method : ICDeleteAutoRun
// Purpose : Delete an item set to automatically run when IC starts
// Parameter(s) : const char* szPath - The path of the program to del
// Returns     : BOOL
/////////////////////////////////////////////////////////////////////////////

BOOL __stdcall ICDeleteAutoRun(const char* szPath);

/////////////////////////////////////////////////////////////////////////////
// Method : ICOccOpenHandle
// Purpose : Gets a handle to all the valid occasions
// Parameter(s) : [in] int p_nYear
// [in] int p_nMonth
// [in] int p_nDay
// [in] char* p_szUserName - The user to add the occasion to.
// Default is NULL (default user).
// Returns     : ICHANDLE - Handle to all the valid occasions
/////////////////////////////////////////////////////////////////////////////
ICHANDLE ICOccOpenHandle(int p_nYear, int p_nMonth, int p_nDay, const char* p_szUserName = NULL);

/////////////////////////////////////////////////////////////////////////////
// Method : ICOccGetNext
// Purpose : Returns the next occasion in the specified handle
// Parameter(s) : [in/out] ICHANDLE* p_phOcc - Handle to occasions
// [out] int* p_pnHour
// [out] int* p_pnMinute
// [out] int* p_pnNotifyFlag - The user wants to be notified of occasion
// [out] char* p_pcOccasion - The character id of the occasion
// [out] char* p_szMessage - The occasion message.
// [in] int p_nMsgSize
// Returns     : BOOL
/////////////////////////////////////////////////////////////////////////////
BOOL ICOccGetNext(ICHANDLE* p_phOcc, int* p_nHour, int* p_nMinute,
int* p_nNotifyFlag, int* p_cOccasion, char* p_szMessage, int p_nMsgSize);

/////////////////////////////////////////////////////////////////////////////
// Method : ICOccCloseHandle
// Purpose : Closes the handle to the occasions. (frees the memoray allocated)
// Parameter(s) : [in] ICHANDLE p_hOcc - Handle to occasions
// Returns     : BOOL
/////////////////////////////////////////////////////////////////////////////

BOOL ICOccCloseHandle(ICHANDLE p_hOcc);


Examples

Visual C++

// Function variable
BOOL (CALLBACK* AddTool)(const char*, const char*);
HINSTANCE hInst;

// Load ICS DLL
hInst = ::LoadLibrary("gicscal.dll");

if (hInst)
{
    // Get pointer to a function in the DLL
    (*AddTool) = ::GetProcAddress(hInst, "ICAddTool");

    if ((*AddTool) != NULL)
    {
        // Call the function with parameters
        (*AddTool)("Sample Prog", _pgmptr);
    }

    ::FreeLibrary(hInst);
    hInst = NULL;
}

Visual Basic

'Declaration of functipn
Private Declare Function AddTool Lib "gicscal.dll" Alias "ICAddTool" (ByVal sName As String, ByVal sPath As String) As Integer

' In implementation
AddTool "Sample Prog", UCase(App.Path + "\" + App.EXEName + ".EXE")

Sample Projects

(Visual Basic) Multiple Day Insertion

(Visual C++) HTML Calendar