ReactOS  0.4.15-dev-1049-g1062a29
winmain.cpp
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS Applications Manager
3  * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4  * PURPOSE: Main program
5  * COPYRIGHT: Copyright 2009 Dmitry Chapyshev (dmitry@reactos.org)
6  * Copyright 2015 Ismael Ferreras Morezuelas (swyterzone+ros@gmail.com)
7  * Copyright 2017 Alexander Shaposhnikov (sanchaez@reactos.org)
8  */
9 #include "rapps.h"
10 
11 #include "unattended.h"
12 
13 #include "winmain.h"
14 
15 #include <atlcom.h>
16 
17 #include <gdiplus.h>
18 
19 #include <conutils.h>
20 
21 LPCWSTR szWindowClass = L"ROSAPPMGR";
22 
26 
27 class CRAppsModule : public CComModule
28 {
29 public:
30 };
31 
32 BEGIN_OBJECT_MAP(ObjectMap)
34 
37 
40 
41 
43 {
44  if (bInitialize)
45  {
46  gModule.Init(ObjectMap, hInstance, NULL);
47  }
48  else
49  {
50  gModule.Term();
51  }
52 }
53 
55 {
56  if (bInitialize)
57  {
59  }
60  else
61  {
63  }
64 }
65 
66 int wmain(int argc, wchar_t *argv[])
67 {
68  BOOL bIsFirstLaunch;
69 
72 
74  {
76  }
77 
79 
80  bIsFirstLaunch = !LoadSettings(&SettingsInfo);
81  if (bIsFirstLaunch)
82  {
84  }
85 
86  InitLogs();
88 
89  // parse cmd-line and perform the corresponding operation
91 
94 
95  return bSuccess ? 0 : 1;
96 }
static int argc
Definition: ServiceArgs.c:12
LANGID WINAPI GetUserDefaultUILanguage(void)
Definition: lang.c:806
static VOID InitializeAtlModule(HINSTANCE hInstance, BOOL bInitialize)
Definition: winmain.cpp:42
#define LAYOUT_RTL
Definition: wingdi.h:1370
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define TRUE
Definition: types.h:120
VOID FillDefaultSettings(PSETTINGS_INFO pSettingsInfo)
Definition: settings.cpp:167
#define SUBLANG_DEFAULT
Definition: nls.h:168
CAtlWinModule gWinModule
Definition: winmain.cpp:36
HINSTANCE hInst
Definition: winmain.cpp:24
#define argv
Definition: mplay32.c:18
#define LANG_HEBREW
Definition: nls.h:67
static BOOLEAN bSuccess
Definition: drive.cpp:419
void Term()
Definition: atlbase.h:820
uint32_t ULONG_PTR
Definition: typedefs.h:65
HRESULT Init(_ATL_OBJMAP_ENTRY *p, HINSTANCE, const GUID *plibid)
Definition: atlbase.h:797
HINSTANCE hInstance
Definition: charmap.c:20
VOID InitLogs()
Definition: misc.cpp:195
void LoadSettings(void)
Definition: settings.c:53
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
LPWSTR WINAPI GetCommandLineW(VOID)
Definition: proc.c:2015
VOID InitializeGDIPlus(BOOL bInitialize)
Definition: winmain.cpp:54
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI SetProcessDefaultLayout(DWORD dwDefaultLayout)
Definition: window.c:1720
void WINAPI GdiplusShutdown(ULONG_PTR)
Status WINAPI GdiplusStartup(ULONG_PTR *token, const struct GdiplusStartupInput *input, struct GdiplusStartupOutput *output)
Definition: gdiplus.c:81
static const WCHAR L[]
Definition: oid.c:1250
LPCWSTR szWindowClass
Definition: winmain.cpp:21
#define SW_SHOWNORMAL
Definition: winuser.h:764
Gdiplus::GdiplusStartupInput gdiplusStartupInput
Definition: winmain.cpp:38
ULONG_PTR gdiplusToken
Definition: winmain.cpp:39
#define GetModuleHandle
Definition: winbase.h:3667
int wmain(int argc, wchar_t *argv[])
Definition: winmain.cpp:66
HWND hMainWnd
Definition: winmain.cpp:23
BOOL ParseCmdAndExecute(LPWSTR lpCmdLine, BOOL bIsFirstLaunch, int nCmdShow)
Definition: unattended.cpp:237
#define MAKELANGID(p, s)
Definition: nls.h:15
#define BEGIN_OBJECT_MAP(x)
Definition: atlcom.h:649
VOID WINAPI InitCommonControls(void)
Definition: commctrl.c:863
CRAppsModule gModule
Definition: winmain.cpp:35
#define END_OBJECT_MAP()
Definition: atlcom.h:651
SETTINGS_INFO SettingsInfo
Definition: winmain.cpp:25