ReactOS  0.4.15-dev-3302-ga37d9a4
unattended.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define CMD_KEY_INSTALL   L"INSTALL"
 
#define CMD_KEY_SETUP   L"SETUP"
 
#define CMD_KEY_FIND   L"FIND"
 
#define CMD_KEY_INFO   L"INFO"
 
#define CMD_KEY_HELP   L"?"
 
#define CMD_KEY_HELP_ALT   L"HELP"
 

Functions

BOOL ParseCmdAndExecute (LPWSTR lpCmdLine, BOOL bIsFirstLaunch, int nCmdShow)
 

Variables

const WCHAR UsageString []
 

Macro Definition Documentation

◆ CMD_KEY_FIND

#define CMD_KEY_FIND   L"FIND"

Definition at line 5 of file unattended.h.

◆ CMD_KEY_HELP

#define CMD_KEY_HELP   L"?"

Definition at line 7 of file unattended.h.

◆ CMD_KEY_HELP_ALT

#define CMD_KEY_HELP_ALT   L"HELP"

Definition at line 8 of file unattended.h.

◆ CMD_KEY_INFO

#define CMD_KEY_INFO   L"INFO"

Definition at line 6 of file unattended.h.

◆ CMD_KEY_INSTALL

#define CMD_KEY_INSTALL   L"INSTALL"

Definition at line 3 of file unattended.h.

◆ CMD_KEY_SETUP

#define CMD_KEY_SETUP   L"SETUP"

Definition at line 4 of file unattended.h.

Function Documentation

◆ ParseCmdAndExecute()

BOOL ParseCmdAndExecute ( LPWSTR  lpCmdLine,
BOOL  bIsFirstLaunch,
int  nCmdShow 
)

Definition at line 238 of file unattended.cpp.

239 {
240  INT argc;
241  LPWSTR *argv = CommandLineToArgvW(lpCmdLine, &argc);
242 
243  if (!argv)
244  {
245  return FALSE;
246  }
247 
248  if (argc == 1) // RAPPS is launched without options
249  {
250  // Check for if rapps MainWindow is already launched in another process
251  HANDLE hMutex;
252 
254  if ((!hMutex) || (GetLastError() == ERROR_ALREADY_EXISTS))
255  {
256  /* If already started, it is found its window */
257  HWND hWindow = FindWindowW(szWindowClass, NULL);
258 
259  /* Activate window */
260  ShowWindow(hWindow, SW_SHOWNORMAL);
261  SetForegroundWindow(hWindow);
262  return FALSE;
263  }
264 
265  if (SettingsInfo.bUpdateAtStart || bIsFirstLaunch)
267 
268  MainWindowLoop(nCmdShow);
269 
270  if (hMutex)
272 
273  return TRUE;
274  }
275 
277  {
278  return HandleInstallCommand(argv[1], argc - 2, argv + 2);
279  }
280  else if (MatchCmdOption(argv[1], CMD_KEY_SETUP))
281  {
282  return HandleSetupCommand(argv[1], argc - 2, argv + 2);
283  }
284 
286 
288  {
289  return HandleFindCommand(argv[1], argc - 2, argv + 2);
290  }
291  else if (MatchCmdOption(argv[1], CMD_KEY_INFO))
292  {
293  return HandleInfoCommand(argv[1], argc - 2, argv + 2);
294  }
296  {
298  return TRUE;
299  }
300  else
301  {
302  // unrecognized/invalid options
305  return FALSE;
306  }
307 }
BOOL HandleInfoCommand(LPWSTR szCommand, int argcLeft, LPWSTR *argvLeft)
Definition: unattended.cpp:157
BOOL bUpdateAtStart
Definition: settings.h:8
static int argc
Definition: ServiceArgs.c:12
#define CloseHandle
Definition: compat.h:598
#define CMD_KEY_INFO
Definition: unattended.h:6
#define CMD_KEY_SETUP
Definition: unattended.h:4
#define TRUE
Definition: types.h:120
#define CMD_KEY_INSTALL
Definition: unattended.h:3
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define IDS_CMD_INVALID_OPTION
Definition: resource.h:226
#define argv
Definition: mplay32.c:18
#define CMD_KEY_HELP
Definition: unattended.h:7
int32_t INT
Definition: typedefs.h:58
VOID MainWindowLoop(INT nShowCmd)
Definition: gui.cpp:862
const TCHAR szWindowClass[]
Definition: magnifier.c:28
#define FALSE
Definition: types.h:117
LPWSTR *WINAPI CommandLineToArgvW(LPCWSTR lpCmdline, int *numargs)
Definition: shell32_main.c:80
BOOL HandleSetupCommand(LPWSTR szCommand, int argcLeft, LPWSTR *argvLeft)
Definition: unattended.cpp:77
HANDLE hMutex
Definition: mutex.c:11
void ConResPuts(FILE *fp, UINT nID)
Definition: fc.c:27
#define CMD_KEY_FIND
Definition: unattended.h:5
void InitRappsConsole()
Definition: unattended.cpp:29
SETTINGS_INFO SettingsInfo
Definition: winmain.cpp:20
HWND WINAPI FindWindowW(_In_opt_ LPCWSTR, _In_opt_ LPCWSTR)
BOOL MatchCmdOption(LPWSTR argvOption, LPCWSTR szOptToMacth)
Definition: unattended.cpp:15
VOID PrintHelpCommand()
Definition: unattended.cpp:228
#define CMD_KEY_HELP_ALT
Definition: unattended.h:8
BOOL HandleInstallCommand(LPWSTR szCommand, int argcLeft, LPWSTR *argvLeft)
Definition: unattended.cpp:45
static BOOL ForceUpdateAppsDB()
Definition: available.cpp:442
#define SW_SHOWNORMAL
Definition: winuser.h:764
HANDLE WINAPI DECLSPEC_HOTPATCH CreateMutexW(IN LPSECURITY_ATTRIBUTES lpMutexAttributes OPTIONAL, IN BOOL bInitialOwner, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:576
#define NULL
Definition: types.h:112
#define StdOut
Definition: fc.c:14
BOOL WINAPI SetForegroundWindow(_In_ HWND)
BOOL HandleFindCommand(LPWSTR szCommand, int argcLeft, LPWSTR *argvLeft)
Definition: unattended.cpp:136
#define ERROR_ALREADY_EXISTS
Definition: disk.h:80
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by wWinMain().

Variable Documentation

◆ UsageString

const WCHAR UsageString[]
Initial value:
= L"RAPPS \
[/" CMD_KEY_HELP L"] \
[/" CMD_KEY_INSTALL L" packagename] \
[/" CMD_KEY_SETUP L" filename] \
[/" CMD_KEY_FIND L" string] \
[/" CMD_KEY_INFO L" packagename]"
#define CMD_KEY_INFO
Definition: unattended.h:6
#define CMD_KEY_SETUP
Definition: unattended.h:4
#define CMD_KEY_INSTALL
Definition: unattended.h:3
#define CMD_KEY_HELP
Definition: unattended.h:7
#define CMD_KEY_FIND
Definition: unattended.h:5
static const WCHAR L[]
Definition: oid.c:1250

Definition at line 11 of file unattended.h.

Referenced by PrintHelpCommand().