ReactOS 0.4.15-dev-7136-g77ab709
nonclient.c
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS uxtheme.dll
4 * FILE: dll/win32/uxtheme/nonclient.c
5 * PURPOSE: uxtheme non client area management
6 * PROGRAMMER: Giannis Adamopoulos
7 */
8
9#include "uxthemep.h"
10
11static BOOL
13{
14 BOOL ret;
15
17 {
19 if (ret)
21 }
22 else
23 {
25 }
26
27 return ret;
28}
29
30BOOL
32{
33 SCROLLBARINFO sbi = {sizeof(SCROLLBARINFO)};
34 if(!GetScrollBarInfo(hWnd, hBar, &sbi))
35 return FALSE;
36
37 return !(sbi.rgstate[0] & STATE_SYSTEM_OFFSCREEN);
38}
39
40static BOOL
42{
43 if (Style & WS_MINIMIZE)
44 return TRUE;
46 return TRUE;
48 return FALSE;
49 if (Style & WS_THICKFRAME)
50 return TRUE;
52 if (Style == WS_DLGFRAME || Style == WS_CAPTION)
53 return TRUE;
54 return FALSE;
55}
56
57static HICON
59{
61
62 SendMessageTimeout(pcontext->hWnd, WM_GETICON, ICON_SMALL2, 0, SMTO_ABORTIFHUNG, 1000, (PDWORD_PTR)&hIcon);
63
64 if (!hIcon)
65 SendMessageTimeout(pcontext->hWnd, WM_GETICON, ICON_SMALL, 0, SMTO_ABORTIFHUNG, 1000, (PDWORD_PTR)&hIcon);
66
67 if (!hIcon)
68 SendMessageTimeout(pcontext->hWnd, WM_GETICON, ICON_BIG, 0, SMTO_ABORTIFHUNG, 1000, (PDWORD_PTR)&hIcon);
69
70 if (!hIcon)
72
73 if (!hIcon)
75
76 // See also win32ss/user/ntuser/nonclient.c!NC_IconForWindow
77 if (!hIcon && !(pcontext->wi.dwExStyle & WS_EX_DLGMODALFRAME))
79
80 return hIcon;
81}
82
83HRESULT WINAPI ThemeDrawCaptionText(PDRAW_CONTEXT pcontext, RECT* pRect, int iPartId, int iStateId)
84{
85 HRESULT hr;
87 HGDIOBJ oldFont = NULL;
88 LOGFONTW logfont;
89 COLORREF textColor;
90 COLORREF oldTextColor;
91 int align = CA_LEFT;
92 int drawStyles = DT_VCENTER | DT_SINGLELINE | DT_END_ELLIPSIS;
93
94 WCHAR buffer[50];
95 WCHAR *pszText = buffer;
96 INT len;
97
98 len = InternalGetWindowText(pcontext->hWnd, NULL, 0);
99 if (!len)
100 return S_OK;
101
102 len++; /* From now on this is the size of the buffer so include the null */
103
104 if (len > ARRAYSIZE(buffer))
105 {
106 pszText = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
107 if (!pszText)
108 return E_OUTOFMEMORY;
109 }
110
111 InternalGetWindowText(pcontext->hWnd, pszText, len);
112
113 hr = GetThemeSysFont(0,TMT_CAPTIONFONT,&logfont);
114 if(SUCCEEDED(hr))
115 hFont = CreateFontIndirectW(&logfont);
116
117 if(hFont)
118 oldFont = SelectObject(pcontext->hDC, hFont);
119
120 if (!pcontext->Active)
122 else
123 textColor = GetSysColor(COLOR_CAPTIONTEXT);
124
125 GetThemeEnumValue(pcontext->theme, iPartId, iStateId, TMT_CONTENTALIGNMENT, &align);
126 if (align == CA_CENTER)
127 drawStyles |= DT_CENTER;
128 else if (align == CA_RIGHT)
129 drawStyles |= DT_RIGHT;
130
131 oldTextColor = SetTextColor(pcontext->hDC, textColor);
132 DrawThemeText(pcontext->theme,
133 pcontext->hDC,
134 iPartId,
135 iStateId,
136 pszText,
137 len - 1,
138 drawStyles,
139 0,
140 pRect);
141 SetTextColor(pcontext->hDC, oldTextColor);
142
143 if (hFont)
144 {
145 SelectObject(pcontext->hDC, oldFont);
147 }
148 if (pszText != buffer)
149 {
150 HeapFree(GetProcessHeap(), 0, pszText);
151 }
152 return S_OK;
153}
154
155void
157 HWND hWnd,
158 HRGN hRgn)
159{
160 pcontext->wi.cbSize = sizeof(pcontext->wi);
161 GetWindowInfo(hWnd, &pcontext->wi);
162 pcontext->hWnd = hWnd;
163 pcontext->Active = IsWindowActive(hWnd, pcontext->wi.dwExStyle);
164 pcontext->theme = GetNCCaptionTheme(hWnd, pcontext->wi.dwStyle);
165 pcontext->scrolltheme = GetNCScrollbarTheme(hWnd, pcontext->wi.dwStyle);
166
167 pcontext->CaptionHeight = pcontext->wi.cyWindowBorders;
169
170 if(hRgn <= (HRGN)1)
171 {
173 }
174 pcontext->hRgn = hRgn;
175
177}
178
179void
181{
182 ReleaseDC(pcontext->hWnd ,pcontext->hDC);
183
184 if(pcontext->hRgn != NULL)
185 {
186 DeleteObject(pcontext->hRgn);
187 }
188}
189
190static void
192{
194
195 pcontext->hDCScreen = pcontext->hDC;
196 pcontext->hDC = CreateCompatibleDC(pcontext->hDCScreen);
197 hbmp = CreateCompatibleBitmap(pcontext->hDCScreen, cx, cy);
198 pcontext->hbmpOld = (HBITMAP)SelectObject(pcontext->hDC, hbmp);
199}
200
201static void
202ThemeEndBufferedPaint(PDRAW_CONTEXT pcontext, int x, int y, int cx, int cy)
203{
205 BitBlt(pcontext->hDCScreen, 0, 0, cx, cy, pcontext->hDC, x, y, SRCCOPY);
206 hbmp = (HBITMAP) SelectObject(pcontext->hDC, pcontext->hbmpOld);
207 DeleteObject(pcontext->hDC);
209
210 pcontext->hDC = pcontext->hDCScreen;
211}
212
214{
215 PWND_DATA pwndData;
216 DWORD style;
217 INT ButtonWidth, ButtonHeight, iPartId, i;
218 WINDOWINFO wi = {sizeof(wi)};
219 RECT rcCurrent;
220 SIZE ButtonSize;
221
222 /* First of all check if we have something to do here */
225 return;
226
227 /* Get theme data for this window */
228 pwndData = ThemeGetWndData(hWnd);
229 if (pwndData == NULL)
230 return;
231
232 if (!htheme)
233 {
234 htheme = GetNCCaptionTheme(hWnd, style);
235 if (!htheme)
236 return;
237 }
238
239 if(!GetWindowInfo(hWnd, &wi))
240 return;
241
242 /* Calculate the area of the caption */
243 rcCurrent.top = rcCurrent.left = 0;
244 rcCurrent.right = wi.rcWindow.right - wi.rcWindow.left;
245 rcCurrent.bottom = wi.rcWindow.bottom - wi.rcWindow.top;
246
247 /* Add a padding around the objects of the caption */
248 InflateRect(&rcCurrent, -(int)wi.cyWindowBorders-BUTTON_GAP_SIZE,
250
252
253 GetThemePartSize(htheme, NULL, iPartId, 0, NULL, TS_MIN, &ButtonSize);
254
256 ButtonWidth = MulDiv(ButtonSize.cx, ButtonHeight, ButtonSize.cy);
257
258 ButtonHeight -= 4;
259 ButtonWidth -= 4;
260
261 for (i = CLOSEBUTTON; i <= HELPBUTTON; i++)
262 {
263 SetRect(&pwndData->rcCaptionButtons[i],
264 rcCurrent.right - ButtonWidth,
265 rcCurrent.top,
266 rcCurrent.right,
267 rcCurrent.top + ButtonHeight);
268
269 rcCurrent.right -= ButtonWidth + BUTTON_GAP_SIZE;
270 }
271}
272
273static void
275 RECT* prcCurrent,
276 CAPTIONBUTTON buttonId,
277 INT iStateId)
278{
279 INT iPartId;
280 HMENU SysMenu;
281 UINT MenuState;
282 PWND_DATA pwndData = ThemeGetWndData(pcontext->hWnd);
283 if (!pwndData)
284 return;
285
286 switch(buttonId)
287 {
288 case CLOSEBUTTON:
289 SysMenu = GetSystemMenu(pcontext->hWnd, FALSE);
290 MenuState = GetMenuState(SysMenu, SC_CLOSE, MF_BYCOMMAND);
291 if (!(pcontext->wi.dwStyle & WS_SYSMENU) || (MenuState & (MF_GRAYED | MF_DISABLED)) || pcontext->wi.dwStyle & CS_NOCLOSE)
292 {
293 iStateId = (pcontext->Active ? BUTTON_DISABLED : BUTTON_INACTIVE_DISABLED);
294 }
295
297 break;
298
299 case MAXBUTTON:
300 if (!(pcontext->wi.dwStyle & WS_MAXIMIZEBOX))
301 {
302 if (!(pcontext->wi.dwStyle & WS_MINIMIZEBOX))
303 return;
304 else
305 iStateId = (pcontext->Active ? BUTTON_DISABLED : BUTTON_INACTIVE_DISABLED);
306 }
307
308 iPartId = pcontext->wi.dwStyle & WS_MAXIMIZE ? WP_RESTOREBUTTON : WP_MAXBUTTON;
309 break;
310
311 case MINBUTTON:
312 if (!(pcontext->wi.dwStyle & WS_MINIMIZEBOX))
313 {
314 if (!(pcontext->wi.dwStyle & WS_MAXIMIZEBOX))
315 return;
316 else
317 iStateId = (pcontext->Active ? BUTTON_DISABLED : BUTTON_INACTIVE_DISABLED);
318 }
319
320 iPartId = pcontext->wi.dwStyle & WS_MINIMIZE ? WP_RESTOREBUTTON : WP_MINBUTTON;
321 break;
322
323 default:
324 //FIXME: Implement Help Button
325 return;
326 }
327
328 if (prcCurrent)
329 prcCurrent->right = pwndData->rcCaptionButtons[buttonId].left;
330
331 DrawThemeBackground(pcontext->theme, pcontext->hDC, iPartId, iStateId, &pwndData->rcCaptionButtons[buttonId], NULL);
332}
333
334static DWORD
335ThemeGetButtonState(DWORD htCurrect, DWORD htHot, DWORD htDown, BOOL Active)
336{
337 if (htHot == htCurrect)
339 if (htDown == htCurrect)
341
343}
344
345/* Used only from mouse event handlers */
346static void
348{
349 /* Draw the buttons */
351 ThemeGetButtonState(HTCLOSE, htHot, htDown, pcontext->Active));
353 ThemeGetButtonState(HTMAXBUTTON, htHot, htDown, pcontext->Active));
355 ThemeGetButtonState(HTMINBUTTON, htHot, htDown, pcontext->Active));
357 ThemeGetButtonState(HTHELP, htHot, htDown, pcontext->Active));
358}
359
360/* Used from WM_NCPAINT and WM_NCACTIVATE handlers */
361static void
362ThemeDrawCaption(PDRAW_CONTEXT pcontext, RECT* prcCurrent)
363{
364 RECT rcPart;
365 int iPart, iState;
366 HICON hIcon;
367
368 // See also win32ss/user/ntuser/nonclient.c!UserDrawCaptionBar
369 // and win32ss/user/ntuser/nonclient.c!UserDrawCaption
370 if ((pcontext->wi.dwStyle & WS_SYSMENU) && !(pcontext->wi.dwExStyle & WS_EX_TOOLWINDOW))
371 hIcon = UserGetWindowIcon(pcontext);
372 else
373 hIcon = NULL;
374
375 /* Get the caption part and state id */
376 if (pcontext->wi.dwStyle & WS_MINIMIZE)
377 iPart = WP_MINCAPTION;
378 else if (pcontext->wi.dwExStyle & WS_EX_TOOLWINDOW)
379 iPart = WP_SMALLCAPTION;
380 else if (pcontext->wi.dwStyle & WS_MAXIMIZE)
381 iPart = WP_MAXCAPTION;
382 else
383 iPart = WP_CAPTION;
384
385 iState = pcontext->Active ? FS_ACTIVE : FS_INACTIVE;
386
387 /* Draw the caption background */
388 rcPart = *prcCurrent;
389 rcPart.bottom = rcPart.top + pcontext->CaptionHeight;
390 prcCurrent->top = rcPart.bottom;
391 DrawThemeBackground(pcontext->theme, pcontext->hDC,iPart,iState,&rcPart,NULL);
392
393 /* Add a padding around the objects of the caption */
394 InflateRect(&rcPart, -(int)pcontext->wi.cyWindowBorders-BUTTON_GAP_SIZE,
395 -(int)pcontext->wi.cyWindowBorders-BUTTON_GAP_SIZE);
396
397 /* Draw the caption buttons */
398 if (pcontext->wi.dwStyle & WS_SYSMENU)
399 {
400 iState = pcontext->Active ? BUTTON_NORMAL : BUTTON_INACTIVE;
401
402 ThemeDrawCaptionButton(pcontext, &rcPart, CLOSEBUTTON, iState);
403 ThemeDrawCaptionButton(pcontext, &rcPart, MAXBUTTON, iState);
404 ThemeDrawCaptionButton(pcontext, &rcPart, MINBUTTON, iState);
405 ThemeDrawCaptionButton(pcontext, &rcPart, HELPBUTTON, iState);
406 }
407
408 rcPart.top += 3 ;
409
410 /* Draw the icon */
411 if (hIcon)
412 {
413 int IconHeight = GetSystemMetrics(SM_CYSMICON);
414 int IconWidth = GetSystemMetrics(SM_CXSMICON);
415 DrawIconEx(pcontext->hDC, rcPart.left, rcPart.top , hIcon, IconWidth, IconHeight, 0, NULL, DI_NORMAL);
416 rcPart.left += IconWidth + 4;
417 }
418
419 rcPart.right -= 4;
420
421 /* Draw the caption */
422 ThemeDrawCaptionText(pcontext, &rcPart, iPart, iState);
423}
424
425static void
426ThemeDrawBorders(PDRAW_CONTEXT pcontext, RECT* prcCurrent)
427{
428 RECT rcPart;
429 int iState = pcontext->Active ? FS_ACTIVE : FS_INACTIVE;
430
431 /* Draw the bottom border */
432 rcPart = *prcCurrent;
433 rcPart.top = rcPart.bottom - pcontext->wi.cyWindowBorders;
434 prcCurrent->bottom = rcPart.top;
435 DrawThemeBackground(pcontext->theme, pcontext->hDC, WP_FRAMEBOTTOM, iState, &rcPart, NULL);
436
437 /* Draw the left border */
438 rcPart = *prcCurrent;
439 rcPart.right = rcPart.left + pcontext->wi.cxWindowBorders ;
440 prcCurrent->left = rcPart.right;
441 DrawThemeBackground(pcontext->theme, pcontext->hDC,WP_FRAMELEFT, iState, &rcPart, NULL);
442
443 /* Draw the right border */
444 rcPart = *prcCurrent;
445 rcPart.left = rcPart.right - pcontext->wi.cxWindowBorders;
446 prcCurrent->right = rcPart.left;
447 DrawThemeBackground(pcontext->theme, pcontext->hDC,WP_FRAMERIGHT, iState, &rcPart, NULL);
448}
449
450static void
452{
453 /* Draw outer edge */
454 if (UserHasWindowEdge(context->wi.dwStyle, context->wi.dwExStyle))
455 {
456 DrawEdge(context->hDC, prcCurrent, EDGE_RAISED, BF_RECT | BF_ADJUST);
457 }
458 else if (context->wi.dwExStyle & WS_EX_STATICEDGE)
459 {
461 }
462
463 /* Firstly the "thick" frame */
464 if ((context->wi.dwStyle & WS_THICKFRAME) && !(context->wi.dwStyle & WS_MINIMIZE))
465 {
466 INT Width =
469 INT Height =
472
475
476 /* Draw frame */
477 PatBlt(context->hDC, prcCurrent->left, prcCurrent->top,
478 prcCurrent->right - prcCurrent->left, Height, PATCOPY);
479 PatBlt(context->hDC, prcCurrent->left, prcCurrent->top,
480 Width, prcCurrent->bottom - prcCurrent->top, PATCOPY);
481 PatBlt(context->hDC, prcCurrent->left, prcCurrent->bottom - 1,
482 prcCurrent->right - prcCurrent->left, -Height, PATCOPY);
483 PatBlt(context->hDC, prcCurrent->right - 1, prcCurrent->top,
484 -Width, prcCurrent->bottom - prcCurrent->top, PATCOPY);
485
486 InflateRect(prcCurrent, -Width, -Height);
487 }
488
489 /* Now the other bit of the frame */
490 if (context->wi.dwStyle & (WS_DLGFRAME | WS_BORDER) || (context->wi.dwExStyle & WS_EX_DLGMODALFRAME))
491 {
494
497 (context->wi.dwExStyle & WS_EX_STATICEDGE) ? COLOR_WINDOWFRAME :
498 (context->wi.dwStyle & (WS_DLGFRAME | WS_THICKFRAME)) ? COLOR_3DFACE :
500
501 /* Draw frame */
502 PatBlt(context->hDC, prcCurrent->left, prcCurrent->top,
503 prcCurrent->right - prcCurrent->left, Height, PATCOPY);
504 PatBlt(context->hDC, prcCurrent->left, prcCurrent->top,
505 Width, prcCurrent->bottom - prcCurrent->top, PATCOPY);
506 PatBlt(context->hDC, prcCurrent->left, prcCurrent->bottom - 1,
507 prcCurrent->right - prcCurrent->left, -Height, PATCOPY);
508 PatBlt(context->hDC, prcCurrent->right - 1, prcCurrent->top,
509 -Width, prcCurrent->bottom - prcCurrent->top, PATCOPY);
510
511 InflateRect(prcCurrent, -Width, -Height);
512 }
513}
514
515static void ThemeDrawMenuBar(PDRAW_CONTEXT pcontext, RECT* prcCurrent)
516{
517 /* Let the window manager paint the menu */
518 prcCurrent->top += PaintMenuBar(pcontext->hWnd,
519 pcontext->hDC,
520 pcontext->wi.cxWindowBorders,
521 pcontext->wi.cxWindowBorders,
522 prcCurrent->top,
523 pcontext->Active);
524}
525
526static void ThemeDrawScrollBarsGrip(PDRAW_CONTEXT pcontext, RECT* prcCurrent)
527{
528 RECT rcPart;
530 RECT ParentClientRect;
531 DWORD ParentStyle;
532
533 rcPart = *prcCurrent;
534
535 if (pcontext->wi.dwExStyle & WS_EX_LEFTSCROLLBAR)
536 rcPart.right = rcPart.left + GetSystemMetrics(SM_CXVSCROLL);
537 else
538 rcPart.left = rcPart.right - GetSystemMetrics(SM_CXVSCROLL);
539
540 rcPart.top = rcPart.bottom - GetSystemMetrics(SM_CYHSCROLL);
541
542 FillRect(pcontext->hDC, &rcPart, GetSysColorBrush(COLOR_BTNFACE));
543
544 hwndParent = GetParent(pcontext->hWnd);
545 GetClientRect(hwndParent, &ParentClientRect);
546 ParentStyle = GetWindowLongW(hwndParent, GWL_STYLE);
547
548 if (HASSIZEGRIP(pcontext->wi.dwStyle, pcontext->wi.dwExStyle, ParentStyle, pcontext->wi.rcWindow, ParentClientRect))
549 {
550 int iState;
551 if (pcontext->wi.dwExStyle & WS_EX_LEFTSCROLLBAR)
552 iState = pcontext->wi.dwExStyle & WS_EX_LEFTSCROLLBAR;
553 else
554 iState = SZB_RIGHTALIGN;
555 DrawThemeBackground(pcontext->scrolltheme, pcontext->hDC, SBP_SIZEBOX, iState, &rcPart, NULL);
556 }
557}
558
559static void
560ThemePaintWindow(PDRAW_CONTEXT pcontext, RECT* prcCurrent, BOOL bDoDoubleBuffering)
561{
562 if(!(pcontext->wi.dwStyle & WS_VISIBLE))
563 return;
564
565 if((pcontext->wi.dwStyle & WS_CAPTION)==WS_CAPTION)
566 {
567 if (bDoDoubleBuffering)
568 ThemeStartBufferedPaint(pcontext, prcCurrent->right, pcontext->CaptionHeight);
569 ThemeDrawCaption(pcontext, prcCurrent);
570 if (bDoDoubleBuffering)
571 ThemeEndBufferedPaint(pcontext, 0, 0, prcCurrent->right, pcontext->CaptionHeight);
572 ThemeDrawBorders(pcontext, prcCurrent);
573 }
574 else
575 {
576 DrawClassicFrame(pcontext, prcCurrent);
577 }
578
579 if(pcontext->wi.dwStyle & WS_MINIMIZE)
580 return;
581
582 if(HAS_MENU(pcontext->hWnd, pcontext->wi.dwStyle))
583 ThemeDrawMenuBar(pcontext, prcCurrent);
584
585 if (pcontext->wi.dwExStyle & WS_EX_CLIENTEDGE)
586 DrawEdge(pcontext->hDC, prcCurrent, EDGE_SUNKEN, BF_RECT | BF_ADJUST);
587
588 if((pcontext->wi.dwStyle & WS_HSCROLL) && IsScrollBarVisible(pcontext->hWnd, OBJID_HSCROLL))
589 ThemeDrawScrollBar(pcontext, SB_HORZ , NULL);
590
591 if((pcontext->wi.dwStyle & WS_VSCROLL) && IsScrollBarVisible(pcontext->hWnd, OBJID_VSCROLL))
592 ThemeDrawScrollBar(pcontext, SB_VERT, NULL);
593
594 if((pcontext->wi.dwStyle & (WS_HSCROLL|WS_VSCROLL)) == (WS_HSCROLL|WS_VSCROLL) &&
597 {
598 ThemeDrawScrollBarsGrip(pcontext, prcCurrent);
599 }
600}
601
602/*
603 * Message handlers
604 */
605
606static LRESULT
608{
610 RECT rcCurrent;
611
613
614 rcCurrent = context.wi.rcWindow;
615 OffsetRect( &rcCurrent, -context.wi.rcWindow.left, -context.wi.rcWindow.top);
616
617 ThemePaintWindow(&context, &rcCurrent, TRUE);
619
620 return 0;
621}
622
623static LRESULT
625{
627 TRACKMOUSEEVENT tme;
628 DWORD style;
629 PWND_DATA pwndData;
630
631 /* First of all check if we have something to do here */
634 return 0;
635
636 /* Get theme data for this window */
637 pwndData = ThemeGetWndData(hWnd);
638 if (pwndData == NULL)
639 return 0;
640
641 /* Begin tracking in the non client area if we are not tracking yet */
642 tme.cbSize = sizeof(TRACKMOUSEEVENT);
643 tme.dwFlags = TME_QUERY;
644 tme.hwndTrack = hWnd;
645 TrackMouseEvent(&tme);
646 if (tme.dwFlags != (TME_LEAVE | TME_NONCLIENT))
647 {
648 tme.hwndTrack = hWnd;
650 TrackMouseEvent(&tme);
651 }
652
654 if (context.wi.dwStyle & WS_SYSMENU)
655 {
656 if (HT_ISBUTTON(ht) || HT_ISBUTTON(pwndData->lastHitTest))
658 }
659
660 if (context.wi.dwStyle & WS_HSCROLL)
661 {
662 if (ht == HTHSCROLL || pwndData->lastHitTest == HTHSCROLL)
664 }
665
666 if (context.wi.dwStyle & WS_VSCROLL)
667 {
668 if (ht == HTVSCROLL || pwndData->lastHitTest == HTVSCROLL)
670 }
672
673 pwndData->lastHitTest = ht;
674
675 return 0;
676}
677
678static LRESULT
680{
682 DWORD style;
683 PWND_DATA pwndData;
684
685 /* First of all check if we have something to do here */
688 return 0;
689
690 /* Get theme data for this window */
691 pwndData = ThemeGetWndData(hWnd);
692 if (pwndData == NULL)
693 return 0;
694
696 if (context.wi.dwStyle & WS_SYSMENU && HT_ISBUTTON(pwndData->lastHitTest))
698
699 if (context.wi.dwStyle & WS_HSCROLL && pwndData->lastHitTest == HTHSCROLL)
701
702 if (context.wi.dwStyle & WS_VSCROLL && pwndData->lastHitTest == HTVSCROLL)
704
706
707 pwndData->lastHitTest = HTNOWHERE;
708
709 return 0;
710}
711
712static VOID
714{
715 MSG Msg;
716 BOOL Pressed = TRUE;
717 WPARAM SCMsg, ht;
718 ULONG Style;
720 PWND_DATA pwndData;
721
723 if (!((Style & WS_CAPTION) && (Style & WS_SYSMENU)))
724 return ;
725
726 switch (wParam)
727 {
728 case HTCLOSE:
729 SCMsg = SC_CLOSE;
730 break;
731 case HTMINBUTTON:
732 if (!(Style & WS_MINIMIZEBOX))
733 return;
734 SCMsg = ((Style & WS_MINIMIZE) ? SC_RESTORE : SC_MINIMIZE);
735 break;
736 case HTMAXBUTTON:
737 if (!(Style & WS_MAXIMIZEBOX))
738 return;
739 SCMsg = ((Style & WS_MAXIMIZE) ? SC_RESTORE : SC_MAXIMIZE);
740 break;
741 default :
742 return;
743 }
744
745 /* Get theme data for this window */
746 pwndData = ThemeGetWndData(hWnd);
747 if (pwndData == NULL)
748 return;
749
752 pwndData->lastHitTest = wParam;
753
755
756 ht = wParam;
757
758 for (;;)
759 {
761 break;
762
763 if (Msg.message == WM_LBUTTONUP)
764 break;
765
766 if (Msg.message != WM_MOUSEMOVE)
767 continue;
768
769 ht = SendMessage(hWnd, WM_NCHITTEST, 0, MAKELPARAM(Msg.pt.x, Msg.pt.y));
770 Pressed = (ht == wParam);
771
772 /* Only draw the buttons if the hit test changed */
773 if (ht != pwndData->lastHitTest &&
774 (HT_ISBUTTON(ht) || HT_ISBUTTON(pwndData->lastHitTest)))
775 {
776 ThemeDrawCaptionButtons(&context, 0, Pressed ? wParam: 0);
777 pwndData->lastHitTest = ht;
778 }
779 }
780
783
785
786 if (Pressed)
787 SendMessageW(hWnd, WM_SYSCOMMAND, SCMsg, 0);
788}
789
790
791static LRESULT
793{
794 RECT WindowRect;
795 POINT ClientPoint;
796 WINDOWINFO wi;
797
798 wi.cbSize = sizeof(wi);
799 GetWindowInfo(hWnd, &wi);
800
801 if (!PtInRect(&wi.rcWindow, Point))
802 {
803 return HTNOWHERE;
804 }
805 WindowRect = wi.rcWindow;
806
808 {
809 LONG XSize, YSize;
810
811 InflateRect(&WindowRect, -(int)wi.cxWindowBorders, -(int)wi.cyWindowBorders);
814 if (!PtInRect(&WindowRect, Point))
815 {
816 BOOL ThickFrame;
817
818 ThickFrame = (wi.dwStyle & WS_THICKFRAME);
819 if (Point.y < WindowRect.top)
820 {
821 if(wi.dwStyle & WS_MINIMIZE)
822 return HTCAPTION;
823 if(!ThickFrame)
824 return HTBORDER;
825 if (Point.x < (WindowRect.left + XSize))
826 return HTTOPLEFT;
827 if (Point.x >= (WindowRect.right - XSize))
828 return HTTOPRIGHT;
829 return HTTOP;
830 }
831 if (Point.y >= WindowRect.bottom)
832 {
833 if(wi.dwStyle & WS_MINIMIZE)
834 return HTCAPTION;
835 if(!ThickFrame)
836 return HTBORDER;
837 if (Point.x < (WindowRect.left + XSize))
838 return HTBOTTOMLEFT;
839 if (Point.x >= (WindowRect.right - XSize))
840 return HTBOTTOMRIGHT;
841 return HTBOTTOM;
842 }
843 if (Point.x < WindowRect.left)
844 {
845 if(wi.dwStyle & WS_MINIMIZE)
846 return HTCAPTION;
847 if(!ThickFrame)
848 return HTBORDER;
849 if (Point.y < (WindowRect.top + YSize))
850 return HTTOPLEFT;
851 if (Point.y >= (WindowRect.bottom - YSize))
852 return HTBOTTOMLEFT;
853 return HTLEFT;
854 }
855 if (Point.x >= WindowRect.right)
856 {
857 if(wi.dwStyle & WS_MINIMIZE)
858 return HTCAPTION;
859 if(!ThickFrame)
860 return HTBORDER;
861 if (Point.y < (WindowRect.top + YSize))
862 return HTTOPRIGHT;
863 if (Point.y >= (WindowRect.bottom - YSize))
864 return HTBOTTOMRIGHT;
865 return HTRIGHT;
866 }
867 }
868 }
869 else
870 {
874 if (!PtInRect(&WindowRect, Point))
875 return HTBORDER;
876 }
877
878 if ((wi.dwStyle & WS_CAPTION) == WS_CAPTION)
879 {
881 WindowRect.top += GetSystemMetrics(SM_CYSMCAPTION);
882 else
883 WindowRect.top += GetSystemMetrics(SM_CYCAPTION);
884
885 if (!PtInRect(&WindowRect, Point))
886 {
887 if (wi.dwStyle & WS_SYSMENU)
888 {
889 PWND_DATA pwndData = ThemeGetWndData(hWnd);
890
891 if (!(wi.dwExStyle & WS_EX_TOOLWINDOW))
892 {
893 // if(!(wi.dwExStyle & WS_EX_DLGMODALFRAME))
894 // FIXME: The real test should check whether there is
895 // an icon for the system window, and if so, do the
896 // rect.left increase.
897 // See win32ss/user/user32/windows/nonclient.c!DefWndNCHitTest
898 // and win32ss/user/ntuser/nonclient.c!GetNCHitEx which does
899 // the test better.
900 WindowRect.left += GetSystemMetrics(SM_CXSMICON);
901 }
902
903 if (pwndData)
904 {
905 POINT pt = {Point.x - wi.rcWindow.left, Point.y - wi.rcWindow.top};
906 if (PtInRect(&pwndData->rcCaptionButtons[CLOSEBUTTON], pt))
907 return HTCLOSE;
908 if (PtInRect(&pwndData->rcCaptionButtons[MAXBUTTON], pt))
909 return HTMAXBUTTON;
910 if (PtInRect(&pwndData->rcCaptionButtons[MINBUTTON], pt))
911 return HTMINBUTTON;
912 }
913 }
914 if (Point.x < WindowRect.left)
915 return HTSYSMENU;
916 return HTCAPTION;
917 }
918 }
919
920 if(!(wi.dwStyle & WS_MINIMIZE))
921 {
922 HMENU menu;
923
924 ClientPoint = Point;
925 ScreenToClient(hWnd, &ClientPoint);
927
928 if (PtInRect(&wi.rcClient, ClientPoint))
929 {
930 return HTCLIENT;
931 }
932
933 if ((menu = GetMenu(hWnd)) && !(wi.dwStyle & WS_CHILD))
934 {
935 if (Point.x > 0 && Point.x < WindowRect.right && ClientPoint.y < 0)
936 return HTMENU;
937 }
938
940 {
941 InflateRect(&WindowRect, -2 * GetSystemMetrics(SM_CXBORDER),
943 }
944
945 if ((wi.dwStyle & WS_VSCROLL) && (wi.dwStyle & WS_HSCROLL) &&
946 (WindowRect.bottom - WindowRect.top) > GetSystemMetrics(SM_CYHSCROLL))
947 {
948 RECT ParentRect, TempRect = WindowRect, TempRect2 = WindowRect;
950
952 if ((wi.dwExStyle & WS_EX_LEFTSCROLLBAR) != 0)
953 TempRect.right = TempRect.left + GetSystemMetrics(SM_CXVSCROLL);
954 else
955 TempRect.left = TempRect.right - GetSystemMetrics(SM_CXVSCROLL);
956 if (PtInRect(&TempRect, Point))
957 return HTVSCROLL;
958
959 TempRect2.top = TempRect2.bottom - GetSystemMetrics(SM_CYHSCROLL);
960 if ((wi.dwExStyle & WS_EX_LEFTSCROLLBAR) != 0)
961 TempRect2.left += GetSystemMetrics(SM_CXVSCROLL);
962 else
963 TempRect2.right -= GetSystemMetrics(SM_CXVSCROLL);
964 if (PtInRect(&TempRect2, Point))
965 return HTHSCROLL;
966
967 TempRect.top = TempRect2.top;
968 TempRect.bottom = TempRect2.bottom;
969 if(Parent)
970 GetClientRect(Parent, &ParentRect);
971 if (PtInRect(&TempRect, Point) && HASSIZEGRIP(wi.dwStyle, wi.dwExStyle,
972 GetWindowLongW(Parent, GWL_STYLE), wi.rcWindow, ParentRect))
973 {
974 if ((wi.dwExStyle & WS_EX_LEFTSCROLLBAR) != 0)
975 return HTBOTTOMLEFT;
976 else
977 return HTBOTTOMRIGHT;
978 }
979 }
980 else
981 {
982 if (wi.dwStyle & WS_VSCROLL)
983 {
984 RECT TempRect = WindowRect;
985
986 if ((wi.dwExStyle & WS_EX_LEFTSCROLLBAR) != 0)
987 TempRect.right = TempRect.left + GetSystemMetrics(SM_CXVSCROLL);
988 else
989 TempRect.left = TempRect.right - GetSystemMetrics(SM_CXVSCROLL);
990 if (PtInRect(&TempRect, Point))
991 return HTVSCROLL;
992 }
993 else if (wi.dwStyle & WS_HSCROLL)
994 {
995 RECT TempRect = WindowRect;
996 TempRect.top = TempRect.bottom - GetSystemMetrics(SM_CYHSCROLL);
997 if (PtInRect(&TempRect, Point))
998 return HTHSCROLL;
999 }
1000 }
1001 }
1002
1003 return HTNOWHERE;
1004}
1005
1008{
1009 switch(Msg)
1010 {
1011 case WM_NCPAINT:
1012 return ThemeHandleNCPaint(hWnd, (HRGN)wParam);
1013 //
1014 // WM_NCUAHDRAWCAPTION : wParam are DC_* flags.
1015 //
1017 //
1018 // WM_NCUAHDRAWFRAME : wParam is HDC, lParam are DC_ACTIVE and or DC_REDRAWHUNGWND.
1019 //
1020 case WM_NCUAHDRAWFRAME:
1021 case WM_NCACTIVATE:
1022
1024 return TRUE;
1025
1026 ThemeHandleNCPaint(hWnd, (HRGN)1);
1027 return TRUE;
1028 case WM_NCMOUSEMOVE:
1029 {
1030 POINT Point;
1034 }
1035 case WM_NCMOUSELEAVE:
1037 case WM_NCLBUTTONDOWN:
1038 switch (wParam)
1039 {
1040 case HTMINBUTTON:
1041 case HTMAXBUTTON:
1042 case HTCLOSE:
1043 {
1045 return 0;
1046 }
1047 default:
1048 return DefWndProc(hWnd, Msg, wParam, lParam);
1049 }
1050 case WM_NCHITTEST:
1051 {
1052 POINT Point;
1055 return DefWndNCHitTest(hWnd, Point);
1056 }
1057 case WM_SYSCOMMAND:
1058 {
1059 if((wParam & 0xfff0) == SC_VSCROLL ||
1060 (wParam & 0xfff0) == SC_HSCROLL)
1061 {
1062 POINT Pt;
1063 Pt.x = (short)LOWORD(lParam);
1064 Pt.y = (short)HIWORD(lParam);
1066 return 0;
1067 }
1068 else
1069 {
1070 return DefWndProc(hWnd, Msg, wParam, lParam);
1071 }
1072 }
1073 default:
1074 return DefWndProc(hWnd, Msg, wParam, lParam);
1075 }
1076}
1077
1079 DWORD DNCP_Flag,
1080 LPRECT prcPreview,
1081 LPCWSTR pszThemeFileName,
1082 LPCWSTR pszColorName,
1083 LPCWSTR pszSizeName,
1084 PNONCLIENTMETRICSW pncMetrics,
1085 COLORREF* lpaRgbValues)
1086{
1087 WNDCLASSEXW DummyPreviewWindowClass;
1088 HWND hwndDummy;
1089 HRESULT hres;
1090 HTHEMEFILE hThemeFile;
1092 RECT rcCurrent;
1093
1094 /* FIXME: We also need to implement drawing the rest of the preview windows
1095 * and make use of the ncmetrics and colors passed as parameters */
1096
1097 /* Create a dummy window that will be used to trick the paint funtions */
1098 memset(&DummyPreviewWindowClass, 0, sizeof(DummyPreviewWindowClass));
1099 DummyPreviewWindowClass.cbSize = sizeof(DummyPreviewWindowClass);
1100 DummyPreviewWindowClass.lpszClassName = L"DummyPreviewWindowClass";
1101 DummyPreviewWindowClass.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
1102 DummyPreviewWindowClass.hInstance = hDllInst;
1103 DummyPreviewWindowClass.lpfnWndProc = DefWindowProcW;
1104 if (!RegisterClassExW(&DummyPreviewWindowClass))
1105 return E_FAIL;
1106
1107 hwndDummy = CreateWindowExW(0, L"DummyPreviewWindowClass", L"Active window", WS_OVERLAPPEDWINDOW,30,30,300,150,0,0,hDllInst,NULL);
1108 if (!hwndDummy)
1109 return E_FAIL;
1110
1111 hres = OpenThemeFile(pszThemeFileName, pszColorName, pszSizeName, &hThemeFile,0);
1112 if (FAILED(hres))
1113 return hres;
1114
1115 /* Initialize the special draw context for the preview */
1116 context.hDC = hDC;
1117 context.hWnd = hwndDummy;
1118 context.theme = OpenThemeDataFromFile(hThemeFile, hwndDummy, L"WINDOW", 0);
1119 if (!context.theme)
1120 return E_FAIL;
1121 context.scrolltheme = OpenThemeDataFromFile(hThemeFile, hwndDummy, L"SCROLLBAR", 0);
1122 if (!context.scrolltheme)
1123 return E_FAIL;
1124 context.Active = TRUE;
1125 context.wi.cbSize = sizeof(context.wi);
1126 if (!GetWindowInfo(hwndDummy, &context.wi))
1127 return E_FAIL;
1128 context.wi.dwStyle |= WS_VISIBLE;
1129 context.CaptionHeight = context.wi.cyWindowBorders;
1130 context.CaptionHeight += GetSystemMetrics(context.wi.dwExStyle & WS_EX_TOOLWINDOW ? SM_CYSMCAPTION : SM_CYCAPTION );
1131 context.hRgn = CreateRectRgnIndirect(&context.wi.rcWindow);
1132
1133 /* Paint the window on the preview hDC */
1134 rcCurrent = context.wi.rcWindow;
1135 OffsetRect( &rcCurrent, -context.wi.rcWindow.left, -context.wi.rcWindow.top);
1136 SetViewportOrgEx(hDC, context.wi.rcWindow.left, context.wi.rcWindow.top, NULL);
1137 ThemeCalculateCaptionButtonsPos(hwndDummy, context.theme);
1138 ThemePaintWindow(&context, &rcCurrent, FALSE);
1139 SetViewportOrgEx(hDC, 0, 0, NULL);
1140
1141 context.hDC = NULL;
1142 CloseThemeData (context.theme);
1143 CloseThemeData (context.scrolltheme);
1145
1146 /* Cleanup */
1147 DestroyWindow(hwndDummy);
1148 UnregisterClassW(L"DummyPreviewWindowClass", hDllInst);
1149
1150 return S_OK;
1151}
static HDC hDC
Definition: 3dtext.c:33
#define DCX_USESTYLE
Definition: GetDCEx.c:10
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn UINT32 *TableIdx UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING ACPI_OBJECT_LIST ACPI_BUFFER *ReturnObjectBuffer ACPI_DEVICE_INFO **ReturnBuffer ACPI_HANDLE Parent
Definition: acpixf.h:732
Arabic default style
Definition: afstyles.h:94
const DWORD Style
Definition: appswitch.c:71
const DWORD ExStyle
Definition: appswitch.c:72
HWND hWnd
Definition: settings.c:17
HFONT hFont
Definition: main.c:53
ULONG_PTR * PDWORD_PTR
Definition: basetsd.h:182
HBITMAP hbmp
return
Definition: dirsup.c:529
struct @1619 Msg[]
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
static HWND hwndParent
Definition: cryptui.c:300
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_FAIL
Definition: ddrawi.h:102
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
#define GetProcessHeap()
Definition: compat.h:736
HANDLE HWND
Definition: compat.h:19
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
#define CALLBACK
Definition: compat.h:35
HRESULT WINAPI DrawThemeBackground(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, const RECT *pClipRect)
Definition: draw.c:128
HRESULT WINAPI GetThemePartSize(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, RECT *prc, THEMESIZE eSize, SIZE *psz)
Definition: draw.c:1777
HRESULT WINAPI DrawThemeText(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, LPCWSTR pszText, int iCharCount, DWORD dwTextFlags, DWORD dwTextFlags2, const RECT *pRect)
Definition: draw.c:1377
HRESULT WINAPI GetThemeSysFont(HTHEME hTheme, int iFontID, LOGFONTW *plf)
Definition: metric.c:91
static void ThemePaintWindow(PDRAW_CONTEXT pcontext, RECT *prcCurrent, BOOL bDoDoubleBuffering)
Definition: nonclient.c:560
static void ThemeDrawScrollBarsGrip(PDRAW_CONTEXT pcontext, RECT *prcCurrent)
Definition: nonclient.c:526
static BOOL IsWindowActive(HWND hWnd, DWORD ExStyle)
Definition: nonclient.c:12
static VOID ThemeHandleButton(HWND hWnd, WPARAM wParam)
Definition: nonclient.c:713
static void ThemeDrawCaptionButtons(PDRAW_CONTEXT pcontext, DWORD htHot, DWORD htDown)
Definition: nonclient.c:347
void ThemeCleanupDrawContext(PDRAW_CONTEXT pcontext)
Definition: nonclient.c:180
static void ThemeStartBufferedPaint(PDRAW_CONTEXT pcontext, int cx, int cy)
Definition: nonclient.c:191
static void ThemeDrawCaption(PDRAW_CONTEXT pcontext, RECT *prcCurrent)
Definition: nonclient.c:362
static BOOL UserHasWindowEdge(DWORD Style, DWORD ExStyle)
Definition: nonclient.c:41
HRESULT WINAPI DrawNCPreview(HDC hDC, DWORD DNCP_Flag, LPRECT prcPreview, LPCWSTR pszThemeFileName, LPCWSTR pszColorName, LPCWSTR pszSizeName, PNONCLIENTMETRICSW pncMetrics, COLORREF *lpaRgbValues)
Definition: nonclient.c:1078
static HICON UserGetWindowIcon(PDRAW_CONTEXT pcontext)
Definition: nonclient.c:58
static void ThemeDrawCaptionButton(PDRAW_CONTEXT pcontext, RECT *prcCurrent, CAPTIONBUTTON buttonId, INT iStateId)
Definition: nonclient.c:274
static DWORD ThemeGetButtonState(DWORD htCurrect, DWORD htHot, DWORD htDown, BOOL Active)
Definition: nonclient.c:335
void ThemeInitDrawContext(PDRAW_CONTEXT pcontext, HWND hWnd, HRGN hRgn)
Definition: nonclient.c:156
static void ThemeDrawBorders(PDRAW_CONTEXT pcontext, RECT *prcCurrent)
Definition: nonclient.c:426
static void DrawClassicFrame(PDRAW_CONTEXT context, RECT *prcCurrent)
Definition: nonclient.c:451
LRESULT CALLBACK ThemeWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, WNDPROC DefWndProc)
Definition: nonclient.c:1007
static void ThemeEndBufferedPaint(PDRAW_CONTEXT pcontext, int x, int y, int cx, int cy)
Definition: nonclient.c:202
static LRESULT ThemeHandleNcMouseLeave(HWND hWnd)
Definition: nonclient.c:679
void ThemeCalculateCaptionButtonsPos(HWND hWnd, HTHEME htheme)
Definition: nonclient.c:213
HRESULT WINAPI ThemeDrawCaptionText(PDRAW_CONTEXT pcontext, RECT *pRect, int iPartId, int iStateId)
Definition: nonclient.c:83
BOOL IsScrollBarVisible(HWND hWnd, INT hBar)
Definition: nonclient.c:31
static LRESULT ThemeHandleNCPaint(HWND hWnd, HRGN hRgn)
Definition: nonclient.c:607
static LRESULT ThemeHandleNcMouseMove(HWND hWnd, DWORD ht, POINT *pt)
Definition: nonclient.c:624
static LRESULT DefWndNCHitTest(HWND hWnd, POINT Point)
Definition: nonclient.c:792
static void ThemeDrawMenuBar(PDRAW_CONTEXT pcontext, RECT *prcCurrent)
Definition: nonclient.c:515
HRESULT WINAPI GetThemeEnumValue(HTHEME hTheme, int iPartId, int iStateId, int iPropId, int *piVal)
Definition: property.c:63
HINSTANCE hDllInst
Definition: system.c:45
HTHEME WINAPI OpenThemeDataFromFile(HTHEMEFILE hThemeFile, HWND hwnd, LPCWSTR pszClassList, DWORD flags)
Definition: system.c:827
HRESULT WINAPI OpenThemeFile(LPCWSTR pszThemeFileName, LPCWSTR pszColorName, LPCWSTR pszSizeName, HTHEMEFILE *hThemeFile, DWORD unknown)
Definition: system.c:1101
HRESULT WINAPI CloseThemeData(HTHEME hTheme)
Definition: system.c:950
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
Definition: typeof.h:94
#define pt(x, y)
Definition: drawing.c:79
static VOID NTAPI BitBlt(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_reads_bytes_(Delta *Height) PUCHAR Buffer, _In_ ULONG BitsPerPixel, _In_ ULONG Delta)
Definition: common.c:49
int align(int length, int align)
Definition: dsound8.c:36
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
pKey DeleteObject()
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLuint buffer
Definition: glext.h:5915
GLenum GLsizei len
Definition: glext.h:6722
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static const struct newhuff ht[]
Definition: huffman.h:296
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
static HBITMAP
Definition: button.c:44
static HDC
Definition: imagelist.c:92
static HICON
Definition: imagelist.c:84
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
static HRGN hRgn
Definition: mapping.c:33
HRESULT hres
Definition: protocol.c:465
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
static HTHEME(WINAPI *pOpenThemeDataEx)(HWND
HICON hIcon
Definition: msconfig.c:44
INT WINAPI MulDiv(INT nNumber, INT nNumerator, INT nDenominator)
Definition: muldiv.c:25
void ThemeDrawScrollBar(PDRAW_CONTEXT pcontext, INT nBar, POINT *pt)
Definition: ncscrollbar.c:276
void NC_TrackScrollBar(HWND hwnd, WPARAM wParam, POINT pt)
Definition: ncscrollbar.c:665
unsigned int UINT
Definition: ndis.h:50
#define L(x)
Definition: ntvdm.h:50
#define LOWORD(l)
Definition: pedump.c:82
#define WS_CHILD
Definition: pedump.c:617
#define WS_CAPTION
Definition: pedump.c:624
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define WS_MAXIMIZEBOX
Definition: pedump.c:632
#define WS_EX_DLGMODALFRAME
Definition: pedump.c:645
#define WS_MAXIMIZE
Definition: pedump.c:623
#define WS_SYSMENU
Definition: pedump.c:629
#define WS_BORDER
Definition: pedump.c:625
#define WS_VSCROLL
Definition: pedump.c:627
#define WS_MINIMIZE
Definition: pedump.c:622
#define WS_VISIBLE
Definition: pedump.c:620
long LONG
Definition: pedump.c:60
#define WS_DLGFRAME
Definition: pedump.c:626
#define WS_HSCROLL
Definition: pedump.c:628
#define WS_MINIMIZEBOX
Definition: pedump.c:631
#define WS_THICKFRAME
Definition: pedump.c:630
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
#define TME_LEAVE
Definition: commctrl.h:4981
_Out_opt_ int * cx
Definition: commctrl.h:585
#define TME_NONCLIENT
Definition: commctrl.h:4982
struct tagTRACKMOUSEEVENT TRACKMOUSEEVENT
#define TME_QUERY
Definition: commctrl.h:4983
#define memset(x, y, z)
Definition: compat.h:39
HRESULT hr
Definition: shlfolder.c:183
WINDOWINFO wi
Definition: uxthemep.h:194
HTHEME theme
Definition: uxthemep.h:191
HTHEME scrolltheme
Definition: uxthemep.h:192
HBITMAP hbmpOld
Definition: uxthemep.h:201
int CaptionHeight
Definition: uxthemep.h:197
LONG cx
Definition: kdterminal.h:27
LONG cy
Definition: kdterminal.h:28
LPCWSTR lpszClassName
Definition: winuser.h:3225
HBRUSH hbrBackground
Definition: winuser.h:3223
WNDPROC lpfnWndProc
Definition: winuser.h:3217
UINT cbSize
Definition: winuser.h:3215
HINSTANCE hInstance
Definition: winuser.h:3220
RECT rcCaptionButtons[4]
Definition: uxthemep.h:168
UINT lastHitTest
Definition: uxthemep.h:169
Definition: http.c:7252
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
DWORD rgstate[CCHILDREN_SCROLLBAR+1]
Definition: winuser.h:3753
RECT rcClient
Definition: winuser.h:3767
DWORD cbSize
Definition: winuser.h:3765
DWORD dwExStyle
Definition: winuser.h:3769
DWORD dwStyle
Definition: winuser.h:3768
UINT cxWindowBorders
Definition: winuser.h:3771
UINT cyWindowBorders
Definition: winuser.h:3772
RECT rcWindow
Definition: winuser.h:3766
HTHEME GetNCScrollbarTheme(HWND hWnd, DWORD style)
Definition: themehooks.c:118
HTHEME GetNCCaptionTheme(HWND hWnd, DWORD style)
Definition: themehooks.c:88
PWND_DATA ThemeGetWndData(HWND hWnd)
Definition: themehooks.c:17
#define ICON_BIG
Definition: tnclass.cpp:51
#define ICON_SMALL
Definition: tnclass.cpp:48
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
int32_t INT
Definition: typedefs.h:58
uint32_t ULONG
Definition: typedefs.h:59
#define HIWORD(l)
Definition: typedefs.h:247
#define DCX_KEEPCLIPRGN
Definition: undocuser.h:68
#define WM_NCUAHDRAWCAPTION
Definition: undocuser.h:46
BOOL WINAPI PaintMenuBar(HWND hWnd, HDC hDC, ULONG left, ULONG right, ULONG top, BOOL bActive)
#define WM_NCUAHDRAWFRAME
Definition: undocuser.h:47
_In_ HFONT _Out_ PUINT _Out_ PUINT Width
Definition: font.h:89
_In_ HFONT _Out_ PUINT Height
Definition: font.h:88
#define BUTTON_GAP_SIZE
Definition: uxthemep.h:238
#define HT_ISBUTTON(ht)
Definition: uxthemep.h:228
@ BUTTON_NORMAL
Definition: uxthemep.h:218
@ BUTTON_DISABLED
Definition: uxthemep.h:221
@ BUTTON_HOT
Definition: uxthemep.h:219
@ BUTTON_INACTIVE_DISABLED
Definition: uxthemep.h:225
@ BUTTON_PRESSED
Definition: uxthemep.h:220
@ BUTTON_INACTIVE
Definition: uxthemep.h:222
@ BUTTON_INACTIVE_HOT
Definition: uxthemep.h:223
@ BUTTON_INACTIVE_PRESSED
Definition: uxthemep.h:224
#define HAS_MENU(hwnd, style)
Definition: uxthemep.h:236
#define HASSIZEGRIP(Style, ExStyle, ParentStyle, WindowRect, ParentClientRect)
Definition: uxthemep.h:230
CAPTIONBUTTON
Definition: uxthemep.h:205
@ CLOSEBUTTON
Definition: uxthemep.h:206
@ MAXBUTTON
Definition: uxthemep.h:207
@ HELPBUTTON
Definition: uxthemep.h:209
@ MINBUTTON
Definition: uxthemep.h:208
@ SZB_RIGHTALIGN
Definition: vsstyle.h:1122
@ WP_SMALLCLOSEBUTTON
Definition: vsstyle.h:1629
@ WP_CAPTION
Definition: vsstyle.h:1611
@ WP_FRAMERIGHT
Definition: vsstyle.h:1618
@ WP_MAXCAPTION
Definition: vsstyle.h:1615
@ WP_FRAMEBOTTOM
Definition: vsstyle.h:1619
@ WP_MAXBUTTON
Definition: vsstyle.h:1627
@ WP_FRAMELEFT
Definition: vsstyle.h:1617
@ WP_MINBUTTON
Definition: vsstyle.h:1625
@ WP_CLOSEBUTTON
Definition: vsstyle.h:1628
@ WP_MINCAPTION
Definition: vsstyle.h:1613
@ WP_RESTOREBUTTON
Definition: vsstyle.h:1631
@ WP_SMALLCAPTION
Definition: vsstyle.h:1612
@ SBP_SIZEBOX
Definition: vsstyle.h:1085
@ FS_INACTIVE
Definition: vsstyle.h:1655
@ FS_ACTIVE
Definition: vsstyle.h:1654
@ CA_RIGHT
Definition: vssym32.h:65
@ CA_CENTER
Definition: vssym32.h:64
@ CA_LEFT
Definition: vssym32.h:63
#define TMT_CAPTIONFONT
Definition: vssym32.h:164
#define TMT_CONTENTALIGNMENT
Definition: vssym32.h:358
int ret
#define OBJID_VSCROLL
Definition: winable.h:20
#define OBJID_HSCROLL
Definition: winable.h:21
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
DWORD COLORREF
Definition: windef.h:300
#define WINAPI
Definition: msvc.h:6
#define GET_Y_LPARAM(lp)
Definition: windowsx.h:300
#define GET_X_LPARAM(lp)
Definition: windowsx.h:299
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1539
#define DI_NORMAL
Definition: wingdi.h:72
BOOL WINAPI SetViewportOrgEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPPOINT)
Definition: coord.c:655
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
#define SRCCOPY
Definition: wingdi.h:333
#define PATCOPY
Definition: wingdi.h:335
BOOL WINAPI PatBlt(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD)
HBITMAP WINAPI CreateCompatibleBitmap(_In_ HDC hdc, _In_ INT cx, _In_ INT cy)
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
Definition: text.c:918
HRGN WINAPI CreateRectRgnIndirect(_In_ LPCRECT)
#define BDR_SUNKENINNER
Definition: winuser.h:445
#define SC_HSCROLL
Definition: winuser.h:2593
HWND WINAPI SetCapture(_In_ HWND hWnd)
#define HTTOPRIGHT
Definition: winuser.h:2491
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define HTCLOSE
Definition: winuser.h:2498
#define SendMessageTimeout
Definition: winuser.h:5844
DWORD WINAPI GetSysColor(_In_ int)
#define WS_EX_STATICEDGE
Definition: winuser.h:403
#define MF_BYCOMMAND
Definition: winuser.h:202
#define WM_SYSCOMMAND
Definition: winuser.h:1740
#define COLOR_INACTIVECAPTIONTEXT
Definition: winuser.h:933
#define WM_MOUSEFIRST
Definition: winuser.h:1773
#define EDGE_SUNKEN
Definition: winuser.h:451
#define GCLP_HICONSM
Definition: winuser.h:675
#define MAKELPARAM(l, h)
Definition: winuser.h:4007
#define COLOR_WINDOW
Definition: winuser.h:917
#define WM_MOUSELAST
Definition: winuser.h:1800
BOOL WINAPI ReleaseCapture(void)
Definition: message.c:2890
#define COLOR_WINDOWFRAME
Definition: winuser.h:918
#define DT_CENTER
Definition: winuser.h:527
#define HTCAPTION
Definition: winuser.h:2475
HWND WINAPI GetForegroundWindow(void)
Definition: ntwrapper.h:392
UINT WINAPI GetMenuState(_In_ HMENU, _In_ UINT, _In_ UINT)
#define DCX_WINDOW
Definition: winuser.h:2112
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
#define DT_END_ELLIPSIS
Definition: winuser.h:529
#define HTTOPLEFT
Definition: winuser.h:2490
#define GCLP_HICON
Definition: winuser.h:674
#define SM_CYSIZE
Definition: winuser.h:991
BOOL WINAPI GetWindowInfo(_In_ HWND, _Inout_ PWINDOWINFO)
#define SM_CXVSCROLL
Definition: winuser.h:960
#define HTBOTTOM
Definition: winuser.h:2492
#define HTBORDER
Definition: winuser.h:2496
HBRUSH WINAPI GetSysColorBrush(_In_ int)
#define SB_VERT
Definition: winuser.h:553
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
#define DT_SINGLELINE
Definition: winuser.h:540
#define SC_VSCROLL
Definition: winuser.h:2592
#define SM_CXFRAME
Definition: winuser.h:993
#define HTVSCROLL
Definition: winuser.h:2481
#define HTHSCROLL
Definition: winuser.h:2480
#define WM_NCHITTEST
Definition: winuser.h:1685
#define WS_EX_TOOLWINDOW
Definition: winuser.h:404
#define SM_CYSMICON
Definition: winuser.h:1012
#define BF_ADJUST
Definition: winuser.h:470
#define WM_MOUSEMOVE
Definition: winuser.h:1774
HDC WINAPI GetDCEx(_In_opt_ HWND, _In_opt_ HRGN, _In_ DWORD)
BOOL WINAPI TrackMouseEvent(_Inout_ LPTRACKMOUSEEVENT)
#define GetClassLongPtr
Definition: winuser.h:5781
HMENU WINAPI GetSystemMenu(_In_ HWND, _In_ BOOL)
#define HTMAXBUTTON
Definition: winuser.h:2483
#define BF_FLAT
Definition: winuser.h:471
#define SM_CXSIZE
Definition: winuser.h:990
#define IDI_WINLOGO
Definition: winuser.h:709
#define SM_CYFRAME
Definition: winuser.h:995
#define SM_CYHSCROLL
Definition: winuser.h:961
#define HTMENU
Definition: winuser.h:2479
#define SC_MINIMIZE
Definition: winuser.h:2585
BOOL WINAPI PtInRect(_In_ LPCRECT, _In_ POINT)
#define WM_NCMOUSEMOVE
Definition: winuser.h:1690
#define SM_CYBORDER
Definition: winuser.h:964
#define SM_CXSMICON
Definition: winuser.h:1011
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define DCX_INTERSECTRGN
Definition: winuser.h:2121
#define WM_NCACTIVATE
Definition: winuser.h:1687
#define WS_EX_MDICHILD
Definition: winuser.h:394
#define HTHELP
Definition: winuser.h:2499
BOOL WINAPI DrawEdge(_In_ HDC, _Inout_ LPRECT, _In_ UINT, _In_ UINT)
BOOL WINAPI IsChild(_In_ HWND, _In_ HWND)
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
#define SM_CXBORDER
Definition: winuser.h:963
BOOL WINAPI DrawIconEx(_In_ HDC, _In_ int, _In_ int, _In_ HICON, _In_ int, _In_ int, _In_ UINT, _In_opt_ HBRUSH, _In_ UINT)
Definition: cursoricon.c:1997
#define HTRIGHT
Definition: winuser.h:2488
ATOM WINAPI RegisterClassExW(_In_ CONST WNDCLASSEXW *)
#define HTCLIENT
Definition: winuser.h:2474
#define COLOR_ACTIVEBORDER
Definition: winuser.h:922
#define SendMessage
Definition: winuser.h:5842
#define HTBOTTOMRIGHT
Definition: winuser.h:2494
#define HTNOWHERE
Definition: winuser.h:2473
#define SC_CLOSE
Definition: winuser.h:2591
#define STATE_SYSTEM_OFFSCREEN
Definition: winuser.h:2877
#define SM_CXDLGFRAME
Definition: winuser.h:965
#define WM_LBUTTONUP
Definition: winuser.h:1776
#define DT_VCENTER
Definition: winuser.h:543
HWND WINAPI GetParent(_In_ HWND)
#define SMTO_ABORTIFHUNG
Definition: winuser.h:1222
struct tagSCROLLBARINFO SCROLLBARINFO
#define HTBOTTOMLEFT
Definition: winuser.h:2493
#define HTTOP
Definition: winuser.h:2489
#define SM_CYSMCAPTION
Definition: winuser.h:1013
BOOL WINAPI OffsetRect(_Inout_ LPRECT, _In_ int, _In_ int)
#define SM_CYSMSIZE
Definition: winuser.h:1015
#define SM_CYDLGFRAME
Definition: winuser.h:967
BOOL WINAPI UnregisterClassW(_In_ LPCWSTR, HINSTANCE)
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
#define WS_EX_LEFTSCROLLBAR
Definition: winuser.h:392
#define DT_RIGHT
Definition: winuser.h:538
#define WM_MDIGETACTIVE
Definition: winuser.h:1820
#define HTMINBUTTON
Definition: winuser.h:2482
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2905
#define WM_NCMOUSELEAVE
Definition: winuser.h:1841
#define HTSYSMENU
Definition: winuser.h:2476
#define HTLEFT
Definition: winuser.h:2486
INT WINAPI InternalGetWindowText(_In_ HWND hWnd, _Out_writes_to_(cchMaxCount, return+1) LPWSTR pString, _In_ int cchMaxCount)
BOOL WINAPI InflateRect(_Inout_ LPRECT, _In_ int, _In_ int)
#define COLOR_INACTIVEBORDER
Definition: winuser.h:923
#define BF_RECT
Definition: winuser.h:462
#define GWL_STYLE
Definition: winuser.h:851
#define COLOR_CAPTIONTEXT
Definition: winuser.h:921
#define SC_RESTORE
Definition: winuser.h:2597
BOOL WINAPI DestroyWindow(_In_ HWND)
#define EDGE_RAISED
Definition: winuser.h:450
#define SM_CYCAPTION
Definition: winuser.h:962
BOOL WINAPI GetScrollBarInfo(_In_ HWND, _In_ LONG, _Inout_ PSCROLLBARINFO)
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
Definition: cursoricon.c:2044
int WINAPI GetSystemMetrics(_In_ int)
#define CS_NOCLOSE
Definition: winuser.h:654
#define WM_NCLBUTTONDOWN
Definition: winuser.h:1691
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HMENU WINAPI GetMenu(_In_ HWND)
#define SC_MAXIMIZE
Definition: winuser.h:2587
#define SB_HORZ
Definition: winuser.h:552
#define COLOR_BTNFACE
Definition: winuser.h:927
#define WM_NCPAINT
Definition: winuser.h:1686
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
#define MF_GRAYED
Definition: winuser.h:129
#define COLOR_3DFACE
Definition: winuser.h:928
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)
#define MF_DISABLED
Definition: winuser.h:130
_In_ ULONG _In_ BOOLEAN Active
Definition: potypes.h:561
__wchar_t WCHAR
Definition: xmlstorage.h:180
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185