ReactOS  0.4.13-dev-73-gcfe54aa
window.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ChildWndInfo
 information structure for creation of a MDI child window More...
 
struct  Window
 
struct  Window::StaticWindowData
 structure for managing critical sections as static class information in struct Window More...
 
struct  TypeCheck< CLASS >
 dynamic casting of Window pointers More...
 
struct  SubclassedWindow
 
struct  WindowCreator< WND_CLASS >
 template class used in macro WINDOW_CREATOR to define the creater functions for Window objects More...
 
struct  WindowCreatorInfo< WND_CLASS, INFO_CLASS >
 template class used in macro WINDOW_CREATOR_INFO to the define creater functions for Window objects with additional creation information More...
 
struct  WindowClass
 
struct  BtnWindowClass
 window class with gray background color More...
 
struct  IconWindowClass
 window class with specified icon from resources More...
 
struct  MenuInfo
 menu info structure More...
 
struct  PreTranslateWindow
 
struct  ChildWindow
 
struct  DialogWindow
 
struct  Dialog
 
struct  PropSheetPage
 
struct  PropertySheetDialog
 Property Sheet dialog. More...
 
struct  PropSheetPageDlg
 Property Sheet Page (inner dialog) More...
 
struct  ResizeEntry
 structure to assign RESIZE_FLAGS to dialogs control More...
 
struct  ResizeManager
 Management of controls in resizable dialogs. More...
 
struct  ResizeController< BASE >
 Controller base template class for resizable dialogs. More...
 
struct  Button
 
struct  Static
 
struct  CtlColorParent< BASE >
 
struct  OwnerDrawParent< BASE >
 draw message routing for ColorButton and PictureButton More...
 
struct  OwnerdrawnButton
 
struct  FlatButton
 
struct  PictureButton
 
struct  ColorStatic
 
struct  HyperlinkCtrl
 Hyperlink Controls. More...
 
struct  ToolTip
 encapsulation of tool tip controls More...
 
struct  ListSort
 sorting of list controls More...
 
struct  TrayIcon
 
struct  TrayIconControllerTemplate< BASE >
 
struct  EditController
 

Macros

#define GET_WINDOW(CLASS, hwnd)   Window::get_window<CLASS>(hwnd)
 
#define NFR_CURRENT   NFR_ANSI
 
#define WINDOW_DYNAMIC_CAST(CLASS, hwnd)   TypeCheck<CLASS>::dyn_cast(Window::get_window(hwnd))
 
#define WINDOW_CREATOR(WND_CLASS)   ((Window::CREATORFUNC) WindowCreator<WND_CLASS>::window_creator)
 
#define WINDOW_CREATOR_INFO(WND_CLASS, INFO_CLASS)   ((Window::CREATORFUNC_INFO) WindowCreatorInfo<WND_CLASS, INFO_CLASS>::window_creator)
 
#define PM_DISPATCH_COMMAND   (WM_APP+0x00)
 
#define PM_TRANSLATE_MSG   (WM_APP+0x01)
 
#define SPLIT_WIDTH   5
 
#define DEFAULT_SPLIT_POS   300
 
#define COLOR_SPLITBAR   LTGRAY_BRUSH
 
#define PM_FRM_GET_MENUINFO   (WM_APP+0x02)
 
#define Frame_GetMenuInfo(hwnd)   ((MenuInfo*)SNDMSG(hwnd, PM_FRM_GET_MENUINFO, 0, 0))
 
#define PM_SETSTATUSTEXT   (WM_APP+0x1E)
 
#define PM_FRM_CALC_CLIENT   (WM_APP+0x03)
 
#define Frame_CalcFrameClient(hwnd, prt)   ((BOOL)SNDMSG(hwnd, PM_FRM_CALC_CLIENT, 0, (LPARAM)(PRECT)prt))
 
#define PM_JUMP_TO_URL   (WM_APP+0x25)
 
#define PM_URL_CHANGED   (WM_APP+0x26)
 
#define PM_DISPATCH_CTLCOLOR   (WM_APP+0x08)
 
#define PM_DISPATCH_DRAWITEM   (WM_APP+0x09)
 
#define PM_TRAYICON   (WM_APP+0x20)
 
#define WINMSG_TASKBARCREATED   TEXT("TaskbarCreated")
 
#define WINMSG_SHELLHOOK   TEXT("SHELLHOOK")
 

Typedefs

typedef set< HWNDWindowSet
 

Enumerations

enum  RESIZE_FLAGS {
  MOVE_LEFT = 0x1, MOVE_RIGHT = 0x2, MOVE_TOP = 0x4, MOVE_BOTTOM = 0x8,
  MOVE_X = MOVE_LEFT | MOVE_RIGHT, MOVE_Y = MOVE_TOP | MOVE_BOTTOM, RESIZE_X = MOVE_RIGHT, RESIZE_Y = MOVE_BOTTOM,
  MOVE = MOVE_X | MOVE_Y, RESIZE = RESIZE_X | RESIZE_Y
}
 Flags to specify how to move and resize controls when resizing their parent window. More...
 
enum  { TRAYBUTTON_LEFT =0, TRAYBUTTON_RIGHT, TRAYBUTTON_MIDDLE }
 

Functions

void DrawGrayText (HDC hdc, LPRECT pRect, LPCTSTR text, int dt_flags)
 
int ListView_GetItemData (HWND list_ctrl, int idx)
 
int ListView_FindItemPara (HWND list_ctrl, LPARAM param)
 
int ListView_GetFocusedItem (HWND list_ctrl)
 
LPARAM TreeView_GetItemData (HWND hwndTreeView, HTREEITEM hItem)
 

Macro Definition Documentation

◆ COLOR_SPLITBAR

#define COLOR_SPLITBAR   LTGRAY_BRUSH

Definition at line 271 of file window.h.

◆ DEFAULT_SPLIT_POS

#define DEFAULT_SPLIT_POS   300

Definition at line 270 of file window.h.

◆ Frame_CalcFrameClient

#define Frame_CalcFrameClient (   hwnd,
  prt 
)    ((BOOL)SNDMSG(hwnd, PM_FRM_CALC_CLIENT, 0, (LPARAM)(PRECT)prt))

Definition at line 388 of file window.h.

◆ Frame_GetMenuInfo

#define Frame_GetMenuInfo (   hwnd)    ((MenuInfo*)SNDMSG(hwnd, PM_FRM_GET_MENUINFO, 0, 0))

Definition at line 282 of file window.h.

◆ GET_WINDOW

#define GET_WINDOW (   CLASS,
  hwnd 
)    Window::get_window<CLASS>(hwnd)

Definition at line 88 of file window.h.

◆ NFR_CURRENT

#define NFR_CURRENT   NFR_ANSI

Definition at line 144 of file window.h.

◆ PM_DISPATCH_COMMAND

#define PM_DISPATCH_COMMAND   (WM_APP+0x00)

Definition at line 265 of file window.h.

◆ PM_DISPATCH_CTLCOLOR

#define PM_DISPATCH_CTLCOLOR   (WM_APP+0x08)

Definition at line 593 of file window.h.

◆ PM_DISPATCH_DRAWITEM

#define PM_DISPATCH_DRAWITEM   (WM_APP+0x09)

Definition at line 621 of file window.h.

◆ PM_FRM_CALC_CLIENT

#define PM_FRM_CALC_CLIENT   (WM_APP+0x03)

Definition at line 387 of file window.h.

◆ PM_FRM_GET_MENUINFO

#define PM_FRM_GET_MENUINFO   (WM_APP+0x02)

Definition at line 280 of file window.h.

◆ PM_JUMP_TO_URL

#define PM_JUMP_TO_URL   (WM_APP+0x25)

Definition at line 390 of file window.h.

◆ PM_SETSTATUSTEXT

#define PM_SETSTATUSTEXT   (WM_APP+0x1E)

Definition at line 340 of file window.h.

◆ PM_TRANSLATE_MSG

#define PM_TRANSLATE_MSG   (WM_APP+0x01)

Definition at line 266 of file window.h.

◆ PM_TRAYICON

#define PM_TRAYICON   (WM_APP+0x20)

Definition at line 984 of file window.h.

◆ PM_URL_CHANGED

#define PM_URL_CHANGED   (WM_APP+0x26)

Definition at line 391 of file window.h.

◆ SPLIT_WIDTH

#define SPLIT_WIDTH   5

Definition at line 269 of file window.h.

◆ WINDOW_CREATOR

#define WINDOW_CREATOR (   WND_CLASS)    ((Window::CREATORFUNC) WindowCreator<WND_CLASS>::window_creator)

Definition at line 202 of file window.h.

◆ WINDOW_CREATOR_INFO

#define WINDOW_CREATOR_INFO (   WND_CLASS,
  INFO_CLASS 
)    ((Window::CREATORFUNC_INFO) WindowCreatorInfo<WND_CLASS, INFO_CLASS>::window_creator)

Definition at line 215 of file window.h.

◆ WINDOW_DYNAMIC_CAST

#define WINDOW_DYNAMIC_CAST (   CLASS,
  hwnd 
)    TypeCheck<CLASS>::dyn_cast(Window::get_window(hwnd))

Definition at line 166 of file window.h.

◆ WINMSG_SHELLHOOK

#define WINMSG_SHELLHOOK   TEXT("SHELLHOOK")

Definition at line 988 of file window.h.

◆ WINMSG_TASKBARCREATED

#define WINMSG_TASKBARCREATED   TEXT("TaskbarCreated")

Definition at line 986 of file window.h.

Typedef Documentation

◆ WindowSet

typedef set<HWND> WindowSet

Definition at line 29 of file window.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
TRAYBUTTON_LEFT 
TRAYBUTTON_RIGHT 
TRAYBUTTON_MIDDLE 

Definition at line 982 of file window.h.

◆ RESIZE_FLAGS

Flags to specify how to move and resize controls when resizing their parent window.

Enumerator
MOVE_LEFT 
MOVE_RIGHT 
MOVE_TOP 
MOVE_BOTTOM 
MOVE_X 
MOVE_Y 
RESIZE_X 
RESIZE_Y 
MOVE 
RESIZE 

Definition at line 455 of file window.h.

455  {
456  MOVE_LEFT = 0x1,
457  MOVE_RIGHT = 0x2,
458  MOVE_TOP = 0x4,
459  MOVE_BOTTOM = 0x8,
460 
465 
466  MOVE = MOVE_X | MOVE_Y,
468 };
Definition: window.h:466
Definition: window.h:462
Definition: window.h:467
Definition: window.h:461

Function Documentation

◆ DrawGrayText()

void DrawGrayText ( HDC  hdc,
LPRECT  pRect,
LPCTSTR  text,
int  dt_flags 
)

Definition at line 891 of file window.cpp.

892 {
894 
895  if (gray) {
896  TextColor lcColor(hdc, GetSysColor(COLOR_BTNHIGHLIGHT));
897  RECT shadowRect = {pRect->left+1, pRect->top+1, pRect->right+1, pRect->bottom+1};
898  DrawText(hdc, title, -1, &shadowRect, dt_flags);
899 
900  SetTextColor(hdc, gray);
901  DrawText(hdc, title, -1, pRect, dt_flags);
902  } else {
903  int old_r = pRect->right;
904  int old_b = pRect->bottom;
905 
906  DrawText(hdc, title, -1, pRect, dt_flags|DT_CALCRECT);
907 
908  int x = pRect->left + (old_r-pRect->right)/2;
909  int y = pRect->top + (old_b-pRect->bottom)/2;
910  int w = pRect->right-pRect->left;
911  int h = pRect->bottom-pRect->top;
914 
916  }
917 }
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
LONG top
Definition: windef.h:292
#define COLOR_BTNHIGHLIGHT
Definition: winuser.h:925
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
LONG left
Definition: windef.h:291
LONG right
Definition: windef.h:293
DWORD WINAPI GetSysColor(_In_ int)
#define DrawText
Definition: winuser.h:5637
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
#define DT_CALCRECT
Definition: winuser.h:526
LONG_PTR LPARAM
Definition: windef.h:208
DWORD COLORREF
Definition: windef.h:285
#define COLOR_GRAYTEXT
Definition: winuser.h:922
HDC hdc
Definition: main.c:9
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
Definition: text.c:884
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
LONG bottom
Definition: windef.h:294
#define GrayString
Definition: winuser.h:5668
static BOOL CALLBACK MyDrawText(HDC hdc, LPARAM data, int cnt)
Definition: window.cpp:885
HBRUSH WINAPI GetSysColorBrush(_In_ int)
static RECT s_MyDrawText_Rect
Definition: window.cpp:883
static char title[]
Definition: ps.c:92

Referenced by PictureButton::DrawItem(), and if().

◆ ListView_FindItemPara()

int ListView_FindItemPara ( HWND  list_ctrl,
LPARAM  param 
)
inline

Definition at line 928 of file window.h.

929 {
930  LVFINDINFO fi;
931 
932  fi.flags = LVFI_PARAM;
933  fi.lParam = param;
934 
935  return ListView_FindItem(list_ctrl, (unsigned)-1, &fi);
936 }
#define LVFI_PARAM
Definition: commctrl.h:2408
GLfloat param
Definition: glext.h:5796
#define LVFINDINFO
Definition: commctrl.h:2435
#define ListView_FindItem(hwnd, iStart, plvfi)
Definition: commctrl.h:2442

Referenced by ListSort::sort().

◆ ListView_GetFocusedItem()

int ListView_GetFocusedItem ( HWND  list_ctrl)
inline

Definition at line 938 of file window.h.

939 {
940  int idx = ListView_GetItemCount(list_ctrl);
941 
942  while(--idx >= 0)
943  if (ListView_GetItemState(list_ctrl, idx, LVIS_FOCUSED))
944  break;
945 
946  return idx;
947 }
#define ListView_GetItemState(hwndLV, i, mask)
Definition: commctrl.h:2648
unsigned int idx
Definition: utils.c:41
#define ListView_GetItemCount(hwnd)
Definition: commctrl.h:2279
#define LVIS_FOCUSED
Definition: commctrl.h:2290

◆ ListView_GetItemData()

int ListView_GetItemData ( HWND  list_ctrl,
int  idx 
)
inline

Definition at line 915 of file window.h.

916 {
917  LV_ITEM item;
918 
919  item.mask = LVIF_PARAM;
920  item.iItem = idx;
921 
922  if (!ListView_GetItem(list_ctrl, &item))
923  return 0;
924 
925  return item.lParam;
926 }
#define LV_ITEM
Definition: commctrl.h:2309
unsigned int idx
Definition: utils.c:41
static ATOM item
Definition: dde.c:856
#define ListView_GetItem(hwnd, pitem)
Definition: commctrl.h:2366
#define LVIF_PARAM
Definition: commctrl.h:2283

Referenced by FindProgramDlg::LaunchSelected(), and ListSort::sort().

◆ TreeView_GetItemData()

LPARAM TreeView_GetItemData ( HWND  hwndTreeView,
HTREEITEM  hItem 
)
inline

Definition at line 968 of file window.h.

969 {
970  TVITEM tvItem;
971 
972  tvItem.mask = TVIF_PARAM;
973  tvItem.hItem = hItem;
974 
975  if (!TreeView_GetItem(hwndTreeView, &tvItem))
976  return 0;
977 
978  return tvItem.lParam;
979 }
HTREEITEM hItem
Definition: treelist.h:37
LPARAM lParam
Definition: treeview.c:155
HWND hwndTreeView
Definition: eventvwr.c:82
#define TVITEM
Definition: commctrl.h:3337
#define TVIF_PARAM
Definition: commctrl.h:3240
#define TreeView_GetItem(hwnd, pitem)
Definition: commctrl.h:3462

Referenced by MainFrameBase::Notify(), ShellBrowser::OnDefaultCommand(), ShellBrowser::OnTreeItemExpanding(), ShellBrowser::OnTreeItemRClick(), ShellBrowser::select_entry(), ShellBrowser::select_folder(), and TrayNotifyDlg::SetIconMode().