📄 surfhelp.cpp
字号:
// SurfHelp.cpp : main source file for SurfHelp.exe
//
#define __g_Global__
#include "stdafx.h"
#include "resource.h"
// Note: Proxy/Stub Information
// To build a separate proxy/stub DLL,
// run nmake -f SurfHelpps.mk in the project directory.
#include "initguid.h"
#include "SurfHelp.h"
#include "SurfHelp_i.c"
#include "DlgItemResizer.h"
#include "AddFilterDlg.h"
#include "CommonInputDlg.h"
#include "PopupTitleDlg.h"
#include "PopupUrlDlg.h"
#include "PopupLogDlg.h"
#include "PopupManagerTab.h"
#include "SurfHelpView.h"
#include "aboutdlg.h"
#include "ConfigGeneralPage.h"
#include "ConfigFilterPage.h"
#include "ConfigClearPage.h"
#include "ConfigSheet.h"
#include "MainFrm.h"
#include "SurfManager.h"
CGlobal g_Global;
HANDLE g_hSingleInstance;
HWND g_hMainWnd;
CServerAppModule _Module;
BEGIN_OBJECT_MAP(ObjectMap)
OBJECT_ENTRY(CLSID_SurfManager, CSurfManager)
END_OBJECT_MAP()
int Run(LPTSTR /*lpstrCmdLine*/ = NULL, int nCmdShow = SW_SHOWDEFAULT)
{
CMessageLoop theLoop;
_Module.AddMessageLoop(&theLoop);
CMainFrame wndMain;
if(wndMain.CreateEx() == NULL)
{
ATLTRACE(_T("Main window creation failed!\n"));
return 0;
}
g_hMainWnd = wndMain.m_hWnd;
_Module.Lock();
// wndMain.ShowWindow(nCmdShow);
int nRet = theLoop.Run();
_Module.RemoveMessageLoop();
return nRet;
}
int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPTSTR lpstrCmdLine, int nCmdShow)
{
// Only run one instance
g_hSingleInstance = OpenEvent(EVENT_ALL_ACCESS, FALSE, SURFHELPER_EVENT);
if (!g_hSingleInstance)
{
g_hSingleInstance = CreateEvent(NULL, TRUE, FALSE, SURFHELPER_EVENT);
}
else
{
return 0;
}
HRESULT hRes = ::CoInitialize(NULL);
// If you are running on NT 4.0 or higher you can use the following call instead to
// make the EXE free threaded. This means that calls come in on a random RPC thread.
// HRESULT hRes = ::CoInitializeEx(NULL, COINIT_MULTITHREADED);
ATLASSERT(SUCCEEDED(hRes));
#if (_WIN32_IE >= 0x0300)
INITCOMMONCONTROLSEX iccx;
iccx.dwSize = sizeof(iccx);
iccx.dwICC = ICC_COOL_CLASSES | ICC_BAR_CLASSES;
BOOL bRet = ::InitCommonControlsEx(&iccx);
bRet;
ATLASSERT(bRet);
#else
::InitCommonControls();
#endif
hRes = _Module.Init(ObjectMap, hInstance);
ATLASSERT(SUCCEEDED(hRes));
int nRet = 0;
TCHAR szTokens[] = _T("-/");
bool bRun = true;
bool bAutomation = false;
LPCTSTR lpszToken = _Module.FindOneOf(::GetCommandLine(), szTokens);
while(lpszToken != NULL)
{
if(lstrcmpi(lpszToken, _T("UnregServer")) == 0)
{
nRet = _Module.UnregisterServer();
bRun = false;
break;
}
else if(lstrcmpi(lpszToken, _T("RegServer")) == 0)
{
nRet = _Module.RegisterServer(TRUE);
bRun = false;
break;
}
else if((lstrcmpi(lpszToken, _T("Automation")) == 0) ||
(lstrcmpi(lpszToken, _T("Embedding")) == 0))
{
// bAutomation = true;
break;
}
lpszToken = _Module.FindOneOf(lpszToken, szTokens);
}
if(bRun)
{
_Module.StartMonitor();
hRes = _Module.RegisterClassObjects(CLSCTX_LOCAL_SERVER, REGCLS_MULTIPLEUSE | REGCLS_SUSPENDED);
ATLASSERT(SUCCEEDED(hRes));
hRes = ::CoResumeClassObjects();
ATLASSERT(SUCCEEDED(hRes));
if(bAutomation)
{
CMessageLoop theLoop;
nRet = theLoop.Run();
}
else
{
nRet = Run(lpstrCmdLine, nCmdShow);
}
_Module.RevokeClassObjects();
::Sleep(_Module.m_dwPause);
}
_Module.Term();
::CoUninitialize();
return nRet;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -