?? secretchat.cpp
字號:
// SecretChat.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "SecretChat.h"
#include "SecretChatDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CSecretChatApp
BEGIN_MESSAGE_MAP(CSecretChatApp, CWinApp)
//{{AFX_MSG_MAP(CSecretChatApp)
//}}AFX_MSG
ON_COMMAND(ID_HELP, CWinApp::OnHelp)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CSecretChatApp construction
CSecretChatApp::CSecretChatApp()
{
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CSecretChatApp object
CSecretChatApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CSecretChatApp initialization
BOOL CSecretChatApp::InitInstance()
{
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
if( ::GlobalFindAtom("MyTimer")/*查找標(biāo)記*/ == 0)
m_ATOM = ::GlobalAddAtom("MyTimer");//添加標(biāo)記
else
{ //詢問是否還有打開另一個(gè)實(shí)例
if(MessageBox(
NULL,
"已經(jīng)有實(shí)例運(yùn)行中,是否繼續(xù)?",
"密聊",
MB_YESNO | MB_ICONQUESTION | MB_DEFBUTTON2) == IDNO)
{
return FALSE;
}
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SetRegistryKey(_T("文件密使")); //設(shè)定注冊表
if (!AfxSocketInit())
{
AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
return FALSE;
}
AfxEnableControlContainer();
// Standard initialization
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
CSecretChatDlg dlg;
m_pMainWnd = &dlg;
int nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
}
else if (nResponse == IDCANCEL)
{
}
// Since the dialog has been closed, return FALSE so that we exit the
// application, rather than start the application's message pump.
return FALSE;
}
int CSecretChatApp::ExitInstance()
{
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
::GlobalDeleteAtom( m_ATOM); //刪除標(biāo)記
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
return CWinApp::ExitInstance();
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -