-
Notifications
You must be signed in to change notification settings - Fork 0
/
PACKMON.H
152 lines (119 loc) · 4.3 KB
/
PACKMON.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
//class TDMLClApp : public TApplication
class PM_APPL : public TApplication {
public:
// Constructor
PM_APPL() : TApplication(),CallBackProc((FARPROC)CallBack) {
InstId = 0;
}
void InitInstance();
// Performs each instance initialization necessary for the application.
// Unlike InitApplication, which is called for the first instance of an
// application, InitInstance is called whether or not there are other
// executing instances of the application.
// InitInstance calls InitMainWindow, and then creates and shows the
// main window element by TWindow::Create and TWindow::Show.
// If the main window cannot be created, a TXInvalidMainWindow exception is thrown.
// If you redefine this member function, be sure to explicitly
// call TApplication::InitInstance.
void InitMainWindow();
// By default, InitMainWindow constructs a generic TFrameWindow object
// with the name of the application as its caption. You can redefine
// InitMainWindow to construct a useful main window object of
// TFrameWindow (or a class derived from TFrameWindow) and store it in
// MainWindow. The main window must be a top-level window; that is, it
// must be derived from TFrameWindow.
int TermInstance(int status);
// Handles the termination of each executing instance of an ObjectWindows application.
static HDDEDATA FAR PASCAL _export CallBack(WORD, WORD, HCONV, HSZ, HSZ,
HDDEDATA, DWORD, DWORD);
TProcInstance CallBackProc;
// Designed for Win16 applications, TProcInstance handles creating and
// freeing an instance thunk, a piece of code created for use with
// exported callback functions. (A callback function is a function that
// exists within a program but is called from outside the program by a
// Windows library routine, for example, a dialog box function.)
// For Win32 applications, TProcInstance is non-functional.
// The address returned from TProcInstance can be passed as a parameter
// to callback functions, window subclassing functions, or Windows dialog
// box functions.
// Variables
DWORD InstId;
};
class PM_GLOBAL {
public:
// Other global varialbles
bool SoundEffects;
bool ShowDataOnly;
};
#define FRAME_UNKNOWN 0x00
#define FRAME_UI 0x01
#define FRAME_UA 0x02
#define FRAME_RR 0x03
#define FRAME_REJ 0x04
#define FRAME_DM 0x05
#define FRAME_DISC 0x06
#define FRAME_I 0x07
#define FRAME_SABM 0x08
class FRAME {
public:
int frametype;
void set(char *s);
char *getstr(void);
int get() { return(frametype); };
};
class PACKMONWnd : public TFrameWindow, PM_GLOBAL {
public:
// Constructor and Destructor
PACKMONWnd(TWindow *parent, const char *Window_title);
virtual ~PACKMONWnd();
virtual void SetupWindow();
// DDE functions
int PM_Init_DDE();
int PM_Exit_DDE();
int DDE_Connected;
void TXDATA(char *str,int count);
void SetScrollDim();
LRESULT WMFONTS(WPARAM wp,LPARAM);
void EvPaint();
void pmWinPaint(TDC& dc, bool erase, TRect& rect);
char *GetLine(int start);
void DispMonText(char *s);
void get_PEheard(void); // Get heard list from packet engine.
void EvInitMenu(HMENU menuHandle);
void CmConnect(void);
void CmDisConnect(void);
void CmFileOpen(void);
void CmToggleSoundEffects(void);
void CmToggleDataOnly(void);
void CmHelpAbout(void);
// Dummies
void CmRequest(void);
void CmPoke(void);
void CmAdvise(void);
////////////////////////////
// Variables
////////////////////////////
// Font variables
LOGFONT cursfont; // font structure
HFONT holdsfont; // handle of original font
HFONT hnewsfont; // handle of new fixed font
HFONT hfont;
int TextHeight;
// Global window variables
bool CanIClose;
// Instance variables
DWORD InstId() {
return ((PM_APPL*)GetApplication())->InstId;
}
// DDE variables
HCONV hConv[2];
HSZ Service;
HSZ Topic;
HSZ Item;
char Data[128];
void ReceivedData(HDDEDATA);
void ReceivedData(char *s);
LRESULT Ev_Msg_Char(WPARAM wp,LPARAM);
bool IsMultiCall(char *call);
DECLARE_RESPONSE_TABLE(PACKMONWnd);
};