⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 inter.h

📁 Dialogic数字板卡示例程序
💻 H
字号:
/****************************************************************************
*	Interface.h
*
*	This file will have the prototypes and the defines that relate to the 
*	interface of the Asynchronous demo
*
*	
************************************************************************/
#include <windows.h>
#include <windowsx.h>
#include "resource.h"
#include "answer.h"
#include "display.h"
#include "srllib.h"
#include "dxxxlib.h"
#include "dtilib.h"
#include "gclib.h"
#include "gcerr.h"

/*
 * definitions for the interface
 */
#define FONT_HEIGHT 12
#define ROW_HEIGHT (FONT_HEIGHT + 3)
#define FONT_WIDTH 8
#define FONT_TYPE "Ariel"
#define CHAN_BASE_ROW 4
#define NUM_ROWS (CHAN_BASE_ROW + MAXCHANS)  

#define MAIN_HEIGHT (NUM_ROWS * (ROW_HEIGHT))

/*
 * definitions for the stopping cause
 */
#define	NONE		-1
#define	USER_STOP	1
#define DISCONNECT	2

/**
 **   Data structure which defines the states for each channel
 **/
typedef struct dx_info {
   char     dev_name[ 100 ];	/* The device name( Vox and Dti ) */
   LINEDEV	ldev;				/* Line Device for GC */
   CRN		crn;				/* Call Reference Number for GC */
   int	    chdev;				/* Channel Device Descriptor    */
   int	    tsdev;				/* Timeslot Device Descriptor   */
   int		stop_cause;			/* A cause for stopping while channel is working */
   DV_DIGIT digbuf;				/* Buffer for DTMF Digits       */
   char	    file_name[ MAXMSG+1 ];	/* Playing or Recording Filename */
   char	    ac_code[ MAXDTMF+1 ];	/* Access Code for this Channel */
} DX_INFO;

/************************************************************************
*	FUNCTION :		InitApplication()
*	DESCRIPTION :	this function creates and registers the windows that
*					are used in this application
*	INPUTS :		The instance of the application.  
*	OUTPUTS :		TRUE or FALSE
************************************************************************/
BOOL InitApplication(HINSTANCE hInstance);


/****************************************************************************
*	FUNCTION:		InitMainWndInstance(HINSTANCE, int)
*	DESCRIPTION :	Saves instance handle and creates main window
*	INPUTS :		The instance of the  application and the Command concerning
*					the visibility of the window (MINIMIZED/MAXIMIZED)
*	OUTPUTS :		TRUE/FALSE
*	COMMENTS:		This function is called at initialization time for every 
*					instance of this application.  This function performs 
*					initialization tasks that cannot be shared by multiple instances.
*					In this case, we save the instance handle in a static variable 
*					and	create and display the main program window.
*
****************************************************************************/
BOOL InitMainWndInstance(HINSTANCE	hInstance,int nCmdShow);


/****************************************************************************
*	FUNCTION:		WndProc(HWND, UINT, WPARAM, LPARAM)
*	DESCRIPTION :	Processes messages for the main window of the application
*	INPUTS :		the handle to the window (can be used by more than one)
*					the message and message specific parameters
*	OUTPUTS :		NA
*	CAUTIONS :		This function is called internally by Windows (it is a 
*					callback function) anytime an event occurs within (or that
*					affects) that window.
****************************************************************************/
WINAPI WndProc(
		HWND hWnd,         // window handle
		UINT message,      // type of message
		WPARAM wParam,     // additional information
		LPARAM lParam);    // additional information


/***************************************************************
*	FUNCTION :		WinMain()
*	DESCRIPTION :	This is the main() of a windows app.  It contains
*					the Windows msg loop.
*	INPUTS :		the instance data, command line data
*	OUTPUTS :		response to OS
****************************************************************/
int WINAPI WinMain(
	HINSTANCE hInstance,
	HINSTANCE hPrevInstance,
	LPSTR lpCmdLine,
	int nCmdShow);


/***********************************************************************
*	FUNCITON :		ChildWndProc()
*	DESCRIPTION :	This function handles all of the messages that are passed to
*					the child windows.
*	INPUTS :		the handle to the window, the message and msg specific
*					parameters
*	
*************************************************************************/
WINAPI ChildWndProc(HWND hChild, UINT msg, WPARAM wParam, LPARAM lParam);


/***************************************************************************
*	FUNCTION :		PrintError()
*	DESCRIPTION :	This function will take any string parameters in the printf
*					format and will appent the error number of the last Windows 
*					error to it and display it in a MessageBox
*	INPUTS :		the printf wtyle string
*	OUTPUTS :		the message box
***************************************************************************/
void PrintError(char *szFormat, ...);


/***************************************************************************
*	FUNCTION :		RedrawRows(HWND hwnd, HDC hdc)
*	DESCRIPTION :	Redraws, row by row, the string which are to appear in our
*               main window.  Note these rows are found in the global
*               variable "gRowVal[][]".
*	INPUTS : the window to draw them in (here, the main window always)
*          the windows DC
*	OUTPUTS : rows rewitten in our main window
***************************************************************************/
void RedrawRows(HWND hwnd, HDC hdc);


/***************************************************************************
*	FUNCTION :		StartApp()
*	DESCRIPTION :	This function will dump the information to the window
*	INPUTS :		status of channels
*	OUTPUTS :		text (to the window)
***************************************************************************/
void StartApp();

/***************************************************************************
*	FUNCTION :		CheckDtiBoard()
*	DESCRIPTION :	This function will check the type of dti board and change
*					the attribute of Protocol Box and Voice Box
*	INPUTS :		The HWND and The dti board number.
*	OUTPUTS :		text (to the Protocol Box and the Voice Box)
***************************************************************************/
void CheckBoxes( HWND hwnd );

BOOL CALLBACK CSET_WndProc(HWND , UINT , WPARAM , LPARAM );	// Options/channel settings menu dialog box Handler
BOOL CALLBACK AboutDlgProc (HWND , UINT , WPARAM , LPARAM );
void ANSREXW_OnCommand(HWND , int , HWND , UINT );				// Window's WM_COMMAND handler
BOOL CSET_OnInitDialog(HWND , HWND , LPARAM );
void CSET_OnCommand(HWND , int , HWND , UINT );
BOOL BuildChanName(HANDLE);
int  GetDigitalBoard();

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -