📄 eth_tool.cpp
字号:
// eth_tool.cpp : 定义应用程序的类行为。
//
#include "stdafx.h"
#include "eth_tool.h"
#include "eth_toolDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
#define WSA_VERSION MAKEWORD(2,0)
#define MAX_HOSTNAME 256
#define MAX_HOSTADDR 40
// Ceth_toolApp
BEGIN_MESSAGE_MAP(Ceth_toolApp, CWinApp)
ON_COMMAND(ID_HELP, &CWinApp::OnHelp)
END_MESSAGE_MAP()
// Ceth_toolApp 构造
Ceth_toolApp::Ceth_toolApp()
{
// TODO: 在此处添加构造代码,
// 将所有重要的初始化放置在 InitInstance 中
}
// 唯一的一个 Ceth_toolApp 对象
Ceth_toolApp theApp;
// Ceth_toolApp 初始化
BOOL Ceth_toolApp::InitInstance()
{
WSADATA WSAData = { 0 };
if ( 0 != WSAStartup( WSA_VERSION, &WSAData ) )
{
// Tell the user that we could not find a usable
// WinSock DLL.
if ( LOBYTE( WSAData.wVersion ) != LOBYTE(WSA_VERSION) ||
HIBYTE( WSAData.wVersion ) != HIBYTE(WSA_VERSION) )
::MessageBox(NULL, _T("Incorrect version of WS2_32.dll found"), _T("Error"), MB_OK);
WSACleanup( );
return FALSE;
}
// 如果一个运行在 Windows XP 上的应用程序清单指定要
// 使用 ComCtl32.dll 版本 6 或更高版本来启用可视化方式,
//则需要 InitCommonControlsEx()。否则,将无法创建窗口。
INITCOMMONCONTROLSEX InitCtrls;
InitCtrls.dwSize = sizeof(InitCtrls);
// 将它设置为包括所有要在应用程序中使用的
// 公共控件类。
InitCtrls.dwICC = ICC_WIN95_CLASSES;
InitCommonControlsEx(&InitCtrls);
CWinApp::InitInstance();
AfxEnableControlContainer();
// 标准初始化
// 如果未使用这些功能并希望减小
// 最终可执行文件的大小,则应移除下列
// 不需要的特定初始化例程
// 更改用于存储设置的注册表项
// TODO: 应适当修改该字符串,
// 例如修改为公司或组织名
SetRegistryKey(_T("eth_tool"));
Ceth_toolDlg dlg;
m_pMainWnd = &dlg;
INT_PTR nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
// TODO: 在此处放置处理何时用“确定”来关闭
// 对话框的代码
}
else if (nResponse == IDCANCEL)
{
// TODO: 在此放置处理何时用“取消”来关闭
// 对话框的代码
}
// 由于对话框已关闭,所以将返回 FALSE 以便退出应用程序,
// 而不是启动应用程序的消息泵。
return FALSE;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -