// Borland C++ Builder
// Copyright (c) 1995, 2002 by Borland Software Corporation
// All rights reserved

// (DO NOT EDIT: machine generated header) 'ahmtappmanager.pas' rev: 6.00

#ifndef ahmtappmanagerHPP
#define ahmtappmanagerHPP

#pragma delphiheader begin
#pragma option push -w-
#pragma option push -Vx
#include <ahmthookclass.hpp>	// Pascal unit
#include <DdeMan.hpp>	// Pascal unit
#include <Grids.hpp>	// Pascal unit
#include <StdCtrls.hpp>	// Pascal unit
#include <ExtCtrls.hpp>	// Pascal unit
#include <ahmsystemconst.hpp>	// Pascal unit
#include <Dialogs.hpp>	// Pascal unit
#include <ActnList.hpp>	// Pascal unit
#include <Controls.hpp>	// Pascal unit
#include <ShellAPI.hpp>	// Pascal unit
#include <Menus.hpp>	// Pascal unit
#include <ahmtstoredata.hpp>	// Pascal unit
#include <ahmsystemclass.hpp>	// Pascal unit
#include <Graphics.hpp>	// Pascal unit
#include <Forms.hpp>	// Pascal unit
#include <Classes.hpp>	// Pascal unit
#include <Messages.hpp>	// Pascal unit
#include <Windows.hpp>	// Pascal unit
#include <SysUtils.hpp>	// Pascal unit
#include <SysInit.hpp>	// Pascal unit
#include <System.hpp>	// Pascal unit

//-- user supplied -----------------------------------------------------------

namespace Ahmtappmanager
{
//-- type declarations -------------------------------------------------------
#pragma pack(push, 4)
struct TAHMWMDeviceChange
{
	unsigned Msg;
	unsigned Event;
	void *dwData;
	int Result;
} ;
#pragma pack(pop)

#pragma pack(push, 4)
struct TAHMWMPowerBroadcast
{
	unsigned Msg;
	unsigned dwPowerEvent;
	unsigned dwData;
	int Result;
} ;
#pragma pack(pop)

#pragma option push -b-
enum TAHMAppRestore { NoRestore, OnDoubleClick, OnSingleClick };
#pragma option pop

typedef void __fastcall (__closure *TAHMDeviceChangeEvent)(System::TObject* Sender, char DriveLetter);

typedef void __fastcall (__closure *TAHMOnStartParam)(System::TObject* Sender, int Pos, AnsiString Param);

typedef void __fastcall (__closure *TAHMOnDDEMacro)(System::TObject* Sender, AnsiString Command, AnsiString Argument);

typedef void __fastcall (__closure *TAHMOnFileOpen)(System::TObject* Sender, AnsiString FileName);

typedef void __fastcall (__closure *TAHMGetShareExpiry)(System::TObject* Sender, Word &Day, Word &Month, Word &Year);

typedef void __fastcall (__closure *TAHMOnMaxInstance)(System::TObject* Sender, int NoOfInstances);

typedef void __fastcall (__closure *TAHMOnEndWindows)(System::TObject* Sender, bool &Endwindows);

typedef void __fastcall (__closure *TAHMOnSysMemLow)(System::TObject* Sender, unsigned CompactRatio);

typedef void __fastcall (__closure *TAHMAppDisplayChange)(System::TObject* Sender, int BitPerPixel, Word ScreenWidth, Word ScreenHeight);

#pragma option push -b-
enum TAHMIAction { aRestoreAndExit, aRestore, aExit, aNone };
#pragma option pop

class DELPHICLASS TAHMAppTimerThread;
class DELPHICLASS TAHMAppTimer;
class DELPHICLASS TAHMAppManager;
class DELPHICLASS TAHMInstance;
class PASCALIMPLEMENTATION TAHMInstance : public Classes::TPersistent 
{
	typedef Classes::TPersistent inherited;
	
private:
	Byte FMax;
	TAHMIAction FAction;
	TAHMAppManager* FAHMApplication;
	Byte __fastcall GetActiveInstances(void);
	
protected:
	void __fastcall CheckPrevInstances(void);
	
public:
	__fastcall TAHMInstance(TAHMAppManager* AHMApplication);
	__property Byte Instances = {read=GetActiveInstances, nodefault};
	
__published:
	__property Byte Max = {read=FMax, write=FMax, default=0};
	__property TAHMIAction Action = {read=FAction, write=FAction, default=0};
public:
	#pragma option push -w-inl
	/* TPersistent.Destroy */ inline __fastcall virtual ~TAHMInstance(void) { }
	#pragma option pop
	
};


class DELPHICLASS TAHMTrayIcon;
#pragma option push -b-
enum TAHMTrayState { tsNever, tsAlways, tsOnMinimized };
#pragma option pop

class PASCALIMPLEMENTATION TAHMTrayIcon : public Classes::TPersistent 
{
	typedef Classes::TPersistent inherited;
	
private:
	HWND FWindowHandle;
	_NOTIFYICONDATAA FTrayIconData;
	AnsiString FHint;
	TAHMTrayState FActive;
	bool FNewWindows;
	Menus::TPopupMenu* FPopupMenu;
	bool FNoTrayIcon;
	bool FEnabled;
	bool FMinimized;
	TAHMAppManager* FAHMApplication;
	TAHMAppRestore FAppRestore;
	Graphics::TIcon* FIcon;
	void __fastcall SetActive(const TAHMTrayState Value);
	void __fastcall SetPopupMenu(const Menus::TPopupMenu* Value);
	void __fastcall SetHint(const AnsiString Value);
	void __fastcall EmptyTray(void);
	void __fastcall FillTray(void);
	void __fastcall HandleMinimize(System::TObject* Sender);
	void __fastcall HandleRestore(System::TObject* Sender);
	void __fastcall HandleRightClick(System::TObject* Sender);
	void __fastcall UpdateTray(void);
	void __fastcall FillIconStructure(void);
	void __fastcall SetIcon(const Graphics::TIcon* Value);
	
public:
	__fastcall TAHMTrayIcon(TAHMAppManager* AHMApplication);
	__fastcall virtual ~TAHMTrayIcon(void);
	
__published:
	__property TAHMTrayState Active = {read=FActive, write=SetActive, default=0};
	__property Menus::TPopupMenu* PopupMenu = {read=FPopupMenu, write=SetPopupMenu};
	__property AnsiString Hint = {read=FHint, write=SetHint};
	__property TAHMAppRestore AppRestore = {read=FAppRestore, write=FAppRestore, default=0};
	__property Graphics::TIcon* Icon = {read=FIcon, write=SetIcon};
};


class DELPHICLASS TAHMAutoStart;
#pragma option push -b-
enum TAHMStartType { sNever, sOnBoot };
#pragma option pop

class PASCALIMPLEMENTATION TAHMAutoStart : public Classes::TPersistent 
{
	typedef Classes::TPersistent inherited;
	
private:
	AnsiString FUniqueName;
	TAHMStartType FAutoStart;
	TAHMAppManager* FAHMApplication;
	void __fastcall SetAutoStart(const TAHMStartType Value);
	void __fastcall SetUniqueName(const AnsiString Value);
	
protected:
	bool __fastcall InstallApp(const TAHMStartType Value);
	
public:
	__fastcall TAHMAutoStart(TAHMAppManager* AHMApplication);
	__fastcall virtual ~TAHMAutoStart(void);
	
__published:
	__property AnsiString UniqueName = {read=FUniqueName, write=SetUniqueName};
	__property TAHMStartType AutoStart = {read=FAutoStart, write=SetAutoStart, default=0};
};


class DELPHICLASS TAHMShareware;
class PASCALIMPLEMENTATION TAHMShareware : public Classes::TPersistent 
{
	typedef Classes::TPersistent inherited;
	
private:
	Word FFixedEndYear;
	Word FFixedEndDay;
	Word FFixedEndMonth;
	bool FisShareware;
	
public:
	__fastcall virtual TAHMShareware(void);
	bool __fastcall Check(void);
	
__published:
	__property bool IsShareware = {read=FisShareware, write=FisShareware, default=0};
	__property Word FixedEndDay = {read=FFixedEndDay, write=FFixedEndDay, stored=FisShareware, nodefault};
	__property Word FixedEndMonth = {read=FFixedEndMonth, write=FFixedEndMonth, stored=FisShareware, nodefault};
	__property Word FixedEndYear = {read=FFixedEndYear, write=FFixedEndYear, stored=FisShareware, nodefault};
public:
	#pragma option push -w-inl
	/* TPersistent.Destroy */ inline __fastcall virtual ~TAHMShareware(void) { }
	#pragma option pop
	
};


class DELPHICLASS TAHMAssociations;
class PASCALIMPLEMENTATION TAHMAssociations : public Classes::TPersistent 
{
	typedef Classes::TPersistent inherited;
	
private:
	bool FApply;
	AnsiString FExtensions;
	TAHMAppManager* FOwner;
	Classes::THelpContext FHelp;
	Ddeman::TDdeServerConv* FDDEServerConf;
	AnsiString FDDEUniqueName;
	Byte FIconID;
	void __fastcall SetExtensions(const AnsiString Value);
	void __fastcall SetApply(const bool Value);
	void __fastcall AssociationsMacro(System::TObject* Sender, Classes::TStrings* Msg);
	bool __fastcall ApplyAll(void);
	void __fastcall SetDDEUniqueName(const AnsiString Value);
	bool __fastcall DeleteAll(AnsiString DelAssoc);
	AnsiString __fastcall GetAll(AnsiString &CurrAssoc);
	
public:
	__fastcall virtual TAHMAssociations(TAHMAppManager* AOwner);
	__fastcall virtual ~TAHMAssociations(void);
	__property TAHMAppManager* Owner = {read=FOwner};
	
__published:
	__property AnsiString Extensions = {read=FExtensions, write=SetExtensions};
	__property bool ApplyOnRun = {read=FApply, write=SetApply, default=0};
	__property Classes::THelpContext Help = {read=FHelp, write=FHelp, default=0};
	__property AnsiString DDEUniqueName = {read=FDDEUniqueName, write=SetDDEUniqueName};
	__property Byte IconID = {read=FIconID, write=FIconID, default=0};
};


class PASCALIMPLEMENTATION TAHMAppManager : public Ahmsystemclass::TAHMSystemComponent 
{
	typedef Ahmsystemclass::TAHMSystemComponent inherited;
	
private:
	HWND FApplicationHandle;
	Controls::TWinControl* FOwnerForm;
	bool FAppStarting;
	Ahmtstoredata::TAHMStoreData* FParamStore;
	Classes::TNotifyEvent FIllegalAbort;
	bool FShowHint;
	int FHintPause;
	AnsiString FTitle;
	Graphics::TColor FHintColor;
	Forms::TExceptionEvent FOnException;
	Forms::THelpEvent FOnHelp;
	Graphics::TIcon* FIcon;
	TAHMAppTimer* FTimer;
	Forms::TIdleEvent FOnIdle;
	Forms::TMessageEvent FOnMessage;
	Classes::TNotifyEvent FOnDeactivate;
	Classes::TNotifyEvent FOnMinimize;
	Classes::TNotifyEvent FOnRestore;
	Classes::TNotifyEvent FOnHint;
	Classes::TNotifyEvent FOnActivate;
	Forms::TShowHintEvent FOnShowHint;
	TAHMOnMaxInstance FOnMaxInstance;
	TAHMInstance* FInstance;
	TAHMTrayIcon* FTrayIcon;
	Classes::TNotifyEvent FOnTrayRightClick;
	Classes::TNotifyEvent FOnTrayClick;
	Classes::TNotifyEvent FOnTrayDblClick;
	TAHMAutoStart* FAutoStart;
	AnsiString FHelpFile;
	Classes::TNotifyEvent FOnIconChange;
	TAHMDeviceChangeEvent FAfterInsert;
	TAHMDeviceChangeEvent FAfterRemove;
	bool FTaskbar;
	bool FUpdateFormatSettings;
	AnsiString FLongDateFormat;
	AnsiString FShortDateFormat;
	int FHintShortPause;
	int FHintHidePause;
	bool FUpdateMetricSettings;
	Classes::TNotifyEvent FOnShareNoExpiry;
	Classes::TNotifyEvent FOnShareExpiry;
	TAHMShareware* FShareware;
	TAHMGetShareExpiry FOnShareGetDate;
	TAHMAssociations* FAssociations;
	TAHMOnStartParam FOnStartParam;
	bool FWinTaskBar;
	bool FWinOfficeBar;
	bool FWinIcons;
	int FFlashInterval;
	TAHMOnEndWindows FOnEndWindows;
	Classes::TNotifyEvent FOnbatteryLow;
	Classes::TNotifyEvent FOnStandBy;
	Classes::TNotifyEvent FOnSuspend;
	Classes::TNotifyEvent FOnResume;
	Classes::TNotifyEvent FOnUserchanged;
	bool FMainForm;
	TAHMOnSysMemLow FOnSysMemLow;
	TAHMAppDisplayChange FOnDisplayChange;
	bool FAsService95;
	Classes::TNotifyEvent FOnUserLogOff;
	TAHMOnDDEMacro FOnDDEMacro;
	TAHMOnFileOpen FOnFileOpen;
	Classes::TNotifyEvent FOnDDEOpen;
	Classes::TNotifyEvent FOnDDEClose;
	Ahmthookclass::TAHMHookClass* FHookClass;
	TAHMOnMaxInstance FOnNewInstance;
	bool FHintShortCuts;
	Word FCenturyWindow;
	Actnlist::TActionEvent FActionExecute;
	Actnlist::TActionEvent FActionUpdate;
	void __fastcall SetHintShortCuts(const bool Value);
	void __fastcall SetCenturyWindow(const Word Value);
	void __fastcall IconChange(System::TObject* Sender);
	void __fastcall SetHintColor(const Graphics::TColor Value);
	void __fastcall SetHintPause(const int Value);
	void __fastcall SetIcon(Graphics::TIcon* aValue);
	void __fastcall SetShowHint(const bool Value);
	void __fastcall SetTitle(const AnsiString Value);
	void __fastcall SetHelpFile(const AnsiString Value);
	void __fastcall WMDeviceChange(TAHMWMDeviceChange &Msg);
	void __fastcall WMPowerMsg(TAHMWMPowerBroadcast &Msg);
	void __fastcall WndProc(Messages::TMessage &AMsg);
	char __fastcall GetFirstDriveLetter(int unitmask);
	void __fastcall SetTaskbar(const bool Value);
	void __fastcall ShowInTask(void);
	void __fastcall SetUpdateFormatSettings(const bool Value);
	void __fastcall SetLongDateFormat(const AnsiString Value);
	void __fastcall SetShortDateFormat(const AnsiString Value);
	void __fastcall SetHintHidePause(const int Value);
	void __fastcall SetHintShortPause(const int Value);
	void __fastcall SetUpdateMetricSettings(const bool Value);
	void __fastcall FlashOnTimer(System::TObject* Sender);
	void __fastcall SetFlashInterval(const int Value);
	void __fastcall SetMainForm(const bool Value);
	void __fastcall SetParamStore(const Ahmtstoredata::TAHMStoreData* Value);
	void __fastcall SetAsService95(const bool Value);
	void __fastcall UpdateService(const bool Value);
	void __fastcall Hooked(Messages::TMessage &Msg, bool &Handled);
	
protected:
	void *NewWndProc;
	void *OldWndProc;
	virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation);
	
public:
	__fastcall virtual TAHMAppManager(Classes::TComponent* AOwner);
	__fastcall virtual ~TAHMAppManager(void);
	virtual void __fastcall Loaded(void);
	bool __fastcall ValidateShareware(void);
	bool __fastcall ApplyAssociations(void);
	bool __fastcall ShowAssociations(void);
	void __fastcall Flash(void);
	
__published:
	__property TAHMOnDDEMacro OnDDEMacro = {read=FOnDDEMacro, write=FOnDDEMacro};
	__property Classes::TNotifyEvent OnDDEOpen = {read=FOnDDEOpen, write=FOnDDEOpen};
	__property Classes::TNotifyEvent OnDDEClose = {read=FOnDDEClose, write=FOnDDEClose};
	__property TAHMOnFileOpen OnFileOpen = {read=FOnFileOpen, write=FOnFileOpen};
	__property TAHMAutoStart* AutoStart = {read=FAutoStart, write=FAutoStart};
	__property TAHMAssociations* Associations = {read=FAssociations, write=FAssociations};
	__property TAHMTrayIcon* TrayIcon = {read=FTrayIcon, write=FTrayIcon};
	__property int FlashInterval = {read=FFlashInterval, write=SetFlashInterval, default=500};
	__property bool OnTaskbar = {read=FTaskbar, write=SetTaskbar, default=1};
	__property TAHMShareware* Shareware = {read=FShareware, write=FShareware};
	__property TAHMInstance* Instances = {read=FInstance, write=FInstance};
	__property Graphics::TColor HintColor = {read=FHintColor, write=SetHintColor, default=-2147483624};
	__property int HintPause = {read=FHintPause, write=SetHintPause, default=500};
	__property Graphics::TIcon* Icon = {read=FIcon, write=SetIcon};
	__property int HintHidePause = {read=FHintHidePause, write=SetHintHidePause, default=2500};
	__property int HintShortPause = {read=FHintShortPause, write=SetHintShortPause, default=0};
	__property bool ShowHint = {read=FShowHint, write=SetShowHint, default=1};
	__property bool ShowMainForm = {read=FMainForm, write=SetMainForm, default=1};
	__property AnsiString ApplicationTitle = {read=FTitle, write=SetTitle};
	__property AnsiString HelpFile = {read=FHelpFile, write=SetHelpFile};
	__property Ahmtstoredata::TAHMStoreData* ParamStore = {read=FParamStore, write=SetParamStore};
	__property bool AsService95 = {read=FAsService95, write=SetAsService95, default=0};
	__property bool UpdateFormatSettings = {read=FUpdateFormatSettings, write=SetUpdateFormatSettings, default=1};
	__property bool UpdateMetricSettings = {read=FUpdateMetricSettings, write=SetUpdateMetricSettings, default=1};
	__property AnsiString SysShortDateFormat = {read=FShortDateFormat, write=SetShortDateFormat};
	__property AnsiString SysLongDateFormat = {read=FLongDateFormat, write=SetLongDateFormat};
	__property Classes::TNotifyEvent OnIllegalAbort = {read=FIllegalAbort, write=FIllegalAbort};
	__property Classes::TNotifyEvent OnActivate = {read=FOnActivate, write=FOnActivate};
	__property Classes::TNotifyEvent OnDeactivate = {read=FOnDeactivate, write=FOnDeactivate};
	__property Forms::TExceptionEvent OnException = {read=FOnException, write=FOnException};
	__property Forms::THelpEvent OnHelp = {read=FOnHelp, write=FOnHelp};
	__property Forms::TIdleEvent OnIdle = {read=FOnIdle, write=FOnIdle};
	__property Forms::TMessageEvent OnMessage = {read=FOnMessage, write=FOnMessage};
	__property Classes::TNotifyEvent OnMinimize = {read=FOnMinimize, write=FOnMinimize};
	__property Classes::TNotifyEvent OnHint = {read=FOnHint, write=FOnHint};
	__property Classes::TNotifyEvent OnRestore = {read=FOnRestore, write=FOnRestore};
	__property Forms::TShowHintEvent OnShowHint = {read=FOnShowHint, write=FOnShowHint};
	__property TAHMOnMaxInstance OnMaxInstance = {read=FOnMaxInstance, write=FOnMaxInstance};
	__property TAHMOnMaxInstance OnNewInstance = {read=FOnNewInstance, write=FOnNewInstance};
	__property Classes::TNotifyEvent OnTrayClick = {read=FOnTrayClick, write=FOnTrayClick};
	__property Classes::TNotifyEvent OnTrayDblClick = {read=FOnTrayDblClick, write=FOnTrayDblClick};
	__property Classes::TNotifyEvent OnTrayRightClick = {read=FOnTrayRightClick, write=FOnTrayRightClick};
	__property TAHMDeviceChangeEvent OnCDInsert = {read=FAfterInsert, write=FAfterInsert};
	__property TAHMDeviceChangeEvent OnCDRemove = {read=FAfterRemove, write=FAfterRemove};
	__property Classes::TNotifyEvent OnIconChange = {read=FOnIconChange, write=FOnIconChange};
	__property Classes::TNotifyEvent OnShareExpiry = {read=FOnShareExpiry, write=FOnShareExpiry};
	__property Classes::TNotifyEvent OnShareNoExpiry = {read=FOnShareNoExpiry, write=FOnShareNoExpiry};
	__property TAHMGetShareExpiry OnShareGetDate = {read=FOnShareGetDate, write=FOnShareGetDate};
	__property TAHMOnStartParam OnStartParam = {read=FOnStartParam, write=FOnStartParam};
	__property Classes::TNotifyEvent OnAPMSuspend = {read=FOnSuspend, write=FOnSuspend};
	__property Classes::TNotifyEvent OnAPMStandBy = {read=FOnStandBy, write=FOnStandBy};
	__property Classes::TNotifyEvent OnAPMResume = {read=FOnResume, write=FOnResume};
	__property Classes::TNotifyEvent OnAPMBatteryLow = {read=FOnbatteryLow, write=FOnbatteryLow};
	__property TAHMOnEndWindows OnEndWindows = {read=FOnEndWindows, write=FOnEndWindows};
	__property Classes::TNotifyEvent OnUserChanged = {read=FOnUserchanged, write=FOnUserchanged};
	__property Classes::TNotifyEvent OnUserLogoff = {read=FOnUserLogOff, write=FOnUserLogOff};
	__property TAHMOnSysMemLow OnSysMemLow = {read=FOnSysMemLow, write=FOnSysMemLow};
	__property TAHMAppDisplayChange OnDisplayChange = {read=FOnDisplayChange, write=FOnDisplayChange};
	__property Word SysCenturyWindow = {read=FCenturyWindow, write=SetCenturyWindow, default=50};
	__property bool HintShortCuts = {read=FHintShortCuts, write=SetHintShortCuts, default=1};
	__property Actnlist::TActionEvent OnActionExecute = {read=FActionExecute, write=FActionExecute};
	__property Actnlist::TActionEvent OnActionUpdate = {read=FActionUpdate, write=FActionUpdate};
};


class PASCALIMPLEMENTATION TAHMAppTimer : public System::TObject 
{
	typedef System::TObject inherited;
	
private:
	bool FEnabled;
	Word FInterval;
	TAHMAppManager* FOwner;
	Classes::TNotifyEvent FOnTimer;
	TAHMAppTimerThread* FTimerThread;
	Classes::TThreadPriority FThreadPriority;
	void __fastcall SetEnabled(const bool Value);
	void __fastcall SetInterval(const Word Value);
	
protected:
	DYNAMIC void __fastcall Timer(void);
	
public:
	__fastcall virtual TAHMAppTimer(TAHMAppManager* AOwner);
	__fastcall virtual ~TAHMAppTimer(void);
	
__published:
	__property bool Enabled = {read=FEnabled, write=SetEnabled, nodefault};
	__property Word Interval = {read=FInterval, write=SetInterval, nodefault};
	__property Classes::TNotifyEvent OnTimer = {read=FOnTimer, write=FOnTimer};
};


class PASCALIMPLEMENTATION TAHMAppTimerThread : public Classes::TThread 
{
	typedef Classes::TThread inherited;
	
public:
	TAHMAppTimer* OwnerTimer;
	virtual void __fastcall Execute(void);
public:
	#pragma option push -w-inl
	/* TThread.Create */ inline __fastcall TAHMAppTimerThread(bool CreateSuspended) : Classes::TThread(CreateSuspended) { }
	#pragma option pop
	#pragma option push -w-inl
	/* TThread.Destroy */ inline __fastcall virtual ~TAHMAppTimerThread(void) { }
	#pragma option pop
	
};


//-- var, const, procedure ---------------------------------------------------

}	/* namespace Ahmtappmanager */
using namespace Ahmtappmanager;
#pragma option pop	// -w-
#pragma option pop	// -Vx

#pragma delphiheader end.
//-- end unit ----------------------------------------------------------------
#endif	// ahmtappmanager
