2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS Logon User Interface Host
4 * FILE: subsys/system/logonui/logonui.c
5 * PROGRAMMERS: Ged Murphy (gedmurphy@reactos.org)
10 /* DATA **********************************************************************/
15 /* GLOBALS ******************************************************************/
20 /* FUNCTIONS ****************************************************************/
24 DrawBaseBackground(HDC hdcDesktop
)
28 hdcMem
= NT5_DrawBaseBackground(hdcDesktop
);
34 DrawLogoffScreen(HDC hdcMem
)
36 /* Draw the logoff icon */
37 NT5_CreateLogoffScreen(L
"Saving your settings...", hdcMem
);
41 GetULONG(LPWSTR String
)
48 /* Get the string length */
49 Length
= (UINT
)wcslen(String
);
51 /* Check the string only consists of numbers */
52 while ((i
< Length
) && ((String
[i
] < L
'0') || (String
[i
] > L
'9'))) i
++;
53 if ((i
>= Length
) || ((String
[i
] < L
'0') || (String
[i
] > L
'9')))
59 Value
= wcstoul(&String
[i
], &StopString
, 10);
65 GetULONG2(LPWSTR String1
, LPWSTR String2
, PINT i
)
69 /* Check the first string value */
70 Value
= GetULONG(String1
);
71 if (Value
== (ULONG
)-1)
73 /* Check the second string value isn't a switch */
74 if (String2
[0] != L
'-')
77 Value
= GetULONG(String2
);
86 ParseCmdline(int argc
, WCHAR
* argv
[])
95 HDC hdcDesktop
, hdcMem
;
97 /* Get the screen size */
98 g_pInfo
->cx
= GetSystemMetrics(SM_CXSCREEN
);
99 g_pInfo
->cy
= GetSystemMetrics(SM_CYSCREEN
);
101 hDesktopWnd
= GetDesktopWindow();
103 /* Get the DC for the desktop */
104 hdcDesktop
= GetDCEx(hDesktopWnd
, NULL
, DCX_CACHE
);
107 /* Initialize the base background onto a DC */
108 hdcMem
= DrawBaseBackground(hdcDesktop
);
111 /* TEST : Draw logoff screen */
112 DrawLogoffScreen(hdcMem
);
114 /* Blit the off-screen DC to the desktop */
125 /* Delete the memory DC */
129 /* Release the desktop DC */
130 ReleaseDC(hDesktopWnd
, hdcDesktop
);
135 wWinMain(IN HINSTANCE hInst
,
136 IN HINSTANCE hPrevInstance
,
137 IN LPWSTR lpszCmdLine
,
143 /* Allocate memory for the data */
144 g_pInfo
= (PINFO
)HeapAlloc(GetProcessHeap(),
147 if (!g_pInfo
) return -1;
149 g_pInfo
->hInstance
= hInst
;
151 /* Get the command line args */
152 lpArgs
= CommandLineToArgvW(lpszCmdLine
, &NumArgs
);
155 /* Parse the command line */
156 if (ParseCmdline(NumArgs
, lpArgs
))
158 /* Start the main routine */
164 HeapFree(GetProcessHeap(),