reactos/base/applications/rapps/winmain.cpp
Carl J. Bialorucki b5c1fdc1cc [0.4.15][RAPPS] Backport current RAPPS into 0.4.15
This is a squashed backport of RAPPS from current master into the 0.4.15 release tree. All of these changes were deemed stable and complete.

This backport includes the following commits:
5bc6d59142 [RAPPS] Refresh item info after installer completes (#7697)
d5ce3d28ab [RAPPS] Don't display Freeware license string if the type is also Freeware (#7689)
b35becef2e [RAPPS] Set working directory for zip generated shortcuts (#7674)
a23db39c8a [RAPPS] Allow database to override download filename (#7668)
c8b2c4c94d [RAPPS] Check Let's Encrypt issuer prefix (#7650)
72951421e6 [RAPPS] Reuse active pending downloads window (#7648)
91b8923601 [RAPPS] Allow .zip generated installers to skip writing the DisplayIcon value (#7609)
2834e5b3c8 [RAPPS] Initialize SHBrowseForFolder to current download folder (#7505)
9164e9f85f [RAPPS] Update Slovak (sk-SK) translation (#7450)
8734889272 [RAPPS] Update Turkish (tr-TR) translation (#7372)
16f1abe1c8 [RAPPS] Improve Romanian (ro-RO) translation (#7360)
2f83e6a65d [RAPPS] Use different mutex and title for AppWiz mode (#7350)
301675c112 [RAPPS] Respect partial settings configuration (#7247)
053939e27c [RAPPS] Hide the main window during active download/install if the user closes it (#7014)
3ff8adc553 [RAPPS] Protect database update with a mutex (#7006)
4e59858941 [RAPPS] Change the "Welcome" text with a suitable explanatory one in APPWIZ-mode (#6655)
2af6fd4def [PSDK] Add GetMenuPosFromID() declaration in shlwapi.h
2025-02-17 20:07:25 -07:00

57 lines
1.6 KiB
C++

/*
* PROJECT: ReactOS Applications Manager
* LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
* PURPOSE: Main program
* COPYRIGHT: Copyright 2009 Dmitry Chapyshev (dmitry@reactos.org)
* Copyright 2015 Ismael Ferreras Morezuelas (swyterzone+ros@gmail.com)
* Copyright 2017 Alexander Shaposhnikov (sanchaez@reactos.org)
*/
#include "rapps.h"
#include "unattended.h"
#include "winmain.h"
#include <atlcom.h>
#include <gdiplus.h>
#include <conutils.h>
LPCWSTR szWindowClass = MAINWINDOWCLASSNAME;
LONG g_Busy = 0;
HWND hMainWnd;
HINSTANCE hInst;
SETTINGS_INFO SettingsInfo;
BEGIN_OBJECT_MAP(ObjectMap)
END_OBJECT_MAP()
CComModule gModule;
CAtlWinModule gWinModule;
INT WINAPI
wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, INT nShowCmd)
{
Gdiplus::GdiplusStartupInput gdiplusStartupInput;
ULONG_PTR gdiplusToken;
gModule.Init(ObjectMap, hInstance, NULL);
Gdiplus::GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
if (GetUserDefaultUILanguage() == MAKELANGID(LANG_HEBREW, SUBLANG_DEFAULT))
{
SetProcessDefaultLayout(LAYOUT_RTL);
}
hInst = hInstance;
BOOL bIsFirstLaunch = !LoadSettings(&SettingsInfo);
InitLogs();
InitCommonControls();
SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL); // Give UI higher priority than background threads
// parse cmd-line and perform the corresponding operation
BOOL bSuccess = ParseCmdAndExecute(GetCommandLineW(), bIsFirstLaunch, SW_SHOWNORMAL);
Gdiplus::GdiplusShutdown(gdiplusToken);
gModule.Term();
return bSuccess ? 0 : 1;
}