SharpAPI Library
SharpE has a global API that provides often-used and important functions to the shell. Some of the functions in SharpAPI are deprecated and should not be used anymore. This page lists the safe to use and up-to-date functions.
To use any function of this dll, simply include SharpAPI.pas in your project. This header file contains the declaration of all functions exported by the dll.
You can view the header file here.
Component Management
function FindComponent(Component : PChar) : hwnd; function IsComponentRunning(Component : PChar) : boolean; function CloseComponent(Component : PChar) : boolean; procedure TerminateComponent(Component : PChar); procedure StartComponent(Component : PChar);
All functions can be used to manage the SharpE components. The Component parameter can be either the window class name or a string containing the component name ('sharpbar','sharpcore','sharpconsole','sharpmenu','sharpdesk').
The CloseComponent function will first send the WM_SHARPTERMINATE message, then it will send WM_CLOSE and after this WM_QUIT. The TerminateComponent function however is directly terminating the process of the component (be carefull when using this!). The Component param for the TerminateComponent function can only be the component name (window class name is not possible)
Recent/Most used items
function GetRecentItems(ReturnCount: integer): widestring; function GetMostUsedItems(ReturnCount: integer): widestring;
Both functions will return the recent used or most used items of the exec.service as a comma seperated text string. The returncount parameter indicates the maximum amount if items which will be returned in the string.
Settings Functions
function GetSharpeDirectory: PChar; function GetSharpeUserSettingsPath: PChar; function GetSharpeGlobalSettingsPath: PChar;
Those 3 functions should be used for getting any path related to the SharpE directory. Always try to use those functions instead of Application.FileName.
