/*==MAINWIN.H=========================================================*/ /* */ /* Module : MAINWIN */ /* */ /* Project : FINGER */ /* */ /* Description: Main window of Finger */ /* */ /*--------------------------------------------------------------------*/ /* */ /* (c) Enter AG, Zrich, 1993 */ /* */ /*--------------------------------------------------------------------*/ /* */ /* Author(s) : Hartwig Thomas */ /* */ /* Started : 24. March 1993 */ /* */ /* Finished : 29. March 1993 */ /* */ /*--------------------------------------------------------------------*/ /* */ /* Modifications: */ /* */ /* AUTHOR | DATE | COMMENT */ /* ----------------|--------------|-------------------------------- */ /* | | */ /* | | */ /* */ /*====================================================================*/ #ifndef MAINWIN_DEF #define MAINWIN_DEF #ifndef __WINDOWS_H #include #endif #ifndef __OWL_H #include #endif #ifndef _WINSOCKAPI_ extern "C" { #include "winsock.h" }; #endif #ifndef FINGER_DEF #include "finger.h" #endif /*====================================================================*/ /* Main window has a procedure for each menu item */ /*====================================================================*/ _CLASSDEF(TMainWin) class TMainWin : public TWindow { private: char szClassName[STRSIZESHORT+1]; // saved cursor used in StartWait/EndWait HCURSOR hcurSave; // sockets SOCKET fclient; SOCKET fserver; SOCKET fconnect; // "well known" port number int fingerport; // buffer for display char szBuffer[BUFFERSIZE+1]; // message to be sent by finger server char szFingerMessage[STRSIZELONG+1]; //--- General Utilities --- // StartWait/EndWait toggle cursor void StartWait() {hcurSave = SetCursor(LoadCursor(NULL,IDC_WAIT));} void EndWait() {SetCursor(hcurSave);} //--- End of General Utilities --- void InitErrorMsg(int iMsg); // message box / closes application void ClientErrorMsg(int iMsg); // message box / closes fclient void ServerErrorMsg(int iMsg); // message box / closes fserver void InputErrorMsg(int iMsg); // message box / closes fconnect public: // constructor assigns menu TMainWin(LPSTR szTitle); // destructor ~TMainWin(); // window class... virtual LPSTR GetClassName(); // ...for icon virtual void GetWindowClass( WNDCLASS _FAR & AWndClass ); // SetupWindow starts the WSA virtual void SetupWindow(); // ShutDownWindow closes open sockets and cleans up virtual void ShutDownWindow(); // Paint virtual void Paint( HDC PaintDC, PAINTSTRUCT _FAR & PaintInfo); // EnableMenuItems void EnableMenuItems(); // menu commands virtual void CMClient(RTMessage Msg) = [CM_FIRST + IDM_CLIENT]; virtual void CMServer(RTMessage Msg) = [CM_FIRST + IDM_SERVER]; virtual void CMCancel(RTMessage Msg) = [CM_FIRST + IDM_CANCEL]; virtual void CMAbout(RTMessage Msg) = [CM_FIRST + IDM_ABOUT]; // user messages virtual void UMConnect(RTMessage Msg) = [WM_USER+UM_CONNECT]; virtual void UMData(RTMessage Msg) = [WM_USER+UM_DATA]; }; #endif /*-End of MAINWIN.H---------------------------------------------------*/