mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 16:43:04 +00:00
[RAPPS] Cleanup
This commit is contained in:
parent
22e58e68aa
commit
6f9dd96dcf
3 changed files with 15 additions and 95 deletions
|
@ -19,51 +19,20 @@ HWND hMainWnd;
|
|||
HINSTANCE hInst;
|
||||
SETTINGS_INFO SettingsInfo;
|
||||
|
||||
class CRAppsModule : public CComModule
|
||||
{
|
||||
public:
|
||||
};
|
||||
|
||||
BEGIN_OBJECT_MAP(ObjectMap)
|
||||
END_OBJECT_MAP()
|
||||
|
||||
CRAppsModule gModule;
|
||||
CComModule gModule;
|
||||
CAtlWinModule gWinModule;
|
||||
|
||||
Gdiplus::GdiplusStartupInput gdiplusStartupInput;
|
||||
ULONG_PTR gdiplusToken;
|
||||
|
||||
|
||||
static VOID InitializeAtlModule(HINSTANCE hInstance, BOOL bInitialize)
|
||||
{
|
||||
if (bInitialize)
|
||||
{
|
||||
gModule.Init(ObjectMap, hInstance, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
gModule.Term();
|
||||
}
|
||||
}
|
||||
|
||||
VOID InitializeGDIPlus(BOOL bInitialize)
|
||||
{
|
||||
if (bInitialize)
|
||||
{
|
||||
Gdiplus::GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
Gdiplus::GdiplusShutdown(gdiplusToken);
|
||||
}
|
||||
}
|
||||
|
||||
INT WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, INT nShowCmd)
|
||||
{
|
||||
BOOL bIsFirstLaunch;
|
||||
Gdiplus::GdiplusStartupInput gdiplusStartupInput;
|
||||
ULONG_PTR gdiplusToken;
|
||||
|
||||
InitializeAtlModule(hInstance, TRUE);
|
||||
InitializeGDIPlus(TRUE);
|
||||
gModule.Init(ObjectMap, hInstance, NULL);
|
||||
Gdiplus::GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
|
||||
|
||||
if (GetUserDefaultUILanguage() == MAKELANGID(LANG_HEBREW, SUBLANG_DEFAULT))
|
||||
{
|
||||
|
@ -72,7 +41,7 @@ INT WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLi
|
|||
|
||||
hInst = hInstance;
|
||||
|
||||
bIsFirstLaunch = !LoadSettings(&SettingsInfo);
|
||||
BOOL bIsFirstLaunch = !LoadSettings(&SettingsInfo);
|
||||
if (bIsFirstLaunch)
|
||||
{
|
||||
FillDefaultSettings(&SettingsInfo);
|
||||
|
@ -84,8 +53,8 @@ INT WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLi
|
|||
// parse cmd-line and perform the corresponding operation
|
||||
BOOL bSuccess = ParseCmdAndExecute(GetCommandLineW(), bIsFirstLaunch, SW_SHOWNORMAL);
|
||||
|
||||
InitializeGDIPlus(FALSE);
|
||||
InitializeAtlModule(GetModuleHandle(NULL), FALSE);
|
||||
Gdiplus::GdiplusShutdown(gdiplusToken);
|
||||
gModule.Term();
|
||||
|
||||
return bSuccess ? 0 : 1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue