ReactOS 0.4.16-dev-311-g9382aa2
globals.h File Reference
Include dependency graph for globals.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  FileTypeInfo
 management of file types More...
 
struct  FileTypeManager
 
struct  Icon
 
struct  SysCacheIcon
 
struct  IconCache
 
struct  Desktop
 
struct  Desktops
 
struct  ExplorerGlobals
 structure containing global variables of Explorer More...
 
struct  ResString
 convenient loading of string resources More...
 
struct  ResIcon
 convenient loading of standard (32x32) icon resources More...
 
struct  SmallIcon
 convenient loading of small (16x16) icon resources More...
 
struct  ResIconEx
 convenient loading of icon resources with specified sizes More...
 
struct  ResBitmap
 convenient loading of bitmap resources More...
 

Macros

#define ICON_SIZE_SMALL   16
 
#define ICON_SIZE_MIDDLE   24
 
#define ICON_SIZE_LARGE   32
 
#define STARTMENUROOT_ICON_SIZE   ICON_SIZE_MIDDLE
 
#define ICON_SIZE_FROM_ICF(flags)   (flags&ICF_LARGE? ICON_SIZE_LARGE: flags&ICF_MIDDLE? ICON_SIZE_MIDDLE: ICON_SIZE_SMALL)
 
#define ICF_FROM_ICON_SIZE(size)   (size>=ICON_SIZE_LARGE? ICF_LARGE: size>=ICON_SIZE_MIDDLE? ICF_MIDDLE: (ICONCACHE_FLAGS)0)
 
#define DESKTOP_COUNT   4
 

Typedefs

typedef pair< HWND, DWORDMinimizeStruct
 desktop management
 
typedef Desktop DesktopRef
 

Enumerations

enum  ICON_TYPE { IT_STATIC , IT_CACHED , IT_DYNAMIC , IT_SYSCACHE }
 
enum  ICON_ID {
  ICID_UNKNOWN , ICID_NONE , ICID_FOLDER , ICID_APP ,
  ICID_EXPLORER , ICID_CONFIG , ICID_DOCUMENTS , ICID_FAVORITES ,
  ICID_INFO , ICID_APPS , ICID_SEARCH , ICID_ACTION ,
  ICID_SEARCH_DOC , ICID_PRINTER , ICID_NETWORK , ICID_COMPUTER ,
  ICID_LOGOFF , ICID_SHUTDOWN , ICID_RESTART , ICID_BOOKMARK ,
  ICID_MINIMIZE , ICID_CONTROLPAN , ICID_DESKSETTING , ICID_NETCONNS ,
  ICID_ADMIN , ICID_RECENT , ICID_DYNAMIC
}
 

Functions

HBITMAP create_bitmap_from_icon (HICON hIcon, HBRUSH hbrush_bkgnd, HDC hdc_wnd)
 create a bitmap from an icon
 
int ImageList_AddAlphaIcon (HIMAGELIST himl, HICON hIcon, HBRUSH hbrush_bkgnd, HDC hdc_wnd)
 add icon with alpha channel to imagelist using the specified background color
 
HICON get_window_icon_small (HWND hwnd)
 retrieve icon from window
 
HICON get_window_icon_big (HWND hwnd, bool allow_from_class=true)
 
void SetWindowIcon (HWND hwnd, UINT nid)
 set big and small icons out of the resources for a window
 

Variables

struct ExplorerGlobals g_Globals
 

Macro Definition Documentation

◆ DESKTOP_COUNT

#define DESKTOP_COUNT   4

Definition at line 238 of file globals.h.

◆ ICF_FROM_ICON_SIZE

#define ICF_FROM_ICON_SIZE (   size)    (size>=ICON_SIZE_LARGE? ICF_LARGE: size>=ICON_SIZE_MIDDLE? ICF_MIDDLE: (ICONCACHE_FLAGS)0)

Definition at line 176 of file globals.h.

◆ ICON_SIZE_FROM_ICF

#define ICON_SIZE_FROM_ICF (   flags)    (flags&ICF_LARGE? ICON_SIZE_LARGE: flags&ICF_MIDDLE? ICON_SIZE_MIDDLE: ICON_SIZE_SMALL)

Definition at line 175 of file globals.h.

◆ ICON_SIZE_LARGE

#define ICON_SIZE_LARGE   32

Definition at line 171 of file globals.h.

◆ ICON_SIZE_MIDDLE

#define ICON_SIZE_MIDDLE   24

Definition at line 170 of file globals.h.

◆ ICON_SIZE_SMALL

#define ICON_SIZE_SMALL   16

Definition at line 169 of file globals.h.

◆ STARTMENUROOT_ICON_SIZE

#define STARTMENUROOT_ICON_SIZE   ICON_SIZE_MIDDLE

Definition at line 173 of file globals.h.

Typedef Documentation

◆ DesktopRef

Definition at line 233 of file globals.h.

◆ MinimizeStruct

desktop management

Definition at line 225 of file globals.h.

Enumeration Type Documentation

◆ ICON_ID

Enumerator
ICID_UNKNOWN 
ICID_NONE 
ICID_FOLDER 
ICID_APP 
ICID_EXPLORER 
ICID_CONFIG 
ICID_DOCUMENTS 
ICID_FAVORITES 
ICID_INFO 
ICID_APPS 
ICID_SEARCH 
ICID_ACTION 
ICID_SEARCH_DOC 
ICID_PRINTER 
ICID_NETWORK 
ICID_COMPUTER 
ICID_LOGOFF 
ICID_SHUTDOWN 
ICID_RESTART 
ICID_BOOKMARK 
ICID_MINIMIZE 
ICID_CONTROLPAN 
ICID_DESKSETTING 
ICID_NETCONNS 
ICID_ADMIN 
ICID_RECENT 
ICID_DYNAMIC 

Definition at line 62 of file globals.h.

62 {
65
67 //ICID_DOCUMENT,
70
92
94};
@ ICID_INFO
Definition: globals.h:74
@ ICID_NETWORK
Definition: globals.h:80
@ ICID_DOCUMENTS
Definition: globals.h:72
@ ICID_DYNAMIC
Definition: globals.h:93
@ ICID_RECENT
Definition: globals.h:91
@ ICID_PRINTER
Definition: globals.h:79
@ ICID_CONTROLPAN
Definition: globals.h:87
@ ICID_RESTART
Definition: globals.h:84
@ ICID_SHUTDOWN
Definition: globals.h:83
@ ICID_EXPLORER
Definition: globals.h:69
@ ICID_SEARCH_DOC
Definition: globals.h:78
@ ICID_ACTION
Definition: globals.h:77
@ ICID_CONFIG
Definition: globals.h:71
@ ICID_FAVORITES
Definition: globals.h:73
@ ICID_COMPUTER
Definition: globals.h:81
@ ICID_SEARCH
Definition: globals.h:76
@ ICID_ADMIN
Definition: globals.h:90
@ ICID_DESKSETTING
Definition: globals.h:88
@ ICID_LOGOFF
Definition: globals.h:82
@ ICID_APP
Definition: globals.h:68
@ ICID_BOOKMARK
Definition: globals.h:85
@ ICID_UNKNOWN
Definition: globals.h:63
@ ICID_MINIMIZE
Definition: globals.h:86
@ ICID_NONE
Definition: globals.h:64
@ ICID_FOLDER
Definition: globals.h:66
@ ICID_APPS
Definition: globals.h:75
@ ICID_NETCONNS
Definition: globals.h:89

◆ ICON_TYPE

Enumerator
IT_STATIC 
IT_CACHED 
IT_DYNAMIC 
IT_SYSCACHE 

Definition at line 55 of file globals.h.

55 {
60};
@ IT_SYSCACHE
Definition: globals.h:59
@ IT_DYNAMIC
Definition: globals.h:58
@ IT_STATIC
Definition: globals.h:56
@ IT_CACHED
Definition: globals.h:57

Function Documentation

◆ create_bitmap_from_icon()

HBITMAP create_bitmap_from_icon ( HICON  hIcon,
HBRUSH  hbrush_bkgnd,
HDC  hdc_wnd 
)

create a bitmap from an icon

Definition at line 332 of file explorer.cpp.

333{
334 int cx = ICON_SIZE_SMALL;
335 int cy = ICON_SIZE_SMALL;
337
338 MemCanvas canvas;
339 BitmapSelection sel(canvas, hbmp);
340
341 RECT rect = {0, 0, cx, cy};
342 FillRect(canvas, &rect, hbrush_bkgnd);
343
344 DrawIconEx(canvas, 0, 0, hIcon, cx, cy, 0, hbrush_bkgnd, DI_NORMAL);
345
346 return hbmp;
347}
HBITMAP hbmp
#define ICON_SIZE_SMALL
Definition: globals.h:169
static HBITMAP
Definition: button.c:44
HICON hIcon
Definition: msconfig.c:44
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
_Out_opt_ int * cx
Definition: commctrl.h:585
& rect
Definition: startmenu.cpp:1413
#define DI_NORMAL
Definition: wingdi.h:72
HBITMAP WINAPI CreateCompatibleBitmap(_In_ HDC hdc, _In_ INT cx, _In_ INT cy)
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
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:2080

Referenced by Icon::create_bitmap(), TaskBar::EnumWndProc(), and ImageList_AddAlphaIcon().

◆ get_window_icon_big()

HICON get_window_icon_big ( HWND  hwnd,
bool  allow_from_class = true 
)

Definition at line 347 of file taskbar.cpp.

348{
349 HICON hIcon = 0;
350
352
353 if (!hIcon)
354 SendMessageTimeout(hwnd, WM_GETICON, ICON_SMALL2, 0, SMTO_ABORTIFHUNG, 1000, (PDWORD_PTR)&hIcon);
355
356 if (!hIcon)
358
359 if (allow_from_class) {
360 if (!hIcon)
362
363 if (!hIcon)
365 }
366
367 if (!hIcon)
369
370 return hIcon;
371}
ULONG_PTR * PDWORD_PTR
Definition: basetsd.h:182
static HICON
Definition: imagelist.c:80
#define ICON_BIG
Definition: tnclass.cpp:51
#define ICON_SMALL
Definition: tnclass.cpp:48
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
#define SendMessageTimeout
Definition: winuser.h:5857
#define GetClassLongPtr
Definition: winuser.h:5794
#define WM_QUERYDRAGICON
Definition: winuser.h:1657
#define GCL_HICONSM
Definition: winuser.h:667
#define SMTO_ABORTIFHUNG
Definition: winuser.h:1226
#define GCL_HICON
Definition: winuser.h:666

◆ get_window_icon_small()

HICON get_window_icon_small ( HWND  hwnd)

retrieve icon from window

Definition at line 323 of file taskbar.cpp.

324{
325 HICON hIcon = 0;
326
327 SendMessageTimeout(hwnd, WM_GETICON, ICON_SMALL2, 0, SMTO_ABORTIFHUNG, 1000, (PDWORD_PTR)&hIcon);
328
329 if (!hIcon)
331
332 if (!hIcon)
334
335 if (!hIcon)
337
338 if (!hIcon)
340
341 if (!hIcon)
343
344 return hIcon;
345}

Referenced by TaskBar::EnumWndProc().

◆ ImageList_AddAlphaIcon()

int ImageList_AddAlphaIcon ( HIMAGELIST  himl,
HICON  hIcon,
HBRUSH  hbrush_bkgnd,
HDC  hdc_wnd 
)

add icon with alpha channel to imagelist using the specified background color

Definition at line 366 of file explorer.cpp.

367{
368 HBITMAP hbmp = create_bitmap_from_icon(hIcon, hbrush_bkgnd, hdc_wnd);
369
370 int ret = ImageList_Add(himl, hbmp, 0);
371
373
374 return ret;
375}
HIMAGELIST himl
INT WINAPI ImageList_Add(HIMAGELIST himl, HBITMAP hbmImage, HBITMAP hbmMask)
Definition: imagelist.c:448
pKey DeleteObject()
HBITMAP create_bitmap_from_icon(HICON hIcon, HBRUSH hbrush_bkgnd, HDC hdc_wnd)
create a bitmap from an icon
Definition: explorer.cpp:332
int ret

Referenced by Icon::add_to_imagelist(), MainFrameBase::FillBookmarks(), TrayNotifyDlg::InsertItem(), and TrayNotifyDlg::TrayNotifyDlg().

◆ SetWindowIcon()

void SetWindowIcon ( HWND  hwnd,
UINT  nid 
)

set big and small icons out of the resources for a window

Definition at line 689 of file explorer.cpp.

690{
693
694 HICON hIconSmall = SmallIcon(nid);
695 (void)Window_SetIcon(hwnd, ICON_SMALL, hIconSmall);
696}
NOTIFYICONDATA nid
Definition: magnifier.c:44
#define Window_SetIcon(hwnd, type, hicon)
Definition: utility.h:155
convenient loading of standard (32x32) icon resources
Definition: globals.h:310
convenient loading of small (16x16) icon resources
Definition: globals.h:321

Referenced by DesktopBar::DesktopBar(), ExplorerAboutDlg::ExplorerAboutDlg(), FindProgramDlg::FindProgramDlg(), and TrayNotifyDlg::TrayNotifyDlg().

Variable Documentation

◆ g_Globals