reactos/base/applications/rapps/winmain.cpp

58 lines
1.6 KiB
C++
Raw Normal View History

/*
* 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>
[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: 5bc6d5914288283606c339534c65ceb81af663e5 [RAPPS] Refresh item info after installer completes (#7697) d5ce3d28abb48c0a1e0b40f7c6802154433c9ac2 [RAPPS] Don't display Freeware license string if the type is also Freeware (#7689) b35becef2eb507c90d5b6d4a8c66a2647445cde1 [RAPPS] Set working directory for zip generated shortcuts (#7674) a23db39c8a422b40c3deab643996aac6e775217d [RAPPS] Allow database to override download filename (#7668) c8b2c4c94d7830ffd924133dfa548e3fea7169b9 [RAPPS] Check Let's Encrypt issuer prefix (#7650) 72951421e6780b85ac1254f7561425ef3b6eb5a9 [RAPPS] Reuse active pending downloads window (#7648) 91b8923601ff4ef4cf47c4fd0b004de1f1db3aa2 [RAPPS] Allow .zip generated installers to skip writing the DisplayIcon value (#7609) 2834e5b3c8435512b54df952e4e3cbf291af86df [RAPPS] Initialize SHBrowseForFolder to current download folder (#7505) 9164e9f85fcd20f4a81cd6de04d1d53aec01cf9d [RAPPS] Update Slovak (sk-SK) translation (#7450) 873488927202bed66a91fa975dc02cdc20c64afb [RAPPS] Update Turkish (tr-TR) translation (#7372) 16f1abe1c872b775ffcba647ed4f4d7335b73f70 [RAPPS] Improve Romanian (ro-RO) translation (#7360) 2f83e6a65d5878f2ca0f56bf610eed0da295d9da [RAPPS] Use different mutex and title for AppWiz mode (#7350) 301675c112f65de2ae1f1cc0a1378ecb90df9613 [RAPPS] Respect partial settings configuration (#7247) 053939e27cbf4d6475fb33b6fc16199bd944880d [RAPPS] Hide the main window during active download/install if the user closes it (#7014) 3ff8adc5537f5b0555708d6f72b635744adcf3ca [RAPPS] Protect database update with a mutex (#7006) 4e598589410e30707b6a69000ed4ebed857237b3 [RAPPS] Change the "Welcome" text with a suitable explanatory one in APPWIZ-mode (#6655) 2af6fd4defce9b7766c56bf565af5f675f6d2f79 [PSDK] Add GetMenuPosFromID() declaration in shlwapi.h
2025-02-17 20:01:35 -07:00
LPCWSTR szWindowClass = MAINWINDOWCLASSNAME;
LONG g_Busy = 0;
HWND hMainWnd;
HINSTANCE hInst;
SETTINGS_INFO SettingsInfo;
BEGIN_OBJECT_MAP(ObjectMap)
END_OBJECT_MAP()
2021-09-30 20:19:05 +02:00
CComModule gModule;
CAtlWinModule gWinModule;
INT WINAPI
wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, INT nShowCmd)
{
2021-09-30 20:19:05 +02:00
Gdiplus::GdiplusStartupInput gdiplusStartupInput;
ULONG_PTR gdiplusToken;
2021-09-30 20:19:05 +02:00
gModule.Init(ObjectMap, hInstance, NULL);
Gdiplus::GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
if (GetUserDefaultUILanguage() == MAKELANGID(LANG_HEBREW, SUBLANG_DEFAULT))
{
SetProcessDefaultLayout(LAYOUT_RTL);
}
hInst = hInstance;
2021-09-30 20:19:05 +02:00
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);
2021-09-30 20:19:05 +02:00
Gdiplus::GdiplusShutdown(gdiplusToken);
gModule.Term();
return bSuccess ? 0 : 1;
}