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

📄 soccerdoctor.cpp

📁 The application wizard has created this SoccerDoctor application for you. This application not onl
💻 CPP
字号:
// SoccerDoctor.cpp : Defines the class behaviors for the application.
//

#include "stdafx.h"
#include "SoccerDoctor.h"
#include "MainFrm.h"


#ifdef _DEBUG
#define new DEBUG_NEW
#endif


// CSoccerDoctorApp

BEGIN_MESSAGE_MAP(CSoccerDoctorApp, CWinApp)
	ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
END_MESSAGE_MAP()


// CSoccerDoctorApp construction

CSoccerDoctorApp::CSoccerDoctorApp()
{
	// TODO: add construction code here,
	// Place all significant initialization in InitInstance
}


// The one and only CSoccerDoctorApp object

CSoccerDoctorApp theApp;

// CSoccerDoctorApp initialization

BOOL CSoccerDoctorApp::InitInstance()
{
	CWinApp::InitInstance();
	
	if (!AfxSocketInit())
	{
		AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
		return FALSE;
	}

	// Initialize OLE libraries
	if (!AfxOleInit())
	{
		AfxMessageBox(IDP_OLE_INIT_FAILED);
		return FALSE;
	}
	
	AfxEnableControlContainer();
	// Standard initialization
	// If you are not using these features and wish to reduce the size
	// of your final executable, you should remove from the following
	// the specific initialization routines you do not need
	// Change the registry key under which our settings are stored
	// TODO: You should modify this string to be something appropriate
	// such as the name of your company or organization
	SetRegistryKey(_T("USTCWrightEagle"));
	// To create the main window, this code creates a new frame window
	// object and then sets it as the application's main window object
	CMainFrame* pFrame = new CMainFrame;
	m_pMainWnd = pFrame;
	
	pFrame->m_displayer.Create(IDD_DISPLAYER);
	// create and load the frame with its resources
	
	pFrame->LoadFrame(IDR_MAINFRAME,
		WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, NULL,
		NULL);
	// The one and only window has been initialized, so show and update it
	
	HICON hIcon = LoadIcon(IDR_MAINFRAME);
	pFrame->SetIcon(hIcon,FALSE);
	pFrame->SetIcon(hIcon,TRUE);
	hIcon = LoadIcon(IDI_DISPLAYER);
	pFrame->m_displayer.SetIcon(hIcon,FALSE);
	pFrame->m_displayer.SetIcon(hIcon,TRUE);
	pFrame->UpdateWindow();
	
	CRect wndRect,savedRect;
	pFrame->GetWindowRect(&wndRect);

	int value;
	value = GetProfileInt("MainFrame","Left",wndRect.left);
 
	savedRect.right = value + wndRect.Width();
	savedRect.left = value;
	value = GetProfileInt("MainFrame","Top",wndRect.top);
	savedRect.bottom = value + wndRect.Height();
	savedRect.top = value;
	CRect fullScreenRect;
	bool fullScreenRectValid = (::SystemParametersInfo(SPI_GETWORKAREA,0,&fullScreenRect,0)==TRUE);
	if( fullScreenRectValid ){
		if( savedRect.right > fullScreenRect.left && savedRect.bottom > fullScreenRect.top &&
			savedRect.left < fullScreenRect.right && savedRect.top < fullScreenRect.bottom){
			pFrame->MoveWindow(savedRect); // 窗口有一部分在屏幕内
		}
	}	
	if( GetProfileInt("Displayer","FullScreen",0) == 1){
		pFrame->m_displayer.doFullScreen();
	}else{
		pFrame->m_displayer.GetWindowRect(&wndRect);	
		value = GetProfileInt("Displayer","Left",wndRect.left);
		savedRect.left = value;
		value = GetProfileInt("Displayer","Top",wndRect.top);
		savedRect.top = value;
		value = GetProfileInt("Displayer","Right",wndRect.right);
		savedRect.right = value;
		value = GetProfileInt("Displayer","Bottom",wndRect.bottom);
		savedRect.bottom = value;
		if( fullScreenRectValid ){
			if( savedRect.right > fullScreenRect.left && savedRect.bottom > fullScreenRect.top &&
				savedRect.left < fullScreenRect.right && savedRect.top < fullScreenRect.bottom){
				pFrame->m_displayer.MoveWindow(savedRect); // 窗口有一部分在屏幕内
			}
		}
	}
	pFrame->m_displayer.ShowWindow(SW_SHOW);
    pFrame->ShowWindow(SW_SHOW);
	CCommandLineInfo cmdInfo;
	ParseCommandLine(cmdInfo);

	ProcessShellCommand(cmdInfo);

	pFrame->DragAcceptFiles();


	return TRUE;
}


// CSoccerDoctorApp message handlers



// CAboutDlg dialog used for App About

class CAboutDlg : public CDialog
{
public:
	CAboutDlg();

// Dialog Data
	enum { IDD = IDD_ABOUTBOX };

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support

// Implementation
protected:
	DECLARE_MESSAGE_MAP()
};

CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
}

void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
}

BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
END_MESSAGE_MAP()

// App command to run the dialog
void CSoccerDoctorApp::OnAppAbout()
{
	CAboutDlg aboutDlg;
	aboutDlg.DoModal();
}


// CSoccerDoctorApp message handlers
CDocument* CSoccerDoctorApp::OpenDocumentFile(LPCTSTR lpszFileName)
{
	CMainFrame *pFrame = dynamic_cast<CMainFrame*>(AfxGetMainWnd());
	if( pFrame ){
		pFrame->OpenLogFile(lpszFileName);
	}
	return NULL;//CWinApp::OpenDocumentFile(lpszFileName);
}

⌨️ 快捷键说明

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