📄 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 "settingsApp.hpp"
#include "ControlDefinitions.h"
#include "Layout.hpp"
#ifdef DEBUG
//Debug zone information
DBGPARAM dpCurSettings =
{
//Module name
L"PHSettings",
//Debug zone names
{
L"Error", // 1
L"", // 2 Lowest Hex Digit
L"", // 4
L"", // 8
L"", L"", L"", L"", // 2nd Hex digit
L"", L"", L"", L"", // 3rd Hex digit
L"", L"", L"", L"", // 4th Hex digit
},
//Initial debug zone mask
0x0001
};
#endif
//Global objects
SettingsApp_t* g_pSettingsApp = NULL;
INT WINAPI WinMain(
HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow
)
{
HRESULT hr = S_OK;
HANDLE hSingleton = NULL;
hr = Layout_t::InitializeRCData();
if (FAILED(hr))
{
ASSERT(0);
return hr;
}
hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
if (FAILED(hr))
{
goto exit;
}
if (!PHInitCommonControls())
{
goto exit;
}
g_pSettingsApp = new SettingsApp_t();
if (g_pSettingsApp == NULL)
{
hr = E_OUTOFMEMORY;
goto exit;
}
if (! PHRegisterSingletonApplication(L"PHSettingsSingleton", &hSingleton))
{
g_pSettingsApp->SendCommandLine(lpCmdLine);
goto exit;
}
hr = g_pSettingsApp->Run(hInstance, lpCmdLine);
exit:
if (g_pSettingsApp)
{
delete g_pSettingsApp;
g_pSettingsApp = NULL;
}
PHUnInitCommonControls();
if (hSingleton)
{
CloseHandle(hSingleton);
}
CoUninitialize();
return (SUCCEEDED(hr)) ? 0 : hr;
}
SettingsApp_t*
GetSettingsApp()
{
return g_pSettingsApp;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -