-
Notifications
You must be signed in to change notification settings - Fork 0
/
DialupAlerter.h
65 lines (56 loc) · 2.32 KB
/
DialupAlerter.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//---------------------------------------------------------------------------
#ifndef DialupAlerterH
#define DialupAlerterH
#define TAPI_CURRENT_VERSION 0x00020000
//---------------------------------------------------------------------------
#include <stdlib.h>
#include <SysUtils.hpp>
#include <Controls.hpp>
#include <Classes.hpp>
#include <Forms.hpp>
#include <Tapi.h>
//---------------------------------------------------------------------------
typedef void __fastcall (__closure *TDialupNotifyEvent)(System::TObject* Sender, AnsiString *Msg);
//---------------------------------------------------------------------------
class PACKAGE TDialupAlerter : public TComponent
{
private:
TNotifyEvent FOnNoLineAvailable;
TDialupNotifyEvent FOnEventNotification;
bool FActive;
bool FConnected;
int FLineDeviceID;
LPHLINEAPP MyTAPIHandle;
AnsiString *LastErrorMsg;
DWORD LastErrorCode;
int LinkCount;
LPLINEINITIALIZEEXPARAMS InitParms;
LPLINEMESSAGE LineMsg;
HLINE LineHandle;
HANDLE EventHandle;
unsigned long APIVersion;
unsigned long NumDevices;
HCALL CallHandle;
LPLINECALLINFO CallInfo;
void __fastcall GetErrorMessage(AnsiString Tag, int res);
protected:
virtual void __fastcall SetActive(bool act);
virtual void __fastcall SetLineDeviceID(int lid);
void __fastcall Startup();
void __fastcall Shutdown();
void __fastcall OpenLine(int i);
void __fastcall CloseLine(HLINE i);
void __fastcall SetStatusChangeRequests(HLINE l);
public:
__fastcall TDialupAlerter(TComponent* Owner);
__fastcall ~TDialupAlerter();
void __fastcall CheckMessages();
__published:
__property bool Active = {read=FActive, write=SetActive, default=false};
__property bool Connected = {read=FConnected, default=false};
__property int LineDeviceID = {read=FLineDeviceID, write=SetLineDeviceID, default=-1};
__property TNotifyEvent OnNoLineAvailable = {read=FOnNoLineAvailable, write=FOnNoLineAvailable, nodefault};
__property TDialupNotifyEvent OnEventNotification = {read=FOnEventNotification, write=FOnEventNotification, nodefault};
};
//---------------------------------------------------------------------------
#endif