2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS Logon User Interface Host
4 * FILE: subsys/system/logonui/NT5design.c
5 * PROGRAMMERS: Ged Murphy (gedmurphy@reactos.org)
11 /* GLOBALS ******************************************************************/
13 #define NT5_TOP_BORDER_HEIGHT 80
14 #define NT5_BOTTOM_BORDER_HEIGHT 96
17 /* FUNCTIONS ****************************************************************/
20 NT5_DrawLogoffCaptionText(LPWSTR lpText
,
28 /* Setup the font we'll use */
29 ZeroMemory(&LogFont
, sizeof(LOGFONTW
));
30 LogFont
.lfCharSet
= DEFAULT_CHARSET
;
31 LogFont
.lfHeight
= 22;
32 LogFont
.lfWeight
= 109; // From WinXP disassembly
33 wcscpy_s(LogFont
.lfFaceName
, LF_FACESIZE
, L
"Arial");
36 hFont
= CreateFontIndirectW(&LogFont
);
39 /* Set the font and font colour */
40 SelectObject(hdcMem
, hFont
);
41 SetTextColor(hdcMem
, RGB(255, 255, 255));
43 /* Create the text rect */
44 TextRect
.top
= (g_pInfo
->cy
/ 2) + 34;
45 TextRect
.bottom
= (g_pInfo
->cy
/ 2) + 34 + (GetDeviceCaps(hdcMem
, LOGPIXELSY
));
46 TextRect
.left
= g_pInfo
->cx
/ 3;
47 TextRect
.right
= (g_pInfo
->cx
/ 2) + 35 + 137;
49 /* Set the background mode to transparent */
50 PrevBkMode
= SetBkMode(hdcMem
, TRANSPARENT
);
52 /* Draw the text to the mem DC */
57 DT_NOPREFIX
| DT_WORDBREAK
| DT_RIGHT
); // WinXP disassembly uses 0x812
59 /* Set the previous background mode */
60 SetBkMode(hdcMem
, PrevBkMode
);
68 NT5_DrawLogoffIcon(HDC hdcMem
)
74 /* Load the XP logo */
75 hBitmap
= (HBITMAP
)LoadImageW(g_pInfo
->hInstance
,
76 MAKEINTRESOURCEW(IDB_MAIN_ROS_LOGO
),
83 /* Get the bitmap dimensions */
84 GetObjectW(hBitmap
, sizeof(BITMAP
), &bitmap
);
86 /* Create a temp DC for the bitmap */
87 hTempDC
= CreateCompatibleDC(hdcMem
);
90 /* Select the bitmap onto the temp DC */
91 SelectObject(hTempDC
, hBitmap
);
93 /* Paint it onto the centre block */
95 (g_pInfo
->cx
/ 2) + 35,
96 (g_pInfo
->cy
/ 2) - 72,
108 /* Delete the bitmap */
109 DeleteObject(hBitmap
);
114 NT5_RefreshLogoffScreenText(LPWSTR lpText
,
117 /* FIXME: clear previous text */
119 /* Draw the new text */
120 NT5_DrawLogoffCaptionText(lpText
, hdcMem
);
124 NT5_CreateLogoffScreen(LPWSTR lpText
,
127 /* Draw the reactos logo */
128 NT5_DrawLogoffIcon(hdcMem
);
130 /* Draw the first text string */
131 NT5_DrawLogoffCaptionText(lpText
, hdcMem
);
135 NT5_DrawBaseBackground(HDC hdcDesktop
)
137 HBITMAP hBitmap
= NULL
;
142 /* Create an an off screen DC to match the desktop DC */
143 hdcMem
= CreateCompatibleDC(hdcDesktop
);
146 /* Create a bitmap to draw the logoff screen onto */
147 hBitmap
= CreateCompatibleBitmap(hdcDesktop
, g_pInfo
->cx
, g_pInfo
->cy
);
150 /* Select it onto our off screen DC*/
151 SelectObject(hdcMem
, hBitmap
);
153 /* Draw the centre block */
160 /* Paint the blue centre block */
161 hBrush
= CreateSolidBrush(RGB(90, 126, 220));
162 SelectObject(hdcMem
, hBrush
);
165 NT5_TOP_BORDER_HEIGHT
,
167 g_pInfo
->cy
- NT5_TOP_BORDER_HEIGHT
- NT5_BOTTOM_BORDER_HEIGHT
,
169 DeleteObject(hBrush
);
171 /* Load the shine effect */
172 hTempBitmap
= (HBITMAP
)LoadImageW(g_pInfo
->hInstance
,
173 MAKEINTRESOURCEW(IDB_MAIN_PANEL_SHINE
),
180 /* Get the bitmap dimensions */
181 GetObjectW(hTempBitmap
, sizeof(BITMAP
), &bitmap
);
183 /* Create a temp DC for the bitmap */
184 hTempDC
= CreateCompatibleDC(hdcDesktop
);
187 /* Select the bitmap onto the temp DC */
188 SelectObject(hTempDC
, hTempBitmap
);
190 /* Paint it onto the top left of the centre block */
193 NT5_TOP_BORDER_HEIGHT
,
205 /* Delete the bitmap */
206 DeleteObject(hTempBitmap
);
210 /* Draw the top border */
217 /* Create the blue brush and paint the top bar */
218 hBrush
= CreateSolidBrush(RGB(0, 48, 156));
219 SelectObject(hdcMem
, hBrush
);
220 PatBlt(hdcMem
, 0, 0, g_pInfo
->cx
, NT5_TOP_BORDER_HEIGHT
, PATCOPY
);
221 DeleteObject(hBrush
);
223 /* Load the top divider strip */
224 hTempBitmap
= (HBITMAP
)LoadImageW(g_pInfo
->hInstance
,
225 MAKEINTRESOURCEW(IDB_TOP_DIVIDER_STRIP
),
232 /* Get the bitmap dimensions */
233 GetObjectW(hTempBitmap
, sizeof(BITMAP
), &bitmap
);
235 /* Create a temp DC for the bitmap */
236 hTempDC
= CreateCompatibleDC(hdcDesktop
);
239 /* Select the bitmap onto the temp DC */
240 SelectObject(hTempDC
, hTempBitmap
);
242 /* Paint the bitmap */
245 NT5_TOP_BORDER_HEIGHT
- bitmap
.bmHeight
,
247 NT5_TOP_BORDER_HEIGHT
,
252 NT5_TOP_BORDER_HEIGHT
,
259 /* Delete the bitmap */
260 DeleteObject(hTempBitmap
);
264 /* Draw the bottom border */
273 * We paint the divider strip first as it's 3
274 * pixels high but MS only show 2 of them.
277 /* Load the bottom divider strip */
278 hTempBitmap
= (HBITMAP
)LoadImage(g_pInfo
->hInstance
,
279 MAKEINTRESOURCE(IDB_BOTTOM_DIVIDER_STRIP
),
286 /* Get the bitmap dimensions */
287 GetObjectW(hTempBitmap
, sizeof(BITMAP
), &bitmap
);
289 /* Create a temp DC for the bitmap */
290 hTempDC
= CreateCompatibleDC(hdcDesktop
);
293 /* Select the bitmap onto the temp DC */
294 SelectObject(hTempDC
, hTempBitmap
);
296 /* Paint the bitmap */
299 g_pInfo
->cy
- NT5_BOTTOM_BORDER_HEIGHT
,
301 g_pInfo
->cy
- NT5_BOTTOM_BORDER_HEIGHT
+ bitmap
.bmHeight
,
306 g_pInfo
->cy
- NT5_BOTTOM_BORDER_HEIGHT
+ bitmap
.bmHeight
,
313 /* Delete the bitmap */
314 DeleteObject(hTempBitmap
);
317 /* Setup the left hand vertex */
319 vertex
[0].y
= g_pInfo
->cy
- NT5_BOTTOM_BORDER_HEIGHT
+ 2; // paint over 1 pixel of the bitmap
320 vertex
[0].Red
= 0x3900;
321 vertex
[0].Green
= 0x3400;
322 vertex
[0].Blue
= 0xAE00;
323 vertex
[0].Alpha
= 0x0000;
325 /* Setup the right hand vertex */
326 vertex
[1].x
= g_pInfo
->cx
;
327 vertex
[1].y
= g_pInfo
->cy
;
328 vertex
[1].Red
= 0x0000;
329 vertex
[1].Green
= 0x3000;
330 vertex
[1].Blue
= 0x9600;
331 vertex
[1].Alpha
= 0x0000;
333 /* Set the vertex structs */
335 gRect
.LowerRight
= 1;
337 /* Paint the gradient across the bottom */
343 GRADIENT_FILL_RECT_H
);
346 /* Delete the bitmap */
347 DeleteObject(hBitmap
);