ReactOS  0.4.11-dev-433-g473ca91
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 More...
 
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 More...
 
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 More...
 
HICON get_window_icon_small (HWND hwnd)
 retrieve icon from window More...
 
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 More...
 

Variables

struct ExplorerGlobals g_Globals
 

Macro Definition Documentation

#define DESKTOP_COUNT   4
#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.

#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.

Referenced by IconCache::extract().

#define ICON_SIZE_LARGE   32

Definition at line 171 of file globals.h.

#define ICON_SIZE_MIDDLE   24

Definition at line 170 of file globals.h.

#define ICON_SIZE_SMALL   16

Definition at line 169 of file globals.h.

Referenced by StartMenu::Create(), create_bitmap_from_icon(), and IconCache::extract().

#define STARTMENUROOT_ICON_SIZE   ICON_SIZE_MIDDLE

Definition at line 173 of file globals.h.

Referenced by DesktopBar::Init(), and IconCache::init().

Typedef Documentation

Definition at line 233 of file globals.h.

desktop management

Definition at line 225 of file globals.h.

Enumeration Type Documentation

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  {
64  ICID_NONE,
65 
67  //ICID_DOCUMENT,
68  ICID_APP,
70 
74  ICID_INFO,
75  ICID_APPS,
90  ICID_ADMIN,
92 
94 };
Enumerator
IT_STATIC 
IT_CACHED 
IT_DYNAMIC 
IT_SYSCACHE 

Definition at line 55 of file globals.h.

55  {
56  IT_STATIC,
57  IT_CACHED,
58  IT_DYNAMIC,
60 };

Function Documentation

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.

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

333 {
334  int cx = ICON_SIZE_SMALL;
335  int cy = ICON_SIZE_SMALL;
336  HBITMAP hbmp = CreateCompatibleBitmap(hdc_wnd, cx, cy);
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 }
#define HBITMAP
Definition: msvc.h:28
HBITMAP WINAPI CreateCompatibleBitmap(_In_ HDC hdc, _In_ INT cx, _In_ INT cy)
& rect
Definition: startmenu.cpp:1413
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:570
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 ICON_SIZE_SMALL
Definition: globals.h:169
#define DI_NORMAL
Definition: wingdi.h:72
HICON hIcon
Definition: msconfig.c:44
_Out_opt_ int * cx
Definition: commctrl.h:570
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
HBITMAP hbmp
Definition: msvc.h:60
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 
351  SendMessageTimeout(hwnd, WM_GETICON, ICON_BIG, 0, SMTO_ABORTIFHUNG, 1000, (PDWORD_PTR)&hIcon);
352 
353  if (!hIcon)
354  SendMessageTimeout(hwnd, WM_GETICON, ICON_SMALL2, 0, SMTO_ABORTIFHUNG, 1000, (PDWORD_PTR)&hIcon);
355 
356  if (!hIcon)
357  SendMessageTimeout(hwnd, WM_GETICON, ICON_SMALL, 0, SMTO_ABORTIFHUNG, 1000, (PDWORD_PTR)&hIcon);
358 
359  if (allow_from_class) {
360  if (!hIcon)
361  hIcon = (HICON)GetClassLongPtr(hwnd, GCL_HICON);
362 
363  if (!hIcon)
365  }
366 
367  if (!hIcon)
368  SendMessageTimeout(hwnd, WM_QUERYDRAGICON, 0, 0, 0, 1000, (PDWORD_PTR)&hIcon);
369 
370  return hIcon;
371 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static HICON
Definition: imagelist.c:84
#define GCL_HICONSM
Definition: winuser.h:662
#define SMTO_ABORTIFHUNG
Definition: winuser.h:1209
#define ICON_SMALL
Definition: tnclass.cpp:48
#define WM_QUERYDRAGICON
Definition: winuser.h:1636
#define SendMessageTimeout
Definition: winuser.h:5711
ULONG_PTR * PDWORD_PTR
Definition: basetsd.h:184
#define GetClassLongPtr
Definition: winuser.h:5648
#define GCL_HICON
Definition: winuser.h:661
HICON hIcon
Definition: msconfig.c:44
#define ICON_BIG
Definition: tnclass.cpp:51
HICON get_window_icon_small ( HWND  hwnd)

retrieve icon from window

Definition at line 323 of file taskbar.cpp.

Referenced by TaskBar::EnumWndProc().

324 {
325  HICON hIcon = 0;
326 
327  SendMessageTimeout(hwnd, WM_GETICON, ICON_SMALL2, 0, SMTO_ABORTIFHUNG, 1000, (PDWORD_PTR)&hIcon);
328 
329  if (!hIcon)
330  SendMessageTimeout(hwnd, WM_GETICON, ICON_SMALL, 0, SMTO_ABORTIFHUNG, 1000, (PDWORD_PTR)&hIcon);
331 
332  if (!hIcon)
333  SendMessageTimeout(hwnd, WM_GETICON, ICON_BIG, 0, SMTO_ABORTIFHUNG, 1000, (PDWORD_PTR)&hIcon);
334 
335  if (!hIcon)
337 
338  if (!hIcon)
339  hIcon = (HICON)GetClassLongPtr(hwnd, GCL_HICON);
340 
341  if (!hIcon)
342  SendMessageTimeout(hwnd, WM_QUERYDRAGICON, 0, 0, 0, 1000, (PDWORD_PTR)&hIcon);
343 
344  return hIcon;
345 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static HICON
Definition: imagelist.c:84
#define GCL_HICONSM
Definition: winuser.h:662
#define SMTO_ABORTIFHUNG
Definition: winuser.h:1209
#define ICON_SMALL
Definition: tnclass.cpp:48
#define WM_QUERYDRAGICON
Definition: winuser.h:1636
#define SendMessageTimeout
Definition: winuser.h:5711
ULONG_PTR * PDWORD_PTR
Definition: basetsd.h:184
#define GetClassLongPtr
Definition: winuser.h:5648
#define GCL_HICON
Definition: winuser.h:661
HICON hIcon
Definition: msconfig.c:44
#define ICON_BIG
Definition: tnclass.cpp:51
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.

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

367 {
368  HBITMAP hbmp = create_bitmap_from_icon(hIcon, hbrush_bkgnd, hdc_wnd);
369 
370  int ret = ImageList_Add(himl, hbmp, 0);
371 
372  DeleteObject(hbmp);
373 
374  return ret;
375 }
#define HBITMAP
Definition: msvc.h:28
INT WINAPI ImageList_Add(HIMAGELIST himl, HBITMAP hbmImage, HBITMAP hbmMask)
Definition: imagelist.c:413
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
int ret
HICON hIcon
Definition: msconfig.c:44
HBITMAP create_bitmap_from_icon(HICON hIcon, HBRUSH hbrush_bkgnd, HDC hdc_wnd)
create a bitmap from an icon
Definition: explorer.cpp:332
HBITMAP hbmp
Definition: msvc.h:60
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.

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

690 {
691  HICON hIcon = ResIcon(nid);
692  (void)Window_SetIcon(hwnd, ICON_BIG, hIcon);
693 
694  HICON hIconSmall = SmallIcon(nid);
695  (void)Window_SetIcon(hwnd, ICON_SMALL, hIconSmall);
696 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static HICON
Definition: imagelist.c:84
convenient loading of standard (32x32) icon resources
Definition: globals.h:309
NOTIFYICONDATA nid
Definition: magnifier.c:45
#define ICON_SMALL
Definition: tnclass.cpp:48
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:47
#define Window_SetIcon(hwnd, type, hicon)
Definition: utility.h:155
convenient loading of small (16x16) icon resources
Definition: globals.h:320
HICON hIcon
Definition: msconfig.c:44
#define ICON_BIG
Definition: tnclass.cpp:51

Variable Documentation