Process Hacker
phgui.h
Go to the documentation of this file.
1 #ifndef _PH_PHGUI_H
2 #define _PH_PHGUI_H
3 
4 #pragma once
5 
6 #include <ph.h>
7 #include <commctrl.h>
8 
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12 
13 // guisup
14 
15 typedef BOOL (WINAPI *_ChangeWindowMessageFilter)(
16  _In_ UINT message,
17  _In_ DWORD dwFlag
18  );
19 
20 typedef BOOL (WINAPI *_IsImmersiveProcess)(
21  _In_ HANDLE hProcess
22  );
23 
24 #define RFF_NOBROWSE 0x0001
25 #define RFF_NODEFAULT 0x0002
26 #define RFF_CALCDIRECTORY 0x0004
27 #define RFF_NOLABEL 0x0008
28 #define RFF_NOSEPARATEMEM 0x0020
29 
30 #define RFN_VALIDATE (-510)
31 
32 typedef struct _NMRUNFILEDLGW
33 {
34  NMHDR hdr;
35  LPCWSTR lpszFile;
36  LPCWSTR lpszDirectory;
37  UINT nShow;
39 
41 typedef PNMRUNFILEDLGW PNMRUNFILEDLG;
42 typedef LPNMRUNFILEDLGW LPNMRUNFILEDLG;
43 
44 #define RF_OK 0x0000
45 #define RF_CANCEL 0x0001
46 #define RF_RETRY 0x0002
47 
48 typedef HANDLE HTHEME;
49 
50 typedef BOOL (WINAPI *_RunFileDlg)(
51  _In_ HWND hwndOwner,
52  _In_opt_ HICON hIcon,
53  _In_opt_ LPCWSTR lpszDirectory,
54  _In_opt_ LPCWSTR lpszTitle,
55  _In_opt_ LPCWSTR lpszDescription,
56  _In_ ULONG uFlags
57  );
58 
59 typedef BOOL (WINAPI *_IsThemeActive)(
60  VOID
61  );
62 
63 typedef HTHEME (WINAPI *_OpenThemeData)(
64  _In_ HWND hwnd,
65  _In_ LPCWSTR pszClassList
66  );
67 
68 typedef HRESULT (WINAPI *_CloseThemeData)(
69  _In_ HTHEME hTheme
70  );
71 
72 typedef BOOL (WINAPI *_IsThemePartDefined)(
73  _In_ HTHEME hTheme,
74  _In_ int iPartId,
75  _In_ int iStateId
76  );
77 
78 typedef HRESULT (WINAPI *_DrawThemeBackground)(
79  _In_ HTHEME hTheme,
80  _In_ HDC hdc,
81  _In_ int iPartId,
82  _In_ int iStateId,
83  _In_ const RECT *pRect,
84  _In_ const RECT *pClipRect
85  );
86 
87 typedef HRESULT (WINAPI *_DrawThemeText)(
88  _In_ HTHEME hTheme,
89  _In_ HDC hdc,
90  _In_ int iPartId,
91  _In_ int iStateId,
92  _In_reads_(cchText) LPCWSTR pszText,
93  _In_ int cchText,
94  _In_ DWORD dwTextFlags,
95  _Reserved_ DWORD dwTextFlags2,
96  _In_ LPCRECT pRect
97  );
98 
99 typedef HRESULT (WINAPI *_GetThemeInt)(
100  _In_ HTHEME hTheme,
101  _In_ int iPartId,
102  _In_ int iStateId,
103  _In_ int iPropId,
104  _Out_ int *piVal
105  );
106 
107 typedef HRESULT (WINAPI *_SHAutoComplete)(
108  _In_ HWND hwndEdit,
109  _In_ DWORD dwFlags
110  );
111 
112 typedef HRESULT (WINAPI *_TaskDialogIndirect)(
113  _In_ const TASKDIALOGCONFIG *pTaskConfig,
114  _In_ int *pnButton,
115  _In_ int *pnRadioButton,
116  _In_ BOOL *pfVerificationFlagChecked
117  );
118 
121 extern _RunFileDlg RunFileDlg;
131 
133  VOID
134  );
135 
136 PHLIBAPI
137 VOID PhSetControlTheme(
138  _In_ HWND Handle,
139  _In_ PWSTR Theme
140  );
141 
142 FORCEINLINE VOID PhSetWindowStyle(
143  _In_ HWND Handle,
144  _In_ LONG_PTR Mask,
145  _In_ LONG_PTR Value
146  )
147 {
148  LONG_PTR style;
149 
150  style = GetWindowLongPtr(Handle, GWL_STYLE);
151  style = (style & ~Mask) | (Value & Mask);
152  SetWindowLongPtr(Handle, GWL_STYLE, style);
153 }
154 
156  _In_ HWND Handle,
157  _In_ LONG_PTR Mask,
158  _In_ LONG_PTR Value
159  )
160 {
161  LONG_PTR style;
162 
163  style = GetWindowLongPtr(Handle, GWL_EXSTYLE);
164  style = (style & ~Mask) | (Value & Mask);
165  SetWindowLongPtr(Handle, GWL_EXSTYLE, style);
166 }
167 
168 #ifndef WM_REFLECT
169 #define WM_REFLECT 0x2000
170 #endif
171 
172 #define REFLECT_MESSAGE(hwnd, msg, wParam, lParam) \
173  { \
174  LRESULT result_ = PhReflectMessage(hwnd, msg, wParam, lParam); \
175  \
176  if (result_) \
177  return result_; \
178  }
179 
180 #define REFLECT_MESSAGE_DLG(hwndDlg, hwnd, msg, wParam, lParam) \
181  { \
182  LRESULT result_ = PhReflectMessage(hwnd, msg, wParam, lParam); \
183  \
184  if (result_) \
185  { \
186  SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, result_); \
187  return TRUE; \
188  } \
189  }
190 
191 FORCEINLINE LRESULT PhReflectMessage(
192  _In_ HWND Handle,
193  _In_ UINT Message,
194  _In_ WPARAM wParam,
195  _In_ LPARAM lParam
196  )
197 {
198  if (Message == WM_NOTIFY)
199  {
200  LPNMHDR header = (LPNMHDR)lParam;
201 
202  if (header->hwndFrom == Handle)
203  return SendMessage(Handle, WM_REFLECT + Message, wParam, lParam);
204  }
205 
206  return 0;
207 }
208 
209 #define PH_DEFINE_MAKE_ATOM(AtomName) \
210 do { \
211  static UNICODE_STRING atomName = RTL_CONSTANT_STRING(AtomName); \
212  static PH_INITONCE initOnce = PH_INITONCE_INIT; \
213  static RTL_ATOM atom = 0; \
214 \
215  if (PhBeginInitOnce(&initOnce)) \
216  { \
217  NtAddAtom(atomName.Buffer, atomName.Length, &atom); \
218  PhEndInitOnce(&initOnce); \
219  } \
220 \
221  if (atom) \
222  return (PWSTR)(ULONG_PTR)atom; \
223  else \
224  return atomName.Buffer; \
225 } while (0)
226 
228  _In_ HWND Handle,
229  _In_ BOOLEAN AllowDragDrop,
230  _In_ BOOLEAN ShowLabelTips
231  )
232 {
233  ULONG style;
234 
235  style = LVS_EX_FULLROWSELECT | LVS_EX_DOUBLEBUFFER | LVS_EX_INFOTIP;
236 
237  if (AllowDragDrop)
238  style |= LVS_EX_HEADERDRAGDROP;
239  if (ShowLabelTips)
240  style |= LVS_EX_LABELTIP;
241 
242  ListView_SetExtendedListViewStyleEx(
243  Handle,
244  style,
245  -1
246  );
247 }
248 
249 PHLIBAPI
251  _In_ HWND ListViewHandle,
252  _In_ INT Index,
253  _In_ INT DisplayIndex,
254  _In_ INT SubItemIndex,
255  _In_ INT Format,
256  _In_ INT Width,
257  _In_ PWSTR Text
258  );
259 
260 PHLIBAPI
262  _In_ HWND ListViewHandle,
263  _In_ INT Index,
264  _In_ PWSTR Text,
265  _In_opt_ PVOID Param
266  );
267 
268 PHLIBAPI
270  _In_ HWND ListViewHandle,
271  _In_ INT StartIndex,
272  _In_ ULONG Flags
273  );
274 
275 PHLIBAPI
277  _In_ HWND ListViewHandle,
278  _In_ INT StartIndex,
279  _In_opt_ PVOID Param
280  );
281 
282 PHLIBAPI
284  _In_ HWND ListViewHandle,
285  _In_ INT Index,
286  _Out_ PINT ImageIndex
287  );
288 
289 PHLIBAPI
291  _In_ HWND ListViewHandle,
292  _In_ INT Index,
293  _Out_ PVOID *Param
294  );
295 
296 PHLIBAPI
298  _In_ HWND ListViewHandle,
299  _In_ INT Index
300  );
301 
302 PHLIBAPI
304  _In_ HWND ListViewHandle,
305  _In_ INT Index,
306  _In_ INT ImageIndex
307  );
308 
309 PHLIBAPI
311  _In_ HWND ListViewHandle,
312  _In_ INT Index,
313  _In_ INT SubItemIndex,
314  _In_ PWSTR Text
315  );
316 
317 PHLIBAPI
319  _In_ HWND ListViewHandle,
320  _In_ PPH_STRING Settings
321  );
322 
323 PHLIBAPI
325  _In_ HWND ListViewHandle
326  );
327 
328 PHLIBAPI
330  _In_ HWND TabControlHandle,
331  _In_ INT Index,
332  _In_ PWSTR Text
333  );
334 
335 #define PhaGetDlgItemText(hwndDlg, id) \
336  ((PPH_STRING)PhAutoDereferenceObject(PhGetWindowText(GetDlgItem(hwndDlg, id))))
337 
338 PHLIBAPI
340  _In_ HWND hwnd
341  );
342 
343 #define PH_GET_WINDOW_TEXT_INTERNAL 0x1
344 #define PH_GET_WINDOW_TEXT_LENGTH_ONLY 0x2
345 
346 PHLIBAPI
347 ULONG PhGetWindowTextEx(
348  _In_ HWND hwnd,
349  _In_ ULONG Flags,
350  _Out_opt_ PPH_STRING *Text
351  );
352 
353 PHLIBAPI
355  _In_ HWND hWnd,
356  _In_ PWSTR *Strings,
357  _In_ ULONG NumberOfStrings
358  );
359 
360 PHLIBAPI
362  _In_ HWND hwnd,
363  _In_ INT Index
364  );
365 
366 PHLIBAPI
368  _In_ HWND hwnd,
369  _In_ PWSTR String,
370  _In_ BOOLEAN Partial
371  );
372 
373 PHLIBAPI
375  _In_ HWND hwnd,
376  _In_ INT Index
377  );
378 
379 PHLIBAPI
381  _In_ HWND hWnd,
382  _In_ ULONG State,
383  _In_ ULONG Mask
384  );
385 
386 PHLIBAPI
388  _In_ HWND hWnd
389  );
390 
391 PHLIBAPI
393  _In_ HWND hWnd,
394  _Out_ PVOID **Items,
395  _Out_ PULONG NumberOfItems
396  );
397 
398 PHLIBAPI
400  _In_ HIMAGELIST ImageList,
401  _In_ INT Index,
402  _In_ HINSTANCE InstanceHandle,
403  _In_ LPCWSTR BitmapName
404  );
405 
406 PHLIBAPI
408  _Out_opt_ HICON *SmallIcon,
409  _Out_opt_ HICON *LargeIcon
410  );
411 
412 PHLIBAPI
413 HICON PhGetFileShellIcon(
414  _In_opt_ PWSTR FileName,
415  _In_opt_ PWSTR DefaultExtension,
416  _In_ BOOLEAN LargeIcon
417  );
418 
419 PHLIBAPI
421  _In_ HWND hWnd,
422  _In_ PPH_STRINGREF String
423  );
424 
425 typedef struct _DLGTEMPLATEEX
426 {
427  WORD dlgVer;
428  WORD signature;
429  DWORD helpID;
430  DWORD exStyle;
431  DWORD style;
432  WORD cDlgItems;
433  short x;
434  short y;
435  short cx;
436  short cy;
438 
440  _In_ HWND Parent,
441  _In_ ULONG Style,
442  _In_ PVOID Instance,
443  _In_ PWSTR Template,
444  _In_ DLGPROC DialogProc,
445  _In_ PVOID Parameter
446  );
447 
448 #define PH_ANCHOR_LEFT 0x1
449 #define PH_ANCHOR_TOP 0x2
450 #define PH_ANCHOR_RIGHT 0x4
451 #define PH_ANCHOR_BOTTOM 0x8
452 #define PH_ANCHOR_ALL 0xf
453 
454 // This interface is horrible and should be rewritten, but it works for now.
455 
456 #define PH_LAYOUT_FORCE_INVALIDATE 0x1000 // invalidate the control when it is resized
457 #define PH_LAYOUT_TAB_CONTROL 0x2000 // this is a dummy item, a hack for the tab control
458 #define PH_LAYOUT_IMMEDIATE_RESIZE 0x4000 // needed for the tab control hack
459 
460 #define PH_LAYOUT_DUMMY_MASK (PH_LAYOUT_TAB_CONTROL) // items that don't have a window handle, or don't actually get their window resized
461 
462 typedef struct _PH_LAYOUT_ITEM
463 {
464  HWND Handle;
465  struct _PH_LAYOUT_ITEM *ParentItem; // for rectangle calculation
466  struct _PH_LAYOUT_ITEM *LayoutParentItem; // for actual resizing
470 
471  RECT Rect;
472  RECT OrigRect;
473  RECT Margin;
474  ULONG Anchor;
476 
477 typedef struct _PH_LAYOUT_MANAGER
478 {
481 
484 
485 PHLIBAPI
487  _Out_ PPH_LAYOUT_MANAGER Manager,
488  _In_ HWND RootWindowHandle
489  );
490 
491 PHLIBAPI
493  _Inout_ PPH_LAYOUT_MANAGER Manager
494  );
495 
496 PHLIBAPI
497 PPH_LAYOUT_ITEM PhAddLayoutItem(
498  _Inout_ PPH_LAYOUT_MANAGER Manager,
499  _In_ HWND Handle,
500  _In_opt_ PPH_LAYOUT_ITEM ParentItem,
501  _In_ ULONG Anchor
502  );
503 
504 PHLIBAPI
505 PPH_LAYOUT_ITEM PhAddLayoutItemEx(
506  _Inout_ PPH_LAYOUT_MANAGER Manager,
507  _In_ HWND Handle,
508  _In_opt_ PPH_LAYOUT_ITEM ParentItem,
509  _In_ ULONG Anchor,
510  _In_ RECT Margin
511  );
512 
513 PHLIBAPI
515  _Inout_ PPH_LAYOUT_MANAGER Manager
516  );
517 
519  _Inout_ PRECT Rect,
520  _In_ WPARAM Edge,
521  _In_ LONG MinimumWidth,
522  _In_ LONG MinimumHeight
523  )
524 {
525  if (Edge == WMSZ_BOTTOMRIGHT || Edge == WMSZ_RIGHT || Edge == WMSZ_TOPRIGHT)
526  {
527  if (Rect->right - Rect->left < MinimumWidth)
528  Rect->right = Rect->left + MinimumWidth;
529  }
530  else if (Edge == WMSZ_BOTTOMLEFT || Edge == WMSZ_LEFT || Edge == WMSZ_TOPLEFT)
531  {
532  if (Rect->right - Rect->left < MinimumWidth)
533  Rect->left = Rect->right - MinimumWidth;
534  }
535 
536  if (Edge == WMSZ_BOTTOMRIGHT || Edge == WMSZ_BOTTOM || Edge == WMSZ_BOTTOMLEFT)
537  {
538  if (Rect->bottom - Rect->top < MinimumHeight)
539  Rect->bottom = Rect->top + MinimumHeight;
540  }
541  else if (Edge == WMSZ_TOPRIGHT || Edge == WMSZ_TOP || Edge == WMSZ_TOPLEFT)
542  {
543  if (Rect->bottom - Rect->top < MinimumHeight)
544  Rect->top = Rect->bottom - MinimumHeight;
545  }
546 }
547 
549  _In_ HWND ParentWindowHandle,
550  _In_ HWND FromControlHandle,
551  _In_ HWND ToControlHandle
552  )
553 {
554  RECT windowRect;
555 
556  GetWindowRect(FromControlHandle, &windowRect);
557  MapWindowPoints(NULL, ParentWindowHandle, (POINT *)&windowRect, 2);
558  MoveWindow(ToControlHandle, windowRect.left, windowRect.top,
559  windowRect.right - windowRect.left, windowRect.bottom - windowRect.top, FALSE);
560 }
561 
562 // icotobmp
563 
564 PHLIBAPI
565 HBITMAP
566 NTAPI
568  _In_ HICON Icon,
569  _In_ ULONG Width,
570  _In_ ULONG Height
571  );
572 
573 // extlv
574 
575 #define PH_ALIGN_CENTER 0x0
576 #define PH_ALIGN_LEFT 0x1
577 #define PH_ALIGN_RIGHT 0x2
578 #define PH_ALIGN_TOP 0x4
579 #define PH_ALIGN_BOTTOM 0x8
580 
581 typedef enum _PH_ITEM_STATE
582 {
583  // The item is normal. Use the ItemColorFunction
584  // to determine the color of the item.
586  // The item is new. On the next tick,
587  // change the state to NormalItemState. When an
588  // item is in this state, highlight it in NewColor.
590  // The item is being removed. On the next tick,
591  // delete the item. When an item is in this state,
592  // highlight it in RemovingColor.
594 } PH_ITEM_STATE;
595 
596 typedef COLORREF (NTAPI *PPH_EXTLV_GET_ITEM_COLOR)(
597  _In_ INT Index,
598  _In_ PVOID Param,
599  _In_opt_ PVOID Context
600  );
601 
602 typedef HFONT (NTAPI *PPH_EXTLV_GET_ITEM_FONT)(
603  _In_ INT Index,
604  _In_ PVOID Param,
605  _In_opt_ PVOID Context
606  );
607 
608 PHLIBAPI
609 VOID
610 NTAPI
612  _In_ HWND hWnd
613  );
614 
615 PHLIBAPI
616 VOID
617 NTAPI
619  _In_ HWND hwnd,
620  _In_ INT Index,
621  _In_ PH_SORT_ORDER Order
622  );
623 
624 // next 1122
625 
626 #define ELVM_ADDFALLBACKCOLUMN (WM_APP + 1106)
627 #define ELVM_ADDFALLBACKCOLUMNS (WM_APP + 1109)
628 #define ELVM_RESERVED5 (WM_APP + 1120)
629 #define ELVM_INIT (WM_APP + 1102)
630 #define ELVM_SETCOLUMNWIDTH (WM_APP + 1121)
631 #define ELVM_SETCOMPAREFUNCTION (WM_APP + 1104)
632 #define ELVM_SETCONTEXT (WM_APP + 1103)
633 #define ELVM_SETCURSOR (WM_APP + 1114)
634 #define ELVM_RESERVED4 (WM_APP + 1118)
635 #define ELVM_SETITEMCOLORFUNCTION (WM_APP + 1111)
636 #define ELVM_SETITEMFONTFUNCTION (WM_APP + 1117)
637 #define ELVM_RESERVED1 (WM_APP + 1112)
638 #define ELVM_SETREDRAW (WM_APP + 1116)
639 #define ELVM_RESERVED2 (WM_APP + 1113)
640 #define ELVM_SETSORT (WM_APP + 1108)
641 #define ELVM_SETSORTFAST (WM_APP + 1119)
642 #define ELVM_RESERVED0 (WM_APP + 1110)
643 #define ELVM_SETTRISTATE (WM_APP + 1107)
644 #define ELVM_SETTRISTATECOMPAREFUNCTION (WM_APP + 1105)
645 #define ELVM_SORTITEMS (WM_APP + 1101)
646 #define ELVM_RESERVED3 (WM_APP + 1115)
647 
648 #define ExtendedListView_AddFallbackColumn(hWnd, Column) \
649  SendMessage((hWnd), ELVM_ADDFALLBACKCOLUMN, (WPARAM)(Column), 0)
650 #define ExtendedListView_AddFallbackColumns(hWnd, NumberOfColumns, Columns) \
651  SendMessage((hWnd), ELVM_ADDFALLBACKCOLUMNS, (WPARAM)(NumberOfColumns), (LPARAM)(Columns))
652 #define ExtendedListView_Init(hWnd) \
653  SendMessage((hWnd), ELVM_INIT, 0, 0)
654 #define ExtendedListView_SetColumnWidth(hWnd, Column, Width) \
655  SendMessage((hWnd), ELVM_SETCOLUMNWIDTH, (WPARAM)(Column), (LPARAM)(Width))
656 #define ExtendedListView_SetCompareFunction(hWnd, Column, CompareFunction) \
657  SendMessage((hWnd), ELVM_SETCOMPAREFUNCTION, (WPARAM)(Column), (LPARAM)(CompareFunction))
658 #define ExtendedListView_SetContext(hWnd, Context) \
659  SendMessage((hWnd), ELVM_SETCONTEXT, 0, (LPARAM)(Context))
660 #define ExtendedListView_SetCursor(hWnd, Cursor) \
661  SendMessage((hWnd), ELVM_SETCURSOR, 0, (LPARAM)(Cursor))
662 #define ExtendedListView_SetItemColorFunction(hWnd, ItemColorFunction) \
663  SendMessage((hWnd), ELVM_SETITEMCOLORFUNCTION, 0, (LPARAM)(ItemColorFunction))
664 #define ExtendedListView_SetItemFontFunction(hWnd, ItemFontFunction) \
665  SendMessage((hWnd), ELVM_SETITEMFONTFUNCTION, 0, (LPARAM)(ItemFontFunction))
666 #define ExtendedListView_SetRedraw(hWnd, Redraw) \
667  SendMessage((hWnd), ELVM_SETREDRAW, (WPARAM)(Redraw), 0)
668 #define ExtendedListView_SetSort(hWnd, Column, Order) \
669  SendMessage((hWnd), ELVM_SETSORT, (WPARAM)(Column), (LPARAM)(Order))
670 #define ExtendedListView_SetSortFast(hWnd, Fast) \
671  SendMessage((hWnd), ELVM_SETSORTFAST, (WPARAM)(Fast), 0)
672 #define ExtendedListView_SetTriState(hWnd, TriState) \
673  SendMessage((hWnd), ELVM_SETTRISTATE, (WPARAM)(TriState), 0)
674 #define ExtendedListView_SetTriStateCompareFunction(hWnd, CompareFunction) \
675  SendMessage((hWnd), ELVM_SETTRISTATECOMPAREFUNCTION, 0, (LPARAM)(CompareFunction))
676 #define ExtendedListView_SortItems(hWnd) \
677  SendMessage((hWnd), ELVM_SORTITEMS, 0, 0)
678 
679 #define ELVSCW_AUTOSIZE (-1)
680 #define ELVSCW_AUTOSIZE_USEHEADER (-2)
681 #define ELVSCW_AUTOSIZE_REMAININGSPACE (-3)
682 
691 FORCEINLINE
692 ULONG
694  _In_ COLORREF Color
695  )
696 {
697  ULONG r = Color & 0xff;
698  ULONG g = (Color >> 8) & 0xff;
699  ULONG b = (Color >> 16) & 0xff;
700  ULONG min;
701  ULONG max;
702 
703  min = r;
704  if (g < min) min = g;
705  if (b < min) min = b;
706 
707  max = r;
708  if (g > max) max = g;
709  if (b > max) max = b;
710 
711  return (min + max) / 2;
712 }
713 
714 FORCEINLINE
715 COLORREF
717  _In_ COLORREF Color
718  )
719 {
720  /*return RGB(
721  (UCHAR)Color / 2,
722  (UCHAR)(Color >> 8) / 2,
723  (UCHAR)(Color >> 16) / 2
724  );*/
725  // Since all targets are little-endian, we can use the following method.
726  *((PUCHAR)&Color) /= 2;
727  *((PUCHAR)&Color + 1) /= 2;
728  *((PUCHAR)&Color + 2) /= 2;
729 
730  return Color;
731 }
732 
733 FORCEINLINE
734 COLORREF
736  _In_ COLORREF Color,
737  _In_ UCHAR Increment
738  )
739 {
740  UCHAR r;
741  UCHAR g;
742  UCHAR b;
743 
744  r = (UCHAR)Color;
745  g = (UCHAR)(Color >> 8);
746  b = (UCHAR)(Color >> 16);
747 
748  if (r <= 255 - Increment)
749  r += Increment;
750  else
751  r = 255;
752 
753  if (g <= 255 - Increment)
754  g += Increment;
755  else
756  g = 255;
757 
758  if (b <= 255 - Increment)
759  b += Increment;
760  else
761  b = 255;
762 
763  return RGB(r, g, b);
764 }
765 
766 #ifdef __cplusplus
767 }
768 #endif
769 
770 #endif