📄 infobox.cpp
字号:
// InfoBox.cpp : implementation file
//
#include "stdafx.h"
#include "OkMfc.h"
#include "InfoBox.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#include "okapi32.h"
extern HANDLE hBoard;
extern long iCurrUsedNo;
extern long dwBufSize;
extern DWORD dwMaxMemSize;
/////////////////////////////////////////////////////////////////////////////
// CInfoBox dialog
CInfoBox::CInfoBox(CWnd* pParent /*=NULL*/)
: CDialog(CInfoBox::IDD, pParent)
{
//{{AFX_DATA_INIT(CInfoBox)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CInfoBox::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CInfoBox)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CInfoBox, CDialog)
//{{AFX_MSG_MAP(CInfoBox)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CInfoBox message handlers
BOOL CInfoBox::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
{
// TODO: Add your specialized code here and/or call the base class
return CDialog::Create(IDD, pParentWnd);
}
int CInfoBox::DoModal()
{
// TODO: Add your specialized code here and/or call the base class
return CDialog::DoModal();
}
BOOL CInfoBox::OnInitDialog()
{
CDialog::OnInitDialog();
int total;
BOARDTYPE *lpBoardInfo;
int number,blknum;
char str[200];
char tstr[100];
long bufbits,bufsize;
LPBYTE lpPhys,lpLinear;
total=okGetSlotBoard(&lpBoardInfo);
GetDlgItemText(IDC_CURRUSED, str, 90);
sprintf(str+strlen(str), " %s (No. %d)", lpBoardInfo[iCurrUsedNo].szBoardName, iCurrUsedNo);
SetDlgItemText(IDC_CURRUSED, str);
GetDlgItemText(IDC_BUFFERSIZE, str, 90);
lpPhys = (LPBYTE)okGetAvailBuffer((void**)&lpLinear, (DWORD*)&dwBufSize);
sprintf(str+strlen(str), " %X(%X): %d K ", lpPhys, lpLinear, dwBufSize/1024);
SetDlgItemText(IDC_BUFFERSIZE, str);
GetDlgItemText(IDC_FRAMESIZE, str, 90);
bufbits = HIWORD(okSetCaptureParam(hBoard, CAPTURE_BUFRGBFORMAT, GETCURRPARAM)); //-1
bufsize = okSetCaptureParam(hBoard, CAPTURE_BUFBLOCKSIZE, GETCURRPARAM); //-1
number = okGetBufferSize(hBoard, NULL, NULL);
blknum = okGetMemBlock(hBoard, NULL, NULL);
sprintf(str+strlen(str), "%d+%d (%dx%dx%d)", number-blknum, blknum,
LOWORD(bufsize), HIWORD(bufsize), bufbits);
SetDlgItemText(IDC_FRAMESIZE, str);
GetDlgItemText(IDC_MEMORYSIZE, str, 90);
sprintf(str+strlen(str), " %d K", dwMaxMemSize/1024);
SetDlgItemText(IDC_MEMORYSIZE, str);
okGetProgramInfo(VERSION, str, 100); //name
sprintf(tstr, "Copyright 1999-2005 Version %s", str);
SetDlgItemText(IDC_COPYRIGHT, tstr);
//okGetProgramInfo(COMPANY, str, 100); //company
//SetDlgItemText(IDC_COMPANY, str);
//okGetProgramInfo(TELFAX, str, 100); //telfax
//SetDlgItemText(IDC_TELFAX, str);
return TRUE;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -