2015-04-22 16:53:55 +00:00
|
|
|
/*
|
2017-09-09 20:38:06 +00:00
|
|
|
* PROJECT: ReactOS Applications Manager
|
2020-07-31 19:57:35 +00:00
|
|
|
* LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
|
2017-09-09 20:38:06 +00:00
|
|
|
* PURPOSE: Main program
|
2023-02-28 00:00:29 +00:00
|
|
|
* COPYRIGHT: Copyright 2009 Dmitry Chapyshev (dmitry@reactos.org)
|
2017-09-09 20:38:06 +00:00
|
|
|
* Copyright 2015 Ismael Ferreras Morezuelas (swyterzone+ros@gmail.com)
|
2023-02-28 00:00:29 +00:00
|
|
|
* Copyright 2017 Alexander Shaposhnikov (sanchaez@reactos.org)
|
2015-04-22 16:53:55 +00:00
|
|
|
*/
|
|
|
|
#include "rapps.h"
|
2017-08-15 19:36:23 +00:00
|
|
|
#include "unattended.h"
|
2020-08-29 12:32:59 +00:00
|
|
|
#include "winmain.h"
|
2015-04-23 23:08:21 +00:00
|
|
|
#include <atlcom.h>
|
2020-06-14 13:22:58 +00:00
|
|
|
#include <gdiplus.h>
|
2020-08-25 09:06:30 +00:00
|
|
|
#include <conutils.h>
|
|
|
|
|
2023-02-20 18:30:02 +00:00
|
|
|
LPCWSTR szWindowClass = L"ROSAPPMGR2";
|
2020-08-25 09:06:30 +00:00
|
|
|
|
2015-04-22 16:53:55 +00:00
|
|
|
HWND hMainWnd;
|
|
|
|
HINSTANCE hInst;
|
|
|
|
SETTINGS_INFO SettingsInfo;
|
|
|
|
|
2015-04-23 23:08:21 +00:00
|
|
|
BEGIN_OBJECT_MAP(ObjectMap)
|
|
|
|
END_OBJECT_MAP()
|
|
|
|
|
2021-09-30 18:19:05 +00:00
|
|
|
CComModule gModule;
|
2017-07-10 21:02:24 +00:00
|
|
|
CAtlWinModule gWinModule;
|
2015-04-23 23:08:21 +00:00
|
|
|
|
2023-02-20 18:30:02 +00:00
|
|
|
INT WINAPI
|
|
|
|
wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, INT nShowCmd)
|
2017-08-08 21:32:11 +00:00
|
|
|
{
|
2021-09-30 18:19:05 +00:00
|
|
|
Gdiplus::GdiplusStartupInput gdiplusStartupInput;
|
|
|
|
ULONG_PTR gdiplusToken;
|
2021-09-13 01:33:14 +00:00
|
|
|
|
2021-09-30 18:19:05 +00:00
|
|
|
gModule.Init(ObjectMap, hInstance, NULL);
|
|
|
|
Gdiplus::GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
|
2015-04-23 23:08:21 +00:00
|
|
|
|
2017-08-08 21:32:11 +00:00
|
|
|
if (GetUserDefaultUILanguage() == MAKELANGID(LANG_HEBREW, SUBLANG_DEFAULT))
|
2015-04-22 16:53:55 +00:00
|
|
|
{
|
2017-07-10 21:02:24 +00:00
|
|
|
SetProcessDefaultLayout(LAYOUT_RTL);
|
2015-04-22 16:53:55 +00:00
|
|
|
}
|
|
|
|
|
2020-09-20 20:18:08 +00:00
|
|
|
hInst = hInstance;
|
2015-04-22 16:53:55 +00:00
|
|
|
|
2021-09-30 18:19:05 +00:00
|
|
|
BOOL bIsFirstLaunch = !LoadSettings(&SettingsInfo);
|
2017-08-26 08:39:42 +00:00
|
|
|
if (bIsFirstLaunch)
|
2015-04-22 16:53:55 +00:00
|
|
|
{
|
|
|
|
FillDefaultSettings(&SettingsInfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
InitLogs();
|
|
|
|
InitCommonControls();
|
|
|
|
|
2020-08-25 09:06:30 +00:00
|
|
|
// parse cmd-line and perform the corresponding operation
|
|
|
|
BOOL bSuccess = ParseCmdAndExecute(GetCommandLineW(), bIsFirstLaunch, SW_SHOWNORMAL);
|
2021-09-13 01:33:14 +00:00
|
|
|
|
2021-09-30 18:19:05 +00:00
|
|
|
Gdiplus::GdiplusShutdown(gdiplusToken);
|
|
|
|
gModule.Term();
|
2015-04-23 23:08:21 +00:00
|
|
|
|
2020-08-25 09:06:30 +00:00
|
|
|
return bSuccess ? 0 : 1;
|
2015-04-22 16:53:55 +00:00
|
|
|
}
|