📄 main.cpp
字号:
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Use of this sample source code is subject to the terms of the Microsoft
// license agreement under which you licensed this sample source code. If
// you did not accept the terms of the license agreement, you are not
// authorized to use this sample source code. For the terms of the license,
// please see the license agreement between you and Microsoft or, if applicable,
// see the LICENSE.RTF on your install media or the root of your tools installation.
// THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES.
//
#include <windows.h>
#include <initguid.h>
#include <pimstore.h>
#include "DisplayItem.hpp"
#include "ControlDefinitions.h"
#include "InfoApp.hpp"
#include "Common.hpp"
HINSTANCE GlobalData_t::s_ModuleInstance = NULL;
GDICache_t GlobalData_t::s_GDICacheObject;
InfoApp_t* PhInfoGlobalData_t::pPhInfoApp = NULL;
MemTrackInitialize();
INT WINAPI WinMain(
HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow
)
{
HANDLE hSingleton;
if (!PHRegisterSingletonApplication(L"PHInfoApplicationSingleton", &hSingleton))
{
return InfoApp_t::s_SendCommandLine(lpCmdLine);
}
HRESULT hr;
hr = CoInitializeEx(
NULL,
COINIT_MULTITHREADED
);
if (FAILED(hr))
{
goto exit;
}
if (!PHInitCommonControls())
{
hr = E_FAIL;
goto exit;
}
GlobalData_t::s_ModuleInstance = hInstance;
PhInfoGlobalData_t::pPhInfoApp = new InfoApp_t();
if (PhInfoGlobalData_t::pPhInfoApp == NULL)
{
hr = E_OUTOFMEMORY;
goto exit;
}
hr = PhInfoGlobalData_t::pPhInfoApp->Run(lpCmdLine);
exit:
PHUnInitCommonControls();
if (PhInfoGlobalData_t::pPhInfoApp)
{
delete PhInfoGlobalData_t::pPhInfoApp;
}
if (hSingleton != NULL)
{
CloseHandle(hSingleton);
}
CoUninitialize();
MemTrackCheck();
return hr;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -