ReactOS  0.4.15-dev-1033-gd7d716a
Window Class Reference

#include <window.h>

Inheritance diagram for Window:
Collaboration diagram for Window:

Classes

struct  StaticWindowData
 structure for managing critical sections as static class information in struct Window More...
 

Public Types

typedef map< HWND, Window * > WindowMap
 
typedef Window *(* CREATORFUNC) (HWND)
 
typedef Window *(* CREATORFUNC_INFO) (HWND, const void *)
 

Public Member Functions

 Window (HWND hwnd)
 
virtual ~Window ()
 
LRESULT SendParent (UINT nmsg, WPARAM wparam=0, LPARAM lparam=0)
 
LRESULT PostParent (UINT nmsg, WPARAM wparam=0, LPARAM lparam=0)
 
 Window (INT cx, INT cy, BOOL fAutoHide=FALSE)
 
virtual ~Window ()
 
virtual LRESULT CALLBACK WindowProcDx (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
void DoAction ()
 

Static Public Member Functions

static HWND Create (CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0)
 
static HWND Create (CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0)
 
static Windowcreate_mdi_child (const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator)
 
static LRESULT CALLBACK WindowWndProc (HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
 
static INT_PTR CALLBACK DialogProc (HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
 
static Windowget_window (HWND hwnd)
 get window controller from window handle More...
 
template<typename CLASS >
static CLASS * get_window (HWND hwnd)
 
static void register_pretranslate (HWND hwnd)
 
static void unregister_pretranslate (HWND hwnd)
 
static BOOL pretranslate_msg (LPMSG pmsg)
 
static void register_dialog (HWND hwnd)
 
static void unregister_dialog (HWND hwnd)
 
static BOOL dispatch_dialog_msg (LPMSG pmsg)
 
static int MessageLoop ()
 
static void CancelModes ()
 
static BOOL DoRegisterClass (HINSTANCE hInstance)
 
static HWND DoCreateMainWnd (HINSTANCE hInstance, LPCTSTR pszText, INT cx, INT cy, DWORD style=WS_POPUP|WS_THICKFRAME|WS_CLIPCHILDREN, DWORD exstyle=WS_EX_WINDOWEDGE|WS_EX_TOOLWINDOW|WS_EX_TOPMOST, BOOL fAutoHide=FALSE)
 
static INT DoMainLoop ()
 
static WindowGetAppbarData (HWND hwnd)
 
static LRESULT CALLBACK WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static DWORD WINAPI ActionThreadFunc (LPVOID args)
 

Public Attributes

IAccessible IAccessible_iface
 
IOleWindow IOleWindow_iface
 
IEnumVARIANT IEnumVARIANT_iface
 
LONG ref
 

Protected Member Functions

virtual LRESULT Init (LPCREATESTRUCT pcs)
 
virtual LRESULT WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
 
virtual int Command (int id, int code)
 
virtual int Notify (int id, NMHDR *pnmh)
 
void OnCommand (HWND hwnd, int id, HWND hwndCtl, UINT codeNotify)
 
void OnPaint (HWND hwnd)
 
void OnRButtonDown (HWND hwnd, BOOL fDoubleClick, int x, int y, UINT keyFlags)
 
void OnKey (HWND hwnd, UINT vk, BOOL fDown, int cRepeat, UINT flags)
 
void OnAppBarCallback (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
BOOL AppBar_Register (HWND hwnd)
 
BOOL AppBar_UnRegister (HWND hwnd)
 
BOOL AppBar_SetAutoHide (HWND hwnd, BOOL fHide)
 
BOOL AppBar_AutoHide (HWND hwnd)
 
BOOL AppBar_NoAutoHide (HWND hwnd)
 
BOOL AppBar_SetSide (HWND hwnd, UINT uSide)
 
void AppBar_SetAlwaysOnTop (HWND hwnd, BOOL fOnTop)
 
void AppBar_Hide (HWND hwnd)
 
void AppBar_UnHide (HWND hwnd)
 
void AppBar_SetAutoHideTimer (HWND hwnd)
 
void AppBar_SetAutoUnhideTimer (HWND hwnd)
 
void AppBar_Size (HWND hwnd)
 
void AppBar_QueryPos (HWND hwnd, LPRECT lprc)
 
void AppBar_QuerySetPos (UINT uEdge, LPRECT lprc, PAPPBARDATA pabd, BOOL fMove)
 
void AppBar_PosChanged (PAPPBARDATA pabd)
 
BOOL OnCreate (HWND hwnd, LPCREATESTRUCT lpCreateStruct)
 
void OnActivate (HWND hwnd, UINT state, HWND hwndActDeact, BOOL fMinimized)
 
void OnWindowPosChanged (HWND hwnd, const LPWINDOWPOS lpwpos)
 
void OnSize (HWND hwnd, UINT state, int cx, int cy)
 
void OnMove (HWND hwnd, int x, int y)
 
void OnNCDestroy (HWND hwnd)
 
void OnTimer (HWND hwnd, UINT id)
 
UINT OnNCHitTest (HWND hwnd, int x, int y)
 
void OnLButtonDown (HWND hwnd, BOOL fDoubleClick, int x, int y, UINT keyFlags)
 
void OnMouseMove (HWND hwnd, int x, int y, UINT keyFlags)
 
void OnLButtonUp (HWND hwnd, int x, int y, UINT keyFlags)
 
void GetWorkArea (LPRECT prc) const
 

Static Protected Member Functions

static Windowcreate_controller (HWND hwnd)
 create controller for a new window More...
 
static StaticWindowDataGetStaticWindowData ()
 
static LRESULT CALLBACK MDICBTHookProc (int code, WPARAM wparam, LPARAM lparam)
 
static LRESULT CALLBACK PropSheetCBTHookProc (int code, WPARAM wparam, LPARAM lparam)
 

Protected Attributes

HWND m_hwnd
 
BOOL m_fAutoHide
 
BOOL m_fOnTop
 
BOOL m_fHiding
 
UINT m_uSide
 
LONG m_cxWidth
 
LONG m_cyHeight
 
LONG m_cxSave
 
LONG m_cySave
 
BOOL m_fAppBarRegd
 
BOOL m_fMoving
 
BOOL m_bDragged
 
POINT m_ptDragOn
 
RECT m_rcAppBar
 
RECT m_rcDrag
 

Static Protected Attributes

static WindowMap s_wnd_map
 
static const voids_new_info = NULL
 
static CREATORFUNC s_window_creator = NULL
 
static HHOOK s_hcbtHook = 0
 
static WindowSet s_pretranslate_windows
 
static WindowSet s_dialogs
 

Detailed Description

Class Window is the base class for several C++ window wrapper classes. Window objects are allocated from the heap. They are automatically freed when the window gets destroyed.

Definition at line 28 of file window.c.

Member Typedef Documentation

◆ CREATORFUNC

typedef Window*(* Window::CREATORFUNC) (HWND)

Definition at line 66 of file window.h.

◆ CREATORFUNC_INFO

typedef Window*(* Window::CREATORFUNC_INFO) (HWND, const void *)

Definition at line 67 of file window.h.

◆ WindowMap

typedef map<HWND,Window*> Window::WindowMap

Definition at line 64 of file window.h.

Constructor & Destructor Documentation

◆ Window() [1/2]

Window::Window ( HWND  hwnd)

Definition at line 71 of file window.cpp.

72  : WindowHandle(hwnd)
73 {
74  Lock lock(GetStaticWindowData()._map_crit_sect); // protect access to s_wnd_map
75 
76  s_wnd_map[_hwnd] = this;
77 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
rwlock_t lock
Definition: tcpcore.h:1163
static StaticWindowData & GetStaticWindowData()
Definition: window.cpp:63
IN OUT PLONG IN OUT PLONG Addend IN OUT PLONG IN LONG IN OUT PLONG IN LONG Increment IN PNDIS_RW_LOCK Lock
Definition: CrNtStubs.h:75
static WindowMap s_wnd_map
Definition: window.h:117

Referenced by DoCreateMainWnd().

◆ ~Window() [1/2]

Window::~Window ( )
virtual

Definition at line 79 of file window.cpp.

80 {
81  Lock lock(GetStaticWindowData()._map_crit_sect); // protect access to s_wnd_map
82 
83  s_wnd_map.erase(_hwnd);
84 }
rwlock_t lock
Definition: tcpcore.h:1163
static StaticWindowData & GetStaticWindowData()
Definition: window.cpp:63
void erase(iterator __pos)
Definition: _map.h:203
IN OUT PLONG IN OUT PLONG Addend IN OUT PLONG IN LONG IN OUT PLONG IN LONG Increment IN PNDIS_RW_LOCK Lock
Definition: CrNtStubs.h:75
static WindowMap s_wnd_map
Definition: window.h:117

◆ Window() [2/2]

Window::Window ( INT  cx,
INT  cy,
BOOL  fAutoHide = FALSE 
)
inline

Definition at line 140 of file SHAppBarMessage.cpp.

141  : m_hwnd(NULL)
142  , m_fAutoHide(fAutoHide)
143  , m_cxWidth(cx)
144  , m_cyHeight(cy)
145  {
146  }
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:581
smooth NULL
Definition: ftsmooth.c:416
BOOL m_fAutoHide
_Out_opt_ int * cx
Definition: commctrl.h:581

◆ ~Window() [2/2]

virtual Window::~Window ( )
inlinevirtual

Definition at line 148 of file SHAppBarMessage.cpp.

149  {
150  }

Member Function Documentation

◆ ActionThreadFunc()

static DWORD WINAPI Window::ActionThreadFunc ( LPVOID  args)
inlinestatic

Definition at line 1109 of file SHAppBarMessage.cpp.

1110  {
1111  Window *this_ = (Window *)args;
1112  this_->DoAction();
1113  return 0;
1114  }
void DoAction()
Definition: match.c:390
Definition: window.c:28

Referenced by OnCommand().

◆ AppBar_AutoHide()

BOOL Window::AppBar_AutoHide ( HWND  hwnd)
inlineprotected

Definition at line 372 of file SHAppBarMessage.cpp.

373  {
374  APPBARDATA abd = { sizeof(abd) };
375  abd.hWnd = hwnd;
376  abd.uEdge = m_uSide;
377 
378  HWND hwndAutoHide = (HWND)SHAppBarMessage(ABM_GETAUTOHIDEBAR, &abd);
379  if (hwndAutoHide)
380  return FALSE;
381 
382  abd.lParam = TRUE;
384  return FALSE;
385 
386  m_fAutoHide = TRUE;
389 
390  RECT rc = m_rcAppBar;
391  switch (m_uSide)
392  {
393  case ABE_TOP:
394  rc.bottom = rc.top + 2;
395  break;
396  case ABE_BOTTOM:
397  rc.top = rc.bottom - 2;
398  break;
399  case ABE_LEFT:
400  rc.right = rc.left + 2;
401  break;
402  case ABE_RIGHT:
403  rc.left = rc.right - 2;
404  break;
405  }
406 
407  AppBar_QueryPos(hwnd, &rc);
408  abd.rc = rc;
410  rc = abd.rc;
411 
412  m_fHiding = TRUE;
413  SlideWindow(hwnd, &rc);
414 
416  return TRUE;
417  }
#define ABM_GETAUTOHIDEBAR
Definition: shellapi.h:66
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define ABE_TOP
Definition: shellapi.h:18
void AppBar_SetAutoHideTimer(HWND hwnd)
void AppBar_QueryPos(HWND hwnd, LPRECT lprc)
#define TRUE
Definition: types.h:120
LONG top
Definition: windef.h:307
HANDLE HWND
Definition: compat.h:19
HWND hWnd
Definition: shellapi.h:216
LONG left
Definition: windef.h:306
LONG right
Definition: windef.h:308
#define ABE_LEFT
Definition: shellapi.h:17
LPARAM lParam
Definition: shellapi.h:220
void SlideWindow(HWND hwnd, LPRECT prc)
UINT_PTR WINAPI SHAppBarMessage(DWORD msg, PAPPBARDATA data)
Definition: appbar.c:64
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define ABE_RIGHT
Definition: shellapi.h:19
BOOL m_fAutoHide
#define ABM_SETAUTOHIDEBAR
Definition: shellapi.h:67
#define ABE_BOTTOM
Definition: shellapi.h:20
LONG bottom
Definition: windef.h:309
#define ABM_SETPOS
Definition: shellapi.h:62
UINT uEdge
Definition: shellapi.h:218

Referenced by AppBar_SetAutoHide(), and OnLButtonUp().

◆ AppBar_Hide()

void Window::AppBar_Hide ( HWND  hwnd)
inlineprotected

Definition at line 493 of file SHAppBarMessage.cpp.

494  {
495  if (!m_fAutoHide)
496  return;
497 
498  RECT rc = m_rcAppBar;
499  switch (m_uSide)
500  {
501  case ABE_TOP:
502  rc.bottom = rc.top + 2;
503  break;
504  case ABE_BOTTOM:
505  rc.top = rc.bottom - 2;
506  break;
507  case ABE_LEFT:
508  rc.right = rc.left + 2;
509  break;
510  case ABE_RIGHT:
511  rc.left = rc.right - 2;
512  break;
513  }
514 
515  m_fHiding = TRUE;
516  SlideWindow(hwnd, &rc);
517  }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define ABE_TOP
Definition: shellapi.h:18
#define TRUE
Definition: types.h:120
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
LONG right
Definition: windef.h:308
#define ABE_LEFT
Definition: shellapi.h:17
void SlideWindow(HWND hwnd, LPRECT prc)
#define ABE_RIGHT
Definition: shellapi.h:19
BOOL m_fAutoHide
#define ABE_BOTTOM
Definition: shellapi.h:20
LONG bottom
Definition: windef.h:309

Referenced by OnActivate(), and OnTimer().

◆ AppBar_NoAutoHide()

BOOL Window::AppBar_NoAutoHide ( HWND  hwnd)
inlineprotected

Definition at line 419 of file SHAppBarMessage.cpp.

420  {
421  APPBARDATA abd = { sizeof(abd) };
422  abd.hWnd = hwnd;
423  abd.uEdge = m_uSide;
424  HWND hwndAutoHide = (HWND)SHAppBarMessage(ABM_GETAUTOHIDEBAR, &abd);
425  if (hwndAutoHide != hwnd)
426  return FALSE;
427 
428  abd.lParam = FALSE;
430  return FALSE;
431 
432  m_fAutoHide = FALSE;
436  return TRUE;
437  }
#define ABM_GETAUTOHIDEBAR
Definition: shellapi.h:66
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
HANDLE HWND
Definition: compat.h:19
HWND hWnd
Definition: shellapi.h:216
LPARAM lParam
Definition: shellapi.h:220
UINT_PTR WINAPI SHAppBarMessage(DWORD msg, PAPPBARDATA data)
Definition: appbar.c:64
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL m_fAutoHide
#define ABM_SETAUTOHIDEBAR
Definition: shellapi.h:67
BOOL AppBar_SetSide(HWND hwnd, UINT uSide)
UINT uEdge
Definition: shellapi.h:218

Referenced by AppBar_SetAutoHide().

◆ AppBar_PosChanged()

void Window::AppBar_PosChanged ( PAPPBARDATA  pabd)
inlineprotected

Definition at line 621 of file SHAppBarMessage.cpp.

622  {
623  RECT rc;
625 
626  if (m_fAutoHide)
627  {
628  m_rcAppBar = rc;
629  switch (m_uSide)
630  {
631  case ABE_TOP:
633  break;
634  case ABE_BOTTOM:
636  break;
637  case ABE_LEFT:
639  break;
640  case ABE_RIGHT:
642  break;
643  }
644  }
645 
646  RECT rcWindow;
647  GetWindowRect(pabd->hWnd, &rcWindow);
648  INT cx = rcWindow.right - rcWindow.left;
649  INT cy = rcWindow.bottom - rcWindow.top;
650  switch (m_uSide)
651  {
652  case ABE_TOP:
653  rc.bottom = rc.top + cy;
654  break;
655  case ABE_BOTTOM:
656  rc.top = rc.bottom - cy;
657  break;
658  case ABE_LEFT:
659  rc.right = rc.left + cx;
660  break;
661  case ABE_RIGHT:
662  rc.left = rc.right - cx;
663  break;
664  }
665  AppBar_QuerySetPos(m_uSide, &rc, pabd, TRUE);
666  }
#define ABE_TOP
Definition: shellapi.h:18
#define TRUE
Definition: types.h:120
LONG top
Definition: windef.h:307
HWND hWnd
Definition: shellapi.h:216
LONG left
Definition: windef.h:306
LONG right
Definition: windef.h:308
#define ABE_LEFT
Definition: shellapi.h:17
int32_t INT
Definition: typedefs.h:58
#define SM_CXSCREEN
Definition: winuser.h:949
void AppBar_QuerySetPos(UINT uEdge, LPRECT lprc, PAPPBARDATA pabd, BOOL fMove)
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:581
#define ABE_RIGHT
Definition: shellapi.h:19
BOOL m_fAutoHide
#define SM_CYSCREEN
Definition: winuser.h:950
int WINAPI GetSystemMetrics(_In_ int)
#define ABE_BOTTOM
Definition: shellapi.h:20
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
_Out_opt_ int * cx
Definition: commctrl.h:581
LONG bottom
Definition: windef.h:309
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)

Referenced by OnAppBarCallback().

◆ AppBar_QueryPos()

void Window::AppBar_QueryPos ( HWND  hwnd,
LPRECT  lprc 
)
inlineprotected

Definition at line 556 of file SHAppBarMessage.cpp.

557  {
558  APPBARDATA abd = { sizeof(abd) };
559  abd.hWnd = hwnd;
560  abd.rc = *lprc;
561  abd.uEdge = m_uSide;
562 
563  INT cx = 0, cy = 0;
564  if (ABE_LEFT == abd.uEdge || ABE_RIGHT == abd.uEdge)
565  {
566  cx = abd.rc.right - abd.rc.left;
567  abd.rc.top = 0;
569  }
570  else
571  {
572  cy = abd.rc.bottom - abd.rc.top;
573  abd.rc.left = 0;
575  }
576 
578 
579  switch (abd.uEdge)
580  {
581  case ABE_LEFT:
582  abd.rc.right = abd.rc.left + cx;
583  break;
584  case ABE_RIGHT:
585  abd.rc.left = abd.rc.right - cx;
586  break;
587  case ABE_TOP:
588  abd.rc.bottom = abd.rc.top + cy;
589  break;
590  case ABE_BOTTOM:
591  abd.rc.top = abd.rc.bottom - cy;
592  break;
593  }
594 
595  *lprc = abd.rc;
596  }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define ABE_TOP
Definition: shellapi.h:18
_In_ int _Inout_ LPRECT lprc
Definition: winuser.h:4440
LONG top
Definition: windef.h:307
HWND hWnd
Definition: shellapi.h:216
LONG left
Definition: windef.h:306
LONG right
Definition: windef.h:308
#define ABE_LEFT
Definition: shellapi.h:17
int32_t INT
Definition: typedefs.h:58
UINT_PTR WINAPI SHAppBarMessage(DWORD msg, PAPPBARDATA data)
Definition: appbar.c:64
#define SM_CXSCREEN
Definition: winuser.h:949
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:581
#define ABE_RIGHT
Definition: shellapi.h:19
#define SM_CYSCREEN
Definition: winuser.h:950
int WINAPI GetSystemMetrics(_In_ int)
#define ABE_BOTTOM
Definition: shellapi.h:20
_Out_opt_ int * cx
Definition: commctrl.h:581
#define ABM_QUERYPOS
Definition: shellapi.h:61
LONG bottom
Definition: windef.h:309
UINT uEdge
Definition: shellapi.h:218

Referenced by AppBar_AutoHide(), AppBar_QuerySetPos(), and OnMouseMove().

◆ AppBar_QuerySetPos()

void Window::AppBar_QuerySetPos ( UINT  uEdge,
LPRECT  lprc,
PAPPBARDATA  pabd,
BOOL  fMove 
)
inlineprotected

Definition at line 598 of file SHAppBarMessage.cpp.

599  {
600  pabd->rc = *lprc;
601  pabd->uEdge = uEdge;
602  m_uSide = uEdge;
603 
604  AppBar_QueryPos(pabd->hWnd, &pabd->rc);
605 
607 
608  if (fMove)
609  {
610  RECT rc = pabd->rc;
611  MoveWindow(pabd->hWnd, rc.left, rc.top,
612  rc.right - rc.left, rc.bottom - rc.top, TRUE);
613  }
614 
615  if (!m_fAutoHide)
616  {
617  m_rcAppBar = pabd->rc;
618  }
619  }
_In_ int _Inout_ LPRECT lprc
Definition: winuser.h:4440
void AppBar_QueryPos(HWND hwnd, LPRECT lprc)
#define TRUE
Definition: types.h:120
LONG top
Definition: windef.h:307
HWND hWnd
Definition: shellapi.h:216
LONG left
Definition: windef.h:306
LONG right
Definition: windef.h:308
UINT_PTR WINAPI SHAppBarMessage(DWORD msg, PAPPBARDATA data)
Definition: appbar.c:64
BOOL m_fAutoHide
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
LONG bottom
Definition: windef.h:309
#define ABM_SETPOS
Definition: shellapi.h:62
UINT uEdge
Definition: shellapi.h:218

Referenced by AppBar_PosChanged(), AppBar_SetSide(), AppBar_Size(), and OnLButtonUp().

◆ AppBar_Register()

BOOL Window::AppBar_Register ( HWND  hwnd)
inlineprotected

Definition at line 345 of file SHAppBarMessage.cpp.

346  {
347  APPBARDATA abd = { sizeof(abd) };
348  abd.hWnd = hwnd;
350 
352  return m_fAppBarRegd;
353  }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
UINT uCallbackMessage
Definition: shellapi.h:217
HWND hWnd
Definition: shellapi.h:216
#define BOOL
Definition: nt_native.h:43
UINT_PTR WINAPI SHAppBarMessage(DWORD msg, PAPPBARDATA data)
Definition: appbar.c:64
#define ABM_NEW
Definition: shellapi.h:59
#define APPBAR_CALLBACK
BOOL m_fAppBarRegd

Referenced by OnCreate().

◆ AppBar_SetAlwaysOnTop()

void Window::AppBar_SetAlwaysOnTop ( HWND  hwnd,
BOOL  fOnTop 
)
inlineprotected

Definition at line 486 of file SHAppBarMessage.cpp.

487  {
489  0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
490  m_fOnTop = fOnTop;
491  }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define HWND_TOPMOST
Definition: winuser.h:1194
#define SWP_NOACTIVATE
Definition: winuser.h:1227
#define SWP_NOSIZE
Definition: winuser.h:1230
#define SWP_NOMOVE
Definition: winuser.h:1229
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define HWND_NOTOPMOST
Definition: winuser.h:1192

◆ AppBar_SetAutoHide()

BOOL Window::AppBar_SetAutoHide ( HWND  hwnd,
BOOL  fHide 
)
inlineprotected

Definition at line 364 of file SHAppBarMessage.cpp.

365  {
366  if (fHide)
367  return AppBar_AutoHide(hwnd);
368  else
369  return AppBar_NoAutoHide(hwnd);
370  }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
BOOL AppBar_AutoHide(HWND hwnd)
BOOL AppBar_NoAutoHide(HWND hwnd)

Referenced by AppBar_SetSide(), and OnRButtonDown().

◆ AppBar_SetAutoHideTimer()

void Window::AppBar_SetAutoHideTimer ( HWND  hwnd)
inlineprotected

Definition at line 527 of file SHAppBarMessage.cpp.

528  {
529  if (m_fAutoHide)
530  {
531  SetTimer(hwnd, IDT_AUTOHIDE, 500, NULL);
532  }
533  }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
smooth NULL
Definition: ftsmooth.c:416
BOOL m_fAutoHide
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define IDT_AUTOHIDE

Referenced by AppBar_AutoHide(), and AppBar_UnHide().

◆ AppBar_SetAutoUnhideTimer()

void Window::AppBar_SetAutoUnhideTimer ( HWND  hwnd)
inlineprotected

Definition at line 535 of file SHAppBarMessage.cpp.

536  {
537  if (m_fAutoHide && m_fHiding)
538  {
540  }
541  }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
smooth NULL
Definition: ftsmooth.c:416
BOOL m_fAutoHide
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define IDT_AUTOUNHIDE

Referenced by OnNCHitTest().

◆ AppBar_SetSide()

BOOL Window::AppBar_SetSide ( HWND  hwnd,
UINT  uSide 
)
inlineprotected

Definition at line 439 of file SHAppBarMessage.cpp.

440  {
441  RECT rc;
443 
444  BOOL fAutoHide = FALSE;
445  if (m_fAutoHide)
446  {
447  fAutoHide = m_fAutoHide;
450  m_fHiding = FALSE;
451  }
452 
453  switch (uSide)
454  {
455  case ABE_TOP:
456  rc.bottom = rc.top + m_cyHeight;
457  break;
458  case ABE_BOTTOM:
459  rc.top = rc.bottom - m_cyHeight;
460  break;
461  case ABE_LEFT:
462  rc.right = rc.left + m_cxWidth;
463  break;
464  case ABE_RIGHT:
465  rc.left = rc.right - m_cxWidth;
466  break;
467  }
468 
469  APPBARDATA abd = { sizeof(abd) };
470  abd.hWnd = hwnd;
471  AppBar_QuerySetPos(uSide, &rc, &abd, TRUE);
472 
473  if (fAutoHide)
474  {
476  m_fHiding = TRUE;
477 
481  }
482 
483  return TRUE;
484  }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
BOOL WINAPI RedrawWindow(_In_opt_ HWND, _In_opt_ LPCRECT, _In_opt_ HRGN, _In_ UINT)
#define ABE_TOP
Definition: shellapi.h:18
#define SetWindowRedraw(hwnd, fRedraw)
Definition: windowsx.h:509
#define TRUE
Definition: types.h:120
LONG top
Definition: windef.h:307
HWND hWnd
Definition: shellapi.h:216
LONG left
Definition: windef.h:306
LONG right
Definition: windef.h:308
#define ABE_LEFT
Definition: shellapi.h:17
#define SM_CXSCREEN
Definition: winuser.h:949
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
void AppBar_QuerySetPos(UINT uEdge, LPRECT lprc, PAPPBARDATA pabd, BOOL fMove)
smooth NULL
Definition: ftsmooth.c:416
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:656
#define ABE_RIGHT
Definition: shellapi.h:19
BOOL m_fAutoHide
#define SM_CYSCREEN
Definition: winuser.h:950
int WINAPI GetSystemMetrics(_In_ int)
#define ABE_BOTTOM
Definition: shellapi.h:20
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
BOOL AppBar_SetAutoHide(HWND hwnd, BOOL fHide)
#define RDW_ALLCHILDREN
Definition: winuser.h:1207
#define RDW_UPDATENOW
Definition: winuser.h:1206
LONG bottom
Definition: windef.h:309
#define RDW_INVALIDATE
Definition: winuser.h:1200

Referenced by AppBar_NoAutoHide(), DoAction(), and OnCreate().

◆ AppBar_Size()

void Window::AppBar_Size ( HWND  hwnd)
inlineprotected

Definition at line 543 of file SHAppBarMessage.cpp.

544  {
545  if (m_fAppBarRegd)
546  {
547  APPBARDATA abd = { sizeof(abd) };
548  abd.hWnd = hwnd;
549 
550  RECT rc;
551  GetWindowRect(hwnd, &rc);
552  AppBar_QuerySetPos(m_uSide, &rc, &abd, TRUE);
553  }
554  }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
HWND hWnd
Definition: shellapi.h:216
void AppBar_QuerySetPos(UINT uEdge, LPRECT lprc, PAPPBARDATA pabd, BOOL fMove)
BOOL m_fAppBarRegd
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)

Referenced by OnMove(), and OnSize().

◆ AppBar_UnHide()

void Window::AppBar_UnHide ( HWND  hwnd)
inlineprotected

Definition at line 519 of file SHAppBarMessage.cpp.

520  {
522  m_fHiding = FALSE;
523 
525  }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
void AppBar_SetAutoHideTimer(HWND hwnd)
void SlideWindow(HWND hwnd, LPRECT prc)
#define FALSE
Definition: types.h:117

Referenced by OnActivate(), and OnTimer().

◆ AppBar_UnRegister()

BOOL Window::AppBar_UnRegister ( HWND  hwnd)
inlineprotected

Definition at line 355 of file SHAppBarMessage.cpp.

356  {
357  APPBARDATA abd = { sizeof(abd) };
358  abd.hWnd = hwnd;
359 
361  return !m_fAppBarRegd;
362  }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
HWND hWnd
Definition: shellapi.h:216
UINT_PTR WINAPI SHAppBarMessage(DWORD msg, PAPPBARDATA data)
Definition: appbar.c:64
BOOL m_fAppBarRegd
#define ABM_REMOVE
Definition: shellapi.h:60

Referenced by OnNCDestroy().

◆ CancelModes()

void Window::CancelModes ( )
static

Definition at line 295 of file window.cpp.

296 {
298 }
#define PostMessage
Definition: winuser.h:5807
#define WM_CANCELMODE
Definition: winuser.h:1617
#define HWND_BROADCAST
Definition: winuser.h:1190

◆ Command()

◆ Create() [1/2]

HWND Window::Create ( CREATORFUNC  creator,
DWORD  dwExStyle,
LPCTSTR  lpClassName,
LPCTSTR  lpWindowName,
DWORD  dwStyle,
int  x,
int  y,
int  w,
int  h,
HWND  hwndParent = 0,
HMENU  hMenu = 0 
)
static

Definition at line 87 of file window.cpp.

91 {
92  Lock lock(GetStaticWindowData()._create_crit_sect); // protect access to s_window_creator and s_new_info
93 
94  s_window_creator = creator;
95  s_new_info = NULL;
96 
97  return CreateWindowEx(dwExStyle, lpClassName, lpWindowName, dwStyle,
98  x, y, w, h,
99  hwndParent, hMenu, g_Globals._hInstance, 0/*lpParam*/);
100 }
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
rwlock_t lock
Definition: tcpcore.h:1163
static StaticWindowData & GetStaticWindowData()
Definition: window.cpp:63
static CREATORFUNC s_window_creator
Definition: window.h:120
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
#define CreateWindowEx
Definition: winuser.h:5730
smooth NULL
Definition: ftsmooth.c:416
static HWND hwndParent
Definition: cryptui.c:300
HINSTANCE _hInstance
Definition: globals.h:270
ExplorerGlobals g_Globals
Definition: explorer.cpp:52
IN OUT PLONG IN OUT PLONG Addend IN OUT PLONG IN LONG IN OUT PLONG IN LONG Increment IN PNDIS_RW_LOCK Lock
Definition: CrNtStubs.h:75
static const void * s_new_info
Definition: window.h:119
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548

Referenced by DesktopWindow::Create(), TaskBar::Create(), DesktopBar::Create(), MDIMainFrame::Create(), NotifyArea::Create(), SDIMainFrame::Create(), StartMenu::Create(), ClockWindow::Create(), and StartMenuRoot::Create().

◆ Create() [2/2]

HWND Window::Create ( CREATORFUNC_INFO  creator,
const void info,
DWORD  dwExStyle,
LPCTSTR  lpClassName,
LPCTSTR  lpWindowName,
DWORD  dwStyle,
int  x,
int  y,
int  w,
int  h,
HWND  hwndParent = 0,
HMENU  hMenu = 0 
)
static

Definition at line 102 of file window.cpp.

106 {
107  Lock lock(GetStaticWindowData()._create_crit_sect); // protect access to s_window_creator and s_new_info
108 
109  s_window_creator = (CREATORFUNC) creator;
110  s_new_info = info;
111 
112  return CreateWindowEx(dwExStyle, lpClassName, lpWindowName, dwStyle,
113  x, y, w, h,
114  hwndParent, hMenu, g_Globals._hInstance, 0/*lpParam*/);
115 }
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
rwlock_t lock
Definition: tcpcore.h:1163
static StaticWindowData & GetStaticWindowData()
Definition: window.cpp:63
static CREATORFUNC s_window_creator
Definition: window.h:120
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
struct _test_info info[]
Definition: SetCursorPos.c:19
#define CreateWindowEx
Definition: winuser.h:5730
static HWND hwndParent
Definition: cryptui.c:300
HINSTANCE _hInstance
Definition: globals.h:270
ExplorerGlobals g_Globals
Definition: explorer.cpp:52
IN OUT PLONG IN OUT PLONG Addend IN OUT PLONG IN LONG IN OUT PLONG IN LONG Increment IN PNDIS_RW_LOCK Lock
Definition: CrNtStubs.h:75
static const void * s_new_info
Definition: window.h:119
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
Window *(* CREATORFUNC)(HWND)
Definition: window.h:66

◆ create_controller()

Window * Window::create_controller ( HWND  hwnd)
staticprotected

create controller for a new window

Definition at line 220 of file window.cpp.

221 {
222  if (s_window_creator) { // protect for recursion and create the window object only for the first window
223  Lock lock(GetStaticWindowData()._create_crit_sect); // protect access to s_window_creator and s_new_info
224 
225  const void* info = s_new_info;
226  s_new_info = NULL;
227 
228  CREATORFUNC window_creator = s_window_creator;
230 
231  if (info)
232  return CREATORFUNC_INFO(window_creator)(hwnd, info);
233  else
234  return CREATORFUNC(window_creator)(hwnd);
235  }
236 
237  return NULL;
238 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
rwlock_t lock
Definition: tcpcore.h:1163
static StaticWindowData & GetStaticWindowData()
Definition: window.cpp:63
static CREATORFUNC s_window_creator
Definition: window.h:120
struct _test_info info[]
Definition: SetCursorPos.c:19
smooth NULL
Definition: ftsmooth.c:416
Window *(* CREATORFUNC_INFO)(HWND, const void *)
Definition: window.h:67
IN OUT PLONG IN OUT PLONG Addend IN OUT PLONG IN LONG IN OUT PLONG IN LONG Increment IN PNDIS_RW_LOCK Lock
Definition: CrNtStubs.h:75
static const void * s_new_info
Definition: window.h:119
Window *(* CREATORFUNC)(HWND)
Definition: window.h:66

Referenced by DialogProc(), MDICBTHookProc(), PropSheetCBTHookProc(), and WindowWndProc().

◆ create_mdi_child()

Window * Window::create_mdi_child ( const ChildWndInfo info,
const MDICREATESTRUCT mcs,
CREATORFUNC_INFO  creator 
)
static

Definition at line 118 of file window.cpp.

119 {
120  Lock lock(GetStaticWindowData()._create_crit_sect); // protect access to s_window_creator and s_new_info
121 
122  s_window_creator = (CREATORFUNC) creator;
123  s_new_info = &info;
124 
126 
127  HWND hwnd = (HWND) SendMessage(info._hmdiclient, WM_MDICREATE, 0, (LPARAM)&mcs);
128 
129  // end hook in case it's not already done
130  if (s_hcbtHook)
132 
134  s_new_info = NULL;
135 
136  if (child && (!hwnd || !child->_hwnd))
137  child = NULL;
138 
139  return child;
140 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
rwlock_t lock
Definition: tcpcore.h:1163
static StaticWindowData & GetStaticWindowData()
Definition: window.cpp:63
static CREATORFUNC s_window_creator
Definition: window.h:120
HANDLE HWND
Definition: compat.h:19
static HWND child
Definition: cursoricon.c:298
struct _test_info info[]
Definition: SetCursorPos.c:19
Definition: window.c:28
static LRESULT CALLBACK MDICBTHookProc(int code, WPARAM wparam, LPARAM lparam)
Definition: window.cpp:142
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define WH_CBT
Definition: winuser.h:35
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:458
static HHOOK s_hcbtHook
Definition: window.h:133
#define SetWindowsHookEx
Definition: winuser.h:5831
IN OUT PLONG IN OUT PLONG Addend IN OUT PLONG IN LONG IN OUT PLONG IN LONG Increment IN PNDIS_RW_LOCK Lock
Definition: CrNtStubs.h:75
BOOL WINAPI UnhookWindowsHookEx(_In_ HHOOK)
static const void * s_new_info
Definition: window.h:119
#define WM_MDICREATE
Definition: winuser.h:1794
#define SendMessage
Definition: winuser.h:5818
Window *(* CREATORFUNC)(HWND)
Definition: window.h:66
static struct myctx * mcs
Definition: adnstest.c:53
static Window * get_window(HWND hwnd)
get window controller from window handle
Definition: window.cpp:203

Referenced by FileChildWindow::create(), and ChildWindow::create().

◆ DialogProc()

INT_PTR CALLBACK Window::DialogProc ( HWND  hwnd,
UINT  nmsg,
WPARAM  wparam,
LPARAM  lparam 
)
static

Definition at line 725 of file window.cpp.

726 {
727  Window* pThis = get_window(hwnd);
728 
729  if (pThis) {
730  switch(nmsg) {
731  case WM_COMMAND:
732  pThis->Command(LOWORD(wparam), HIWORD(wparam));
733  return TRUE; // message has been processed
734 
735  case WM_NOTIFY:
736  pThis->Notify(wparam, (NMHDR*)lparam);
737  return TRUE; // message has been processed
738 
739  case WM_NOTIFYFORMAT:
740  SetWindowLongPtr(hwnd, DWLP_MSGRESULT, NFR_CURRENT); // set return value NFR_CURRENT
741  return TRUE; // message has been processed
742 
743  case WM_NCDESTROY:
744  delete pThis;
745  return TRUE; // message has been processed
746 
747  default:
748  return pThis->WndProc(nmsg, wparam, lparam);
749  }
750  } else if (nmsg == WM_INITDIALOG) {
751  pThis = create_controller(hwnd);
752 
753  if (pThis)
754  return pThis->Init(NULL);
755  }
756 
757  return FALSE; // message has not been processed
758 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
virtual LRESULT Init(LPCREATESTRUCT pcs)
Definition: window.cpp:241
static Window * create_controller(HWND hwnd)
create controller for a new window
Definition: window.cpp:220
#define SetWindowLongPtr
Definition: treelist.c:70
#define DWLP_MSGRESULT
Definition: winuser.h:864
Definition: window.c:28
#define FALSE
Definition: types.h:117
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
smooth NULL
Definition: ftsmooth.c:416
virtual int Notify(int id, NMHDR *pnmh)
Definition: window.cpp:290
#define NFR_CURRENT
Definition: window.h:144
#define WM_NCDESTROY
Definition: winuser.h:1666
virtual LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
Definition: window.cpp:280
#define WM_COMMAND
Definition: winuser.h:1722
#define HIWORD(l)
Definition: typedefs.h:247
virtual int Command(int id, int code)
Definition: window.cpp:285
#define WM_INITDIALOG
Definition: winuser.h:1721
#define LOWORD(l)
Definition: pedump.c:82
static Window * get_window(HWND hwnd)
get window controller from window handle
Definition: window.cpp:203
#define WM_NOTIFY
Definition: richedit.h:61
static UINT WPARAM wparam
Definition: combo.c:716

Referenced by Dialog::DoModal().

◆ dispatch_dialog_msg()

BOOL Window::dispatch_dialog_msg ( LPMSG  pmsg)
static

Definition at line 619 of file window.cpp.

620 {
622  if (IsDialogMessage(*it, pmsg))
623  return TRUE;
624 
625  return FALSE;
626 }
static WindowSet s_dialogs
Definition: window.h:138
#define TRUE
Definition: types.h:120
#define IsDialogMessage
Definition: winuser.h:5784
#define FALSE
Definition: types.h:117
static clock_t begin
Definition: xmllint.c:466
iterator end()
Definition: _set.h:152
_Rep_type::const_iterator const_iterator
Definition: _set.h:74

Referenced by PropertySheetDialog::DoModal(), MessageLoop(), and StartMenuRoot::TrackStartmenu().

◆ DoAction()

void Window::DoAction ( )
inline

Definition at line 971 of file SHAppBarMessage.cpp.

972  {
973 #define INTERVAL 250
974  POINT pt;
975  RECT rc1, rc2, rcWork;
977 
978  GetWindowRect(s_hwnd1, &rc1);
980  GetWorkArea(&rcWork);
982  ok_long(rc1.top, s_rcWorkArea.top);
984  ok_long(rc1.bottom, s_rcWorkArea.top + 80);
985  ok_long(rc2.left, s_rcWorkArea.left);
986  ok_long(rc2.top, s_rcWorkArea.top + 80);
987  ok_long(rc2.right, s_rcWorkArea.right);
988  ok_long(rc2.bottom, s_rcWorkArea.top + 110);
989  ok_long(rcWork.left, s_rcWorkArea.left);
990  ok_long(rcWork.top, s_rcWorkArea.top + 110);
991  ok_long(rcWork.right, s_rcWorkArea.right);
993  PostMessage(s_hwnd1, WM_CLOSE, 0, 0);
994  Sleep(INTERVAL);
995 
997  GetWorkArea(&rcWork);
998  ok_long(rc2.left, s_rcWorkArea.left);
999  ok_long(rc2.top, s_rcWorkArea.top);
1000  ok_long(rc2.right, s_rcWorkArea.right);
1001  ok_long(rc2.bottom, s_rcWorkArea.top + 30);
1002  ok_long(rcWork.left, s_rcWorkArea.left);
1003  ok_long(rcWork.top, s_rcWorkArea.top + 30);
1004  ok_long(rcWork.right, s_rcWorkArea.right);
1005  ok_long(rcWork.bottom, s_rcWorkArea.bottom);
1007  Sleep(INTERVAL);
1008 
1010  GetWorkArea(&rcWork);
1011  ok_long(rc2.left, s_rcWorkArea.left);
1012  ok_long(rc2.top, s_rcWorkArea.top);
1013  ok_long(rc2.right, s_rcWorkArea.left + 30);
1014  ok_long(rcWork.left, s_rcWorkArea.left + 30);
1015  ok_long(rcWork.top, s_rcWorkArea.top);
1016  ok_long(rcWork.right, s_rcWorkArea.right);
1017  ok_long(rcWork.bottom, s_rcWorkArea.bottom);
1019  Sleep(INTERVAL);
1020 
1022  GetWorkArea(&rcWork);
1023  ok_long(rc2.left, s_rcWorkArea.left);
1024  ok_long(rc2.top, s_rcWorkArea.top);
1025  ok_long(rc2.right, s_rcWorkArea.right);
1026  ok_long(rc2.bottom, s_rcWorkArea.top + 30);
1027  ok_long(rcWork.left, s_rcWorkArea.left);
1028  ok_long(rcWork.top, s_rcWorkArea.top + 30);
1029  ok_long(rcWork.right, s_rcWorkArea.right);
1030  ok_long(rcWork.bottom, s_rcWorkArea.bottom);
1032  Sleep(INTERVAL);
1033 
1035  GetWorkArea(&rcWork);
1036  ok_long(rc2.left, s_rcWorkArea.right - 30);
1037  ok_long(rc2.top, s_rcWorkArea.top);
1038  ok_long(rc2.right, s_rcWorkArea.right);
1039  ok_long(rcWork.left, s_rcWorkArea.left);
1040  ok_long(rcWork.top, s_rcWorkArea.top);
1041  ok_long(rcWork.right, s_rcWorkArea.right - 30);
1042  ok_long(rcWork.bottom, s_rcWorkArea.bottom);
1043  Sleep(INTERVAL);
1044 
1046  pt.x = (rc2.left + rc2.right) / 2;
1047  pt.y = (rc2.top + rc2.bottom) / 2;
1048  MOVE(pt.x, pt.y);
1049  LEFT_DOWN();
1050  MOVE(pt.x + 64, pt.y + 64);
1051  Sleep(INTERVAL);
1052 
1053  pt.x = s_rcWorkArea.left + 80;
1054  pt.y = (s_rcWorkArea.top + s_rcWorkArea.bottom) / 2;
1055  MOVE(pt.x, pt.y);
1056  LEFT_UP();
1057  Sleep(INTERVAL);
1058 
1060  GetWorkArea(&rcWork);
1061  ok_long(rc2.left, s_rcWorkArea.left);
1062  ok_long(rc2.top, s_rcWorkArea.top);
1063  ok_long(rc2.right, s_rcWorkArea.left + 30);
1064  ok_long(rcWork.left, s_rcWorkArea.left + 30);
1065  ok_long(rcWork.top, s_rcWorkArea.top);
1066  ok_long(rcWork.right, s_rcWorkArea.right);
1067  ok_long(rcWork.bottom, s_rcWorkArea.bottom);
1068  Sleep(INTERVAL);
1069 
1071  pt.x = (rc2.left + rc2.right) / 2;
1072  pt.y = (rc2.top + rc2.bottom) / 2;
1073  MOVE(pt.x, pt.y);
1074  LEFT_DOWN();
1075  MOVE(pt.x + 64, pt.y + 64);
1076  Sleep(INTERVAL);
1077 
1078  pt.x = s_rcWorkArea.right - 80;
1079  pt.y = (s_rcWorkArea.top + s_rcWorkArea.bottom) / 2;
1080  MOVE(pt.x, pt.y);
1081  LEFT_UP();
1082  Sleep(INTERVAL);
1083 
1085  GetWorkArea(&rcWork);
1086  ok_long(rc2.left, s_rcWorkArea.right - 30);
1087  ok_long(rc2.top, s_rcWorkArea.top);
1088  ok_long(rc2.right, s_rcWorkArea.right);
1089  ok_long(rcWork.left, s_rcWorkArea.left);
1090  ok_long(rcWork.top, s_rcWorkArea.top);
1091  ok_long(rcWork.right, s_rcWorkArea.right - 30);
1092  ok_long(rcWork.bottom, s_rcWorkArea.bottom);
1093  Sleep(INTERVAL);
1094 
1095  SendMessage(s_hwnd2, WM_CLOSE, 0, 0);
1096  Sleep(INTERVAL);
1097 
1098  GetWorkArea(&rcWork);
1099  ok_long(rcWork.left, s_rcWorkArea.left);
1100  ok_long(rcWork.top, s_rcWorkArea.top);
1101  ok_long(rcWork.right, s_rcWorkArea.right);
1102  ok_long(rcWork.bottom, s_rcWorkArea.bottom);
1103 
1104  PostMessage(s_hwnd2, WM_QUIT, 0, 0);
1105  PostThreadMessage(dwTID, WM_QUIT, 0, 0);
1106 #undef INTERVAL
1107  }
#define ABE_TOP
Definition: shellapi.h:18
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:790
#define MOVE(x, y)
#define INTERVAL
#define pt(x, y)
Definition: drawing.c:79
#define WM_QUIT
Definition: winuser.h:1605
LONG top
Definition: windef.h:307
#define LEFT_UP()
LONG left
Definition: windef.h:306
#define ok_long(expression, result)
Definition: atltest.h:133
LONG right
Definition: windef.h:308
#define ABE_LEFT
Definition: shellapi.h:17
#define LEFT_DOWN()
DWORD WINAPI GetWindowThreadProcessId(HWND, PDWORD)
smooth NULL
Definition: ftsmooth.c:416
#define ABE_RIGHT
Definition: shellapi.h:19
#define PostMessage
Definition: winuser.h:5807
#define WM_CLOSE
Definition: winuser.h:1603
#define PostThreadMessage
Definition: winuser.h:5808
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL AppBar_SetSide(HWND hwnd, UINT uSide)
static HWND s_hwnd2
static HWND s_hwnd1
static RECT s_rcWorkArea
#define SendMessage
Definition: winuser.h:5818
LONG bottom
Definition: windef.h:309
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
static const WCHAR rc2[]
Definition: oid.c:1216
void GetWorkArea(LPRECT prc) const

Referenced by ActionThreadFunc().

◆ DoCreateMainWnd()

static HWND Window::DoCreateMainWnd ( HINSTANCE  hInstance,
LPCTSTR  pszText,
INT  cx,
INT  cy,
DWORD  style = WS_POPUP | WS_THICKFRAME | WS_CLIPCHILDREN,
DWORD  exstyle = WS_EX_WINDOWEDGE | WS_EX_TOOLWINDOW | WS_EX_TOPMOST,
BOOL  fAutoHide = FALSE 
)
inlinestatic

Definition at line 165 of file SHAppBarMessage.cpp.

169  {
170  Window *this_ = new Window(cx, cy, fAutoHide);
171  HWND hwnd = CreateWindowEx(exstyle, s_szName, pszText, style,
172  CW_USEDEFAULT, CW_USEDEFAULT, 50, 50,
173  NULL, NULL, hInstance, this_);
176  return hwnd;
177  }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
BOOL WINAPI UpdateWindow(_In_ HWND)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
Definition: window.c:28
HINSTANCE hInstance
Definition: charmap.c:20
#define CreateWindowEx
Definition: winuser.h:5730
#define CW_USEDEFAULT
Definition: winuser.h:225
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:581
smooth NULL
Definition: ftsmooth.c:416
#define SW_SHOWNORMAL
Definition: winuser.h:764
static const TCHAR s_szName[]
_Out_opt_ int * cx
Definition: commctrl.h:581
Window(HWND hwnd)
Definition: window.cpp:71
Arabic default style
Definition: afstyles.h:93

Referenced by START_TEST().

◆ DoMainLoop()

static INT Window::DoMainLoop ( )
inlinestatic

Definition at line 179 of file SHAppBarMessage.cpp.

180  {
181  MSG msg;
182  while (GetMessage(&msg, NULL, 0, 0))
183  {
186  }
187  return (INT)msg.wParam;
188  }
#define DispatchMessage
Definition: winuser.h:5740
BOOL WINAPI TranslateMessage(_In_ const MSG *)
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
int32_t INT
Definition: typedefs.h:58
smooth NULL
Definition: ftsmooth.c:416
#define GetMessage
Definition: winuser.h:5765
#define msg(x)
Definition: auth_time.c:54

Referenced by START_TEST().

◆ DoRegisterClass()

static BOOL Window::DoRegisterClass ( HINSTANCE  hInstance)
inlinestatic

Definition at line 152 of file SHAppBarMessage.cpp.

153  {
154  WNDCLASS wc;
155  ZeroMemory(&wc, sizeof(wc));
157  wc.hInstance = hInstance;
160  wc.hbrBackground = (HBRUSH)(COLOR_3DFACE + 1);
161  wc.lpszClassName = s_szName;
162  return !!RegisterClass(&wc);
163  }
#define ZeroMemory
Definition: winbase.h:1648
#define IDI_APPLICATION
Definition: winuser.h:699
HBRUSH hbrBackground
Definition: winuser.h:3145
HINSTANCE hInstance
Definition: charmap.c:20
#define COLOR_3DFACE
Definition: winuser.h:919
HCURSOR hCursor
Definition: winuser.h:3144
smooth NULL
Definition: ftsmooth.c:416
static LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
LPCSTR lpszClassName
Definition: winuser.h:3147
#define LoadCursor
Definition: winuser.h:5787
static const TCHAR s_szName[]
HINSTANCE hInstance
Definition: winuser.h:3142
WNDPROC lpfnWndProc
Definition: winuser.h:3139
#define IDC_ARROW
Definition: winuser.h:682
#define RegisterClass
Definition: winuser.h:5811
#define LoadIcon
Definition: winuser.h:5788
HICON hIcon
Definition: winuser.h:3143

Referenced by START_TEST().

◆ get_window() [1/2]

Window * Window::get_window ( HWND  hwnd)
static

get window controller from window handle

Definition at line 203 of file window.cpp.

204 {
205  {
206  Lock lock(GetStaticWindowData()._map_crit_sect); // protect access to s_wnd_map
207 
208  WindowMap::const_iterator found = s_wnd_map.find(hwnd);
209 
210  if (found!=s_wnd_map.end())
211  return found->second;
212  }
213 
214  return NULL;
215 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
rwlock_t lock
Definition: tcpcore.h:1163
static StaticWindowData & GetStaticWindowData()
Definition: window.cpp:63
smooth NULL
Definition: ftsmooth.c:416
_STLP_TEMPLATE_FOR_CONT_EXT iterator find(const _KT &__x)
Definition: _map.h:210
IN OUT PLONG IN OUT PLONG Addend IN OUT PLONG IN LONG IN OUT PLONG IN LONG Increment IN PNDIS_RW_LOCK Lock
Definition: CrNtStubs.h:75
static WindowMap s_wnd_map
Definition: window.h:117
iterator end()
Definition: _map.h:165

Referenced by create_mdi_child(), DialogProc(), MDICBTHookProc(), PropSheetCBTHookProc(), and WindowWndProc().

◆ get_window() [2/2]

template<typename CLASS >
static CLASS* Window::get_window ( HWND  hwnd)
inlinestatic

Definition at line 87 of file window.h.

87 {return static_cast<CLASS*>(get_window(hwnd));}
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static Window * get_window(HWND hwnd)
get window controller from window handle
Definition: window.cpp:203

Referenced by get_window().

◆ GetAppbarData()

static Window* Window::GetAppbarData ( HWND  hwnd)
inlinestatic

Definition at line 190 of file SHAppBarMessage.cpp.

191  {
193  }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
Definition: window.c:28
#define GWLP_USERDATA
Definition: treelist.c:63
#define GetWindowLongPtr
Definition: treelist.c:73

Referenced by WindowProc().

◆ GetStaticWindowData()

Window::StaticWindowData & Window::GetStaticWindowData ( )
staticprotected

Definition at line 63 of file window.cpp.

64 {
65  static StaticWindowData s_initialized_data;
66 
67  return s_initialized_data;
68 }

Referenced by Create(), create_controller(), create_mdi_child(), Dialog::DoModal(), get_window(), Window(), and ~Window().

◆ GetWorkArea()

void Window::GetWorkArea ( LPRECT  prc) const
inlineprotected

Definition at line 965 of file SHAppBarMessage.cpp.

966  {
967  SystemParametersInfoW(SPI_GETWORKAREA, 0, prc, 0);
968  }
BOOL WINAPI SystemParametersInfoW(_In_ UINT, _In_ UINT, _Inout_opt_ PVOID, _In_ UINT)
_Out_ LPRECT prc
Definition: ntgdi.h:1658

Referenced by DoAction().

◆ Init()

◆ MDICBTHookProc()

LRESULT CALLBACK Window::MDICBTHookProc ( int  code,
WPARAM  wparam,
LPARAM  lparam 
)
staticprotected

Definition at line 142 of file window.cpp.

143 {
144  if (code == HCBT_CREATEWND) {
145  UnhookWindowsHookEx(s_hcbtHook); // use the hook only for the first created window
146  s_hcbtHook = 0;
147 
148  HWND hwnd = (HWND)wparam;
149 
150  // create Window controller and associate it with the window handle
152 
153  if (!child)
155  }
156 
158 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define HCBT_CREATEWND
Definition: winuser.h:58
HANDLE HWND
Definition: compat.h:19
static Window * create_controller(HWND hwnd)
create controller for a new window
Definition: window.cpp:220
static HWND child
Definition: cursoricon.c:298
Definition: window.c:28
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
static HHOOK s_hcbtHook
Definition: window.h:133
Definition: inflate.c:139
BOOL WINAPI UnhookWindowsHookEx(_In_ HHOOK)
LRESULT WINAPI CallNextHookEx(_In_opt_ HHOOK, _In_ int, _In_ WPARAM, _In_ LPARAM)
static Window * get_window(HWND hwnd)
get window controller from window handle
Definition: window.cpp:203
static UINT WPARAM wparam
Definition: combo.c:716

Referenced by create_mdi_child().

◆ MessageLoop()

int Window::MessageLoop ( )
static

Definition at line 629 of file window.cpp.

630 {
631  MSG msg;
632 
633  while(GetMessage(&msg, 0, 0, 0)) {
634  try {
635  if (pretranslate_msg(&msg))
636  continue;
637 
638  if (dispatch_dialog_msg(&msg))
639  continue;
640 
642 
643  try {
645  } catch(COMException& e) {
646  HandleException(e, 0);
647  }
648  } catch(COMException& e) {
649  HandleException(e, 0);
650  }
651  }
652 
653  return msg.wParam;
654 }
#define DispatchMessage
Definition: winuser.h:5740
BOOL WINAPI TranslateMessage(_In_ const MSG *)
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
Exception with context information.
Definition: shellclasses.h:113
#define e
Definition: ke_i.h:82
void HandleException(COMException &e, HWND hwnd)
Exception Handler for COM exceptions.
static BOOL pretranslate_msg(LPMSG pmsg)
Definition: window.cpp:589
#define GetMessage
Definition: winuser.h:5765
#define msg(x)
Definition: auth_time.c:54
static BOOL dispatch_dialog_msg(LPMSG pmsg)
Definition: window.cpp:619

Referenced by explorer_main().

◆ Notify()

◆ OnActivate()

void Window::OnActivate ( HWND  hwnd,
UINT  state,
HWND  hwndActDeact,
BOOL  fMinimized 
)
inlineprotected

Definition at line 686 of file SHAppBarMessage.cpp.

687  {
688  APPBARDATA abd = { sizeof(abd) };
689  abd.hWnd = hwnd;
691 
692  switch (state)
693  {
694  case WA_ACTIVE:
695  case WA_CLICKACTIVE:
698  break;
699 
700  case WA_INACTIVE:
701  AppBar_Hide(hwnd);
702  break;
703  }
704  }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
void AppBar_Hide(HWND hwnd)
HWND hWnd
Definition: shellapi.h:216
#define ABM_ACTIVATE
Definition: shellapi.h:65
UINT_PTR WINAPI SHAppBarMessage(DWORD msg, PAPPBARDATA data)
Definition: appbar.c:64
#define WA_ACTIVE
Definition: winuser.h:2598
#define WA_CLICKACTIVE
Definition: winuser.h:2599
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
static int state
Definition: maze.c:121
#define IDT_AUTOHIDE
#define WA_INACTIVE
Definition: winuser.h:2597
void AppBar_UnHide(HWND hwnd)

Referenced by WindowProcDx().

◆ OnAppBarCallback()

void Window::OnAppBarCallback ( HWND  hwnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
inlineprotected

Definition at line 311 of file SHAppBarMessage.cpp.

312  {
313  static HWND s_hwndZOrder = NULL;
314 
315  switch (wParam)
316  {
317  case ABN_STATECHANGE:
318  break;
319 
320  case ABN_FULLSCREENAPP:
321  if (lParam)
322  {
323  s_hwndZOrder = GetWindow(hwnd, GW_HWNDPREV);
324  SetWindowPos(hwnd, HWND_BOTTOM, 0, 0, 0, 0,
326  }
327  else
328  {
329  SetWindowPos(hwnd, m_fOnTop ? HWND_TOPMOST : s_hwndZOrder,
330  0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
331  s_hwndZOrder = NULL;
332  }
333  break;
334 
335  case ABN_POSCHANGED:
336  {
337  APPBARDATA abd = { sizeof(abd) };
338  abd.hWnd = hwnd;
339  AppBar_PosChanged(&abd);
340  }
341  break;
342  }
343  }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
void AppBar_PosChanged(PAPPBARDATA pabd)
#define HWND_TOPMOST
Definition: winuser.h:1194
HWND hWnd
Definition: shellapi.h:216
WPARAM wParam
Definition: combotst.c:138
smooth NULL
Definition: ftsmooth.c:416
#define HWND_BOTTOM
Definition: winuser.h:1191
#define SWP_NOACTIVATE
Definition: winuser.h:1227
HWND WINAPI GetWindow(_In_ HWND, _In_ UINT)
#define ABN_FULLSCREENAPP
Definition: shellapi.h:71
#define ABN_POSCHANGED
Definition: shellapi.h:70
#define SWP_NOSIZE
Definition: winuser.h:1230
#define SWP_NOMOVE
Definition: winuser.h:1229
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define ABN_STATECHANGE
Definition: shellapi.h:69
LPARAM lParam
Definition: combotst.c:139
#define GW_HWNDPREV
Definition: winuser.h:757

Referenced by WindowProcDx().

◆ OnCommand()

void Window::OnCommand ( HWND  hwnd,
int  id,
HWND  hwndCtl,
UINT  codeNotify 
)
inlineprotected

Definition at line 261 of file SHAppBarMessage.cpp.

262  {
263  HANDLE hThread;
264  switch (id)
265  {
266  case ID_ACTION:
268  break;
269  case ID_ACTION + 1:
270  hThread = CreateThread(NULL, 0, ActionThreadFunc, this, 0, NULL);
271  if (!hThread)
272  {
273  skip("failed to create thread\n");
274  PostMessage(s_hwnd1, WM_CLOSE, 0, 0);
275  PostMessage(s_hwnd2, WM_CLOSE, 0, 0);
276  return;
277  }
279  }
280  }
#define ID_ACTION
#define CloseHandle
Definition: compat.h:487
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:136
smooth NULL
Definition: ftsmooth.c:416
#define PostMessage
Definition: winuser.h:5807
#define WM_CLOSE
Definition: winuser.h:1603
#define WM_COMMAND
Definition: winuser.h:1722
static DWORD WINAPI ActionThreadFunc(LPVOID args)
static HWND s_hwnd2
static HWND s_hwnd1
HANDLE hThread
Definition: wizard.c:27
#define skip(...)
Definition: atltest.h:64

Referenced by WindowProcDx().

◆ OnCreate()

BOOL Window::OnCreate ( HWND  hwnd,
LPCREATESTRUCT  lpCreateStruct 
)
inlineprotected

Definition at line 668 of file SHAppBarMessage.cpp.

669  {
670  m_hwnd = hwnd;
671  m_fOnTop = TRUE;
672  m_uSide = ABE_TOP;
673 
675  m_fMoving = FALSE;
678  m_bDragged = FALSE;
679 
682 
683  return TRUE;
684  }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define ABE_TOP
Definition: shellapi.h:18
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
BOOL AppBar_SetSide(HWND hwnd, UINT uSide)
BOOL m_fAppBarRegd
BOOL AppBar_Register(HWND hwnd)

Referenced by WindowProcDx().

◆ OnKey()

void Window::OnKey ( HWND  hwnd,
UINT  vk,
BOOL  fDown,
int  cRepeat,
UINT  flags 
)
inlineprotected

Definition at line 305 of file SHAppBarMessage.cpp.

306  {
307  if (vk == VK_ESCAPE)
309  }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
WORD vk
Definition: input.c:77
#define VK_ESCAPE
Definition: winuser.h:2189
BOOL WINAPI DestroyWindow(_In_ HWND)

Referenced by WindowProcDx().

◆ OnLButtonDown()

void Window::OnLButtonDown ( HWND  hwnd,
BOOL  fDoubleClick,
int  x,
int  y,
UINT  keyFlags 
)
inlineprotected

Definition at line 824 of file SHAppBarMessage.cpp.

825  {
826  m_fMoving = TRUE;
827  m_bDragged = FALSE;
828  SetCapture(hwnd);
830  }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:2635
#define FALSE
Definition: types.h:117
HWND WINAPI SetCapture(_In_ HWND hWnd)
POINT m_ptDragOn

Referenced by WindowProcDx().

◆ OnLButtonUp()

void Window::OnLButtonUp ( HWND  hwnd,
int  x,
int  y,
UINT  keyFlags 
)
inlineprotected

Definition at line 918 of file SHAppBarMessage.cpp.

919  {
920  if (!m_fMoving)
921  return;
922 
923  OnMouseMove(hwnd, x, y, keyFlags);
924 
926 
927  ReleaseCapture();
928 
929  if (m_fAutoHide)
930  {
931  switch (m_uSide)
932  {
933  case ABE_TOP:
934  m_rcDrag.bottom = m_rcDrag.top + 2;
935  break;
936  case ABE_BOTTOM:
937  m_rcDrag.top = m_rcDrag.bottom - 2;
938  break;
939  case ABE_LEFT:
940  m_rcDrag.right = m_rcDrag.left + 2;
941  break;
942  case ABE_RIGHT:
943  m_rcDrag.left = m_rcDrag.right - 2;
944  break;
945  }
946  }
947 
948  if (m_bDragged)
949  {
950  if (m_fAutoHide)
951  {
953  }
954  else
955  {
956  APPBARDATA abd = { sizeof(abd) };
957  abd.hWnd = hwnd;
959  }
960  }
961 
962  m_fMoving = FALSE;
963  }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define ABE_TOP
Definition: shellapi.h:18
LONG top
Definition: windef.h:307
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
HWND hWnd
Definition: shellapi.h:216
LONG left
Definition: windef.h:306
LONG right
Definition: windef.h:308
#define ABE_LEFT
Definition: shellapi.h:17
#define FALSE
Definition: types.h:117
void AppBar_QuerySetPos(UINT uEdge, LPRECT lprc, PAPPBARDATA pabd, BOOL fMove)
#define ABE_RIGHT
Definition: shellapi.h:19
BOOL AppBar_AutoHide(HWND hwnd)
BOOL m_fAutoHide
#define ABE_BOTTOM
Definition: shellapi.h:20
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
BOOL WINAPI ReleaseCapture(void)
Definition: message.c:2889
LONG bottom
Definition: windef.h:309
void OnMouseMove(HWND hwnd, int x, int y, UINT keyFlags)

Referenced by WindowProcDx().

◆ OnMouseMove()

void Window::OnMouseMove ( HWND  hwnd,
int  x,
int  y,
UINT  keyFlags 
)
inlineprotected

Definition at line 832 of file SHAppBarMessage.cpp.

833  {
834  if (!m_fMoving)
835  return;
836 
837  POINT pt;
838  GetCursorPos(&pt);
841  {
842  m_bDragged = TRUE;
843  }
844 
845  INT cxScreen = GetSystemMetrics(SM_CXSCREEN);
846  INT cyScreen = GetSystemMetrics(SM_CYSCREEN);
847 
848  DWORD dx, dy;
849  UINT ix, iy;
850  if (pt.x < cxScreen / 2)
851  {
852  dx = pt.x;
853  ix = ABE_LEFT;
854  }
855  else
856  {
857  dx = cxScreen - pt.x;
858  ix = ABE_RIGHT;
859  }
860 
861  if (pt.y < cyScreen / 2)
862  {
863  dy = pt.y;
864  iy = ABE_TOP;
865  }
866  else
867  {
868  dy = cyScreen - pt.y;
869  iy = ABE_BOTTOM;
870  }
871 
872  if (cxScreen * dy > cyScreen * dx)
873  {
874  m_rcDrag.top = 0;
875  m_rcDrag.bottom = cyScreen;
876  if (ix == ABE_LEFT)
877  {
878  m_uSide = ABE_LEFT;
879  m_rcDrag.left = 0;
881  }
882  else
883  {
884  m_uSide = ABE_RIGHT;
885  m_rcDrag.right = cxScreen;
887  }
888  }
889  else
890  {
891  m_rcDrag.left = 0;
892  m_rcDrag.right = cxScreen;
893  if (iy == ABE_TOP)
894  {
895  m_uSide = ABE_TOP;
896  m_rcDrag.top = 0;
898  }
899  else
900  {
902  m_rcDrag.bottom = cyScreen;
904  }
905  }
906 
908 
909  if (m_bDragged)
910  {
914  TRUE);
915  }
916  }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define ABE_TOP
Definition: shellapi.h:18
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
void AppBar_QueryPos(HWND hwnd, LPRECT lprc)
#define TRUE
Definition: types.h:120
#define pt(x, y)
Definition: drawing.c:79
GLint dy
Definition: linetemp.h:97
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:2635
LONG right
Definition: windef.h:308
int iy
Definition: tritemp.h:491
#define ABE_LEFT
Definition: shellapi.h:17
int32_t INT
Definition: typedefs.h:58
#define SM_CXSCREEN
Definition: winuser.h:949
#define ABE_RIGHT
Definition: shellapi.h:19
#define SM_CXDRAG
Definition: winuser.h:1018
#define SM_CYSCREEN
Definition: winuser.h:950
int WINAPI GetSystemMetrics(_In_ int)
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
#define ABE_BOTTOM
Definition: shellapi.h:20
unsigned int UINT
Definition: ndis.h:50
GLint dx
Definition: linetemp.h:97
LONG bottom
Definition: windef.h:309
#define SM_CYDRAG
Definition: winuser.h:1019
_Check_return_ long __cdecl labs(_In_ long x)
POINT m_ptDragOn

Referenced by OnLButtonUp(), and WindowProcDx().

◆ OnMove()

void Window::OnMove ( HWND  hwnd,
int  x,
int  y 
)
inlineprotected

Definition at line 743 of file SHAppBarMessage.cpp.

744  {
745  if (m_fMoving || m_fAutoHide)
746  return;
747 
748  if (!m_fHiding)
749  AppBar_Size(hwnd);
750  }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
BOOL m_fAutoHide
void AppBar_Size(HWND hwnd)

Referenced by WindowProcDx().

◆ OnNCDestroy()

void Window::OnNCDestroy ( HWND  hwnd)
inlineprotected

Definition at line 752 of file SHAppBarMessage.cpp.

753  {
755 
756  m_hwnd = NULL;
758  delete this;
759  }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define SetWindowLongPtr
Definition: treelist.c:70
#define GWLP_USERDATA
Definition: treelist.c:63
smooth NULL
Definition: ftsmooth.c:416
BOOL AppBar_UnRegister(HWND hwnd)

Referenced by WindowProcDx().

◆ OnNCHitTest()

UINT Window::OnNCHitTest ( HWND  hwnd,
int  x,
int  y 
)
inlineprotected

Definition at line 803 of file SHAppBarMessage.cpp.

804  {
806 
808 
809  if (m_uSide == ABE_TOP && uHitTest == HTBOTTOM)
810  return HTBOTTOM;
811 
812  if (m_uSide == ABE_BOTTOM && uHitTest == HTTOP)
813  return HTTOP;
814 
815  if (m_uSide == ABE_LEFT && uHitTest == HTRIGHT)
816  return HTRIGHT;
817 
818  if (m_uSide == ABE_RIGHT && uHitTest == HTLEFT)
819  return HTLEFT;
820 
821  return HTCLIENT;
822  }
#define HTTOP
Definition: winuser.h:2465
#define HTLEFT
Definition: winuser.h:2462
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define ABE_TOP
Definition: shellapi.h:18
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define HTRIGHT
Definition: winuser.h:2464
#define ABE_LEFT
Definition: shellapi.h:17
#define FORWARD_WM_NCHITTEST(hwnd, x, y, fn)
Definition: windowsx.h:166
void AppBar_SetAutoUnhideTimer(HWND hwnd)
#define ABE_RIGHT
Definition: shellapi.h:19
#define DefWindowProc
Definition: ros2win.h:31
#define HTBOTTOM
Definition: winuser.h:2468
#define ABE_BOTTOM
Definition: shellapi.h:20
unsigned int UINT
Definition: ndis.h:50
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#define HTCLIENT
Definition: winuser.h:2450

Referenced by WindowProcDx().

◆ OnPaint()

void Window::OnPaint ( HWND  hwnd)
inlineprotected

Definition at line 282 of file SHAppBarMessage.cpp.

283  {
284  PAINTSTRUCT ps;
285 
286  TCHAR szText[64];
287  GetWindowText(hwnd, szText, 64);
288 
289  RECT rc;
290  GetClientRect(hwnd, &rc);
291 
292  if (HDC hdc = BeginPaint(hwnd, &ps))
293  {
295  EndPaint(hwnd, &ps);
296  }
297  }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static HDC
Definition: imagelist.c:92
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
#define DrawText
Definition: winuser.h:5746
#define GetWindowText
Definition: winuser.h:5773
static const WCHAR szText[]
Definition: dialog.c:139
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
#define DT_VCENTER
Definition: winuser.h:543
char TCHAR
Definition: xmlstorage.h:189
HDC hdc
Definition: main.c:9
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define DT_SINGLELINE
Definition: winuser.h:540
#define DT_CENTER
Definition: winuser.h:527

Referenced by WindowProcDx().

◆ OnRButtonDown()

void Window::OnRButtonDown ( HWND  hwnd,
BOOL  fDoubleClick,
int  x,
int  y,
UINT  keyFlags 
)
inlineprotected

Definition at line 299 of file SHAppBarMessage.cpp.

300  {
303  }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
BOOL m_fAutoHide
BOOL AppBar_SetAutoHide(HWND hwnd, BOOL fHide)

Referenced by WindowProcDx().

◆ OnSize()

void Window::OnSize ( HWND  hwnd,
UINT  state,
int  cx,
int  cy 
)
inlineprotected

Definition at line 715 of file SHAppBarMessage.cpp.

716  {
717  RECT rcWindow;
718 
719  if (m_fMoving || (m_fAutoHide && m_fHiding))
720  return;
721 
722  if (!m_fHiding)
723  {
724  if (!m_fAutoHide)
725  AppBar_Size(hwnd);
726 
727  GetWindowRect(hwnd, &rcWindow);
728  m_rcAppBar = rcWindow;
729 
730  if (m_uSide == ABE_TOP || m_uSide == ABE_BOTTOM)
731  {
732  m_cyHeight = m_cySave = rcWindow.bottom - rcWindow.top;
733  }
734  else
735  {
736  m_cxWidth = m_cxSave = rcWindow.right - rcWindow.left;
737  }
738  }
739 
741  }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define ABE_TOP
Definition: shellapi.h:18
#define TRUE
Definition: types.h:120
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
LONG right
Definition: windef.h:308
smooth NULL
Definition: ftsmooth.c:416
BOOL m_fAutoHide
void AppBar_Size(HWND hwnd)
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
#define ABE_BOTTOM
Definition: shellapi.h:20
LONG bottom
Definition: windef.h:309
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)

Referenced by WindowProcDx().

◆ OnTimer()

void Window::OnTimer ( HWND  hwnd,
UINT  id 
)
inlineprotected

Definition at line 761 of file SHAppBarMessage.cpp.

762  {
763  POINT pt;
764  RECT rc;
765  HWND hwndActive;
766 
767  switch (id)
768  {
769  case IDT_AUTOHIDE:
770  if (m_fAutoHide && !m_fHiding && !m_fMoving)
771  {
772  GetCursorPos(&pt);
773  GetWindowRect(hwnd, &rc);
774  hwndActive = GetForegroundWindow();
775 
776  if (!PtInRect(&rc, pt) &&
777  hwndActive != hwnd &&
778  hwndActive != NULL &&
779  GetWindowOwner(hwndActive) != hwnd)
780  {
781  KillTimer(hwnd, id);
782  AppBar_Hide(hwnd);
783  }
784  }
785  break;
786 
787  case IDT_AUTOUNHIDE:
788  KillTimer(hwnd, id);
789 
790  if (m_fAutoHide && m_fHiding)
791  {
792  GetCursorPos(&pt);
793  GetWindowRect(hwnd, &rc);
794  if (PtInRect(&rc, pt))
795  {
797  }
798  }
799  break;
800  }
801  }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define pt(x, y)
Definition: drawing.c:79
void AppBar_Hide(HWND hwnd)
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:2635
smooth NULL
Definition: ftsmooth.c:416
BOOL m_fAutoHide
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define IDT_AUTOUNHIDE
#define IDT_AUTOHIDE
HWND WINAPI GetForegroundWindow(void)
Definition: ntwrapper.h:392
BOOL WINAPI PtInRect(_In_ LPCRECT, _In_ POINT)
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
void AppBar_UnHide(HWND hwnd)
#define GetWindowOwner(hwnd)
Definition: windowsx.h:289

Referenced by WindowProcDx().

◆ OnWindowPosChanged()

void Window::OnWindowPosChanged ( HWND  hwnd,
const LPWINDOWPOS  lpwpos 
)
inlineprotected

Definition at line 706 of file SHAppBarMessage.cpp.

707  {
708  APPBARDATA abd = { sizeof(abd) };
709  abd.hWnd = hwnd;
711 
713  }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
HWND hWnd
Definition: shellapi.h:216
UINT_PTR WINAPI SHAppBarMessage(DWORD msg, PAPPBARDATA data)
Definition: appbar.c:64
#define DefWindowProc
Definition: ros2win.h:31
#define FORWARD_WM_WINDOWPOSCHANGED(hwnd, lpwpos, fn)
Definition: windowsx.h:215
#define ABM_WINDOWPOSCHANGED
Definition: shellapi.h:68

Referenced by WindowProcDx().

◆ PostParent()

LRESULT Window::PostParent ( UINT  nmsg,
WPARAM  wparam = 0,
LPARAM  lparam = 0 
)

Definition at line 667 of file window.cpp.

668 {
669  HWND parent = GetParent(_hwnd);
670 
671  if (!parent)
672  return 0;
673 
674  return PostMessage(parent, nmsg, wparam, lparam);
675 }
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
#define PostMessage
Definition: winuser.h:5807
r parent
Definition: btrfs.c:2944
HWND WINAPI GetParent(_In_ HWND)
static UINT WPARAM wparam
Definition: combo.c:716

Referenced by StartMenuButton::WndProc().

◆ pretranslate_msg()

BOOL Window::pretranslate_msg ( LPMSG  pmsg)
static

Definition at line 589 of file window.cpp.

590 {
591  if ((pmsg->message != WM_KEYDOWN) &&
592  (pmsg->message != WM_SYSKEYDOWN) &&
593  (pmsg->message != WM_SYSCHAR) &&
594  (pmsg->message != WM_CHAR))
595  {
596  return FALSE;
597  }
598 
600  if (SendMessage(*it, PM_TRANSLATE_MSG, 0, (LPARAM)pmsg))
601  return TRUE;
602 
603  return FALSE;
604 }
#define WM_CHAR
Definition: winuser.h:1699
#define TRUE
Definition: types.h:120
#define PM_TRANSLATE_MSG
Definition: window.h:266
#define FALSE
Definition: types.h:117
#define WM_SYSCHAR
Definition: winuser.h:1703
static WindowSet s_pretranslate_windows
Definition: window.h:137
#define WM_KEYDOWN
Definition: winuser.h:1697
LONG_PTR LPARAM
Definition: windef.h:208
static clock_t begin
Definition: xmllint.c:466
#define SendMessage
Definition: winuser.h:5818
#define WM_SYSKEYDOWN
Definition: winuser.h:1701
iterator end()
Definition: _set.h:152
_Rep_type::const_iterator const_iterator
Definition: _set.h:74
UINT message
Definition: winuser.h:3090

Referenced by PropertySheetDialog::DoModal(), MessageLoop(), and StartMenuRoot::TrackStartmenu().

◆ PropSheetCBTHookProc()

LRESULT CALLBACK Window::PropSheetCBTHookProc ( int  code,
WPARAM  wparam,
LPARAM  lparam 
)
staticprotected

Definition at line 185 of file window.cpp.

186 {
187  if (code == HCBT_CREATEWND) {
188  HWND hwnd = (HWND)wparam;
189 
190  // create Window controller and associate it with the window handle
192 
193  if (!child)
195  }
196 
198 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define HCBT_CREATEWND
Definition: winuser.h:58
HANDLE HWND
Definition: compat.h:19
static Window * create_controller(HWND hwnd)
create controller for a new window
Definition: window.cpp:220
static HWND child
Definition: cursoricon.c:298
Definition: window.c:28
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
static HHOOK s_hcbtHook
Definition: window.h:133
Definition: inflate.c:139
LRESULT WINAPI CallNextHookEx(_In_opt_ HHOOK, _In_ int, _In_ WPARAM, _In_ LPARAM)
static Window * get_window(HWND hwnd)
get window controller from window handle
Definition: window.cpp:203
static UINT WPARAM wparam
Definition: combo.c:716

◆ register_dialog()

void Window::register_dialog ( HWND  hwnd)
static

Definition at line 609 of file window.cpp.

610 {
612 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static WindowSet s_dialogs
Definition: window.h:138
pair< iterator, bool > insert(const value_type &__x)
Definition: _set.h:168

Referenced by Dialog::Dialog(), and DialogWindow::DialogWindow().

◆ register_pretranslate()

void Window::register_pretranslate ( HWND  hwnd)
static

Definition at line 579 of file window.cpp.

580 {
582 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static WindowSet s_pretranslate_windows
Definition: window.h:137
pair< iterator, bool > insert(const value_type &__x)
Definition: _set.h:168

Referenced by FindProgramDlg::FindProgramDlg(), PreTranslateWindow::PreTranslateWindow(), and TrayNotifyDlg::TrayNotifyDlg().

◆ SendParent()

LRESULT Window::SendParent ( UINT  nmsg,
WPARAM  wparam = 0,
LPARAM  lparam = 0 
)

Definition at line 657 of file window.cpp.

658 {
659  HWND parent = GetParent(_hwnd);
660 
661  if (!parent)
662  return 0;
663 
664  return SendMessage(parent, nmsg, wparam, lparam);
665 }
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
r parent
Definition: btrfs.c:2944
HWND WINAPI GetParent(_In_ HWND)
#define SendMessage
Definition: winuser.h:5818
static UINT WPARAM wparam
Definition: combo.c:716

Referenced by StartMenu::CloseStartMenu(), NotifyArea::Command(), StartMenuButton::WndProc(), StartMenu::WndProc(), EditController::WndProc(), and StartMenu::~StartMenu().

◆ unregister_dialog()

void Window::unregister_dialog ( HWND  hwnd)
static

Definition at line 614 of file window.cpp.

615 {
617 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static WindowSet s_dialogs
Definition: window.h:138
void erase(iterator __pos)
Definition: _set.h:182

Referenced by Dialog::~Dialog(), and DialogWindow::~DialogWindow().

◆ unregister_pretranslate()

void Window::unregister_pretranslate ( HWND  hwnd)
static

Definition at line 584 of file window.cpp.

585 {
587 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
void erase(iterator __pos)
Definition: _set.h:182
static WindowSet s_pretranslate_windows
Definition: window.h:137

Referenced by FindProgramDlg::~FindProgramDlg(), PreTranslateWindow::~PreTranslateWindow(), and TrayNotifyDlg::~TrayNotifyDlg().

◆ WindowProc()

static LRESULT CALLBACK Window::WindowProc ( HWND  hwnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
inlinestatic

Definition at line 230 of file SHAppBarMessage.cpp.

231  {
232  Window *this_ = GetAppbarData(hwnd);
233  if (uMsg == WM_CREATE)
234  {
236  this_ = (Window *)pCS->lpCreateParams;
238  }
239  if (this_)
240  return this_->WindowProcDx(hwnd, uMsg, wParam, lParam);
241  return DefWindowProc(hwnd, uMsg, wParam, lParam);
242  }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
virtual LRESULT CALLBACK WindowProcDx(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
CREATESTRUCTA * LPCREATESTRUCT
Definition: winuser.h:5701
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
Definition: window.c:28
#define GWLP_USERDATA
Definition: treelist.c:63
#define DefWindowProc
Definition: ros2win.h:31
static Window * GetAppbarData(HWND hwnd)
LPVOID lpCreateParams
Definition: winuser.h:2915
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define WM_CREATE
Definition: winuser.h:1590
LPARAM lParam
Definition: combotst.c:139

Referenced by DoRegisterClass().

◆ WindowProcDx()

virtual LRESULT CALLBACK Window::WindowProcDx ( HWND  hwnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
inlinevirtual

Definition at line 196 of file SHAppBarMessage.cpp.

197  {
198 #ifdef VERBOSE
199  MD_msgdump(hwnd, uMsg, wParam, lParam);
200 #endif
201  switch (uMsg)
202  {
218 
219  case APPBAR_CALLBACK:
221  break;
222 
223  default:
224  return DefWindowProc(hwnd, uMsg, wParam, lParam);
225  }
226  return 0;
227  }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
void OnWindowPosChanged(HWND hwnd, const LPWINDOWPOS lpwpos)
void OnSize(HWND hwnd, UINT state, int cx, int cy)
#define WM_LBUTTONDOWN
Definition: winuser.h:1758
void OnAppBarCallback(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
#define WM_MOVE
Definition: winuser.h:1592
void OnTimer(HWND hwnd, UINT id)
#define WM_NCHITTEST
Definition: winuser.h:1668
void OnLButtonUp(HWND hwnd, int x, int y, UINT keyFlags)
WPARAM wParam
Definition: combotst.c:138
BOOL OnCreate(HWND hwnd, LPCREATESTRUCT lpCreateStruct)
void OnRButtonDown(HWND hwnd, BOOL fDoubleClick, int x, int y, UINT keyFlags)
void OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify)
#define WM_KEYDOWN
Definition: winuser.h:1697
#define DefWindowProc
Definition: ros2win.h:31
#define WM_RBUTTONDOWN
Definition: winuser.h:1761
#define WM_SIZE
Definition: winuser.h:1593
void OnNCDestroy(HWND hwnd)
#define WM_TIMER
Definition: winuser.h:1724
#define WM_NCDESTROY
Definition: winuser.h:1666
#define APPBAR_CALLBACK
void OnActivate(HWND hwnd, UINT state, HWND hwndActDeact, BOOL fMinimized)
#define WM_PAINT
Definition: winuser.h:1602
#define WM_COMMAND
Definition: winuser.h:1722
void OnMove(HWND hwnd, int x, int y)
#define WM_ACTIVATE
Definition: winuser.h:1594
#define WM_LBUTTONUP
Definition: winuser.h:1759
void OnLButtonDown(HWND hwnd, BOOL fDoubleClick, int x, int y, UINT keyFlags)
#define WM_MOUSEMOVE
Definition: winuser.h:1757
void OnPaint(HWND hwnd)
#define WM_WINDOWPOSCHANGED
Definition: winuser.h:1644
#define WM_CREATE
Definition: winuser.h:1590
void OnKey(HWND hwnd, UINT vk, BOOL fDown, int cRepeat, UINT flags)
#define HANDLE_MSG(hwnd, message, fn)
Definition: windowsx.h:297
LPARAM lParam
Definition: combotst.c:139
static __inline LRESULT MSGDUMP_API MD_msgdump(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: msgdump.h:4655
void OnMouseMove(HWND hwnd, int x, int y, UINT keyFlags)
UINT OnNCHitTest(HWND hwnd, int x, int y)

Referenced by WindowProc().

◆ WindowWndProc()

LRESULT CALLBACK Window::WindowWndProc ( HWND  hwnd,
UINT  nmsg,
WPARAM  wparam,
LPARAM  lparam 
)
static

Definition at line 247 of file window.cpp.

248 {
249  Window* pThis = get_window(hwnd);
250 
251  if (!pThis)
252  pThis = create_controller(hwnd);
253 
254  if (pThis) {
255  switch(nmsg) {
256  case WM_COMMAND:
257  return pThis->Command(LOWORD(wparam), HIWORD(wparam));
258 
259  case WM_NOTIFY:
260  return pThis->Notify(wparam, (NMHDR*)lparam);
261 
262  case WM_NOTIFYFORMAT:
263  return NFR_CURRENT;
264 
265  case WM_CREATE:
266  return pThis->Init((LPCREATESTRUCT)lparam);
267 
268  case WM_NCDESTROY:
269  delete pThis;
270  return 0;
271 
272  default:
273  return pThis->WndProc(nmsg, wparam, lparam);
274  }
275  }
276  else
277  return DefWindowProc(hwnd, nmsg, wparam, lparam);
278 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
virtual LRESULT Init(LPCREATESTRUCT pcs)
Definition: window.cpp:241
static Window * create_controller(HWND hwnd)
create controller for a new window
Definition: window.cpp:220
Definition: window.c:28
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
virtual int Notify(int id, NMHDR *pnmh)
Definition: window.cpp:290
#define NFR_CURRENT
Definition: window.h:144
#define DefWindowProc
Definition: ros2win.h:31
#define WM_NCDESTROY
Definition: winuser.h:1666
virtual LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
Definition: window.cpp:280
#define WM_COMMAND
Definition: winuser.h:1722
#define WM_CREATE
Definition: winuser.h:1590
#define HIWORD(l)
Definition: typedefs.h:247
virtual int Command(int id, int code)
Definition: window.cpp:285
#define LOWORD(l)
Definition: pedump.c:82
static Window * get_window(HWND hwnd)
get window controller from window handle
Definition: window.cpp:203
#define WM_NOTIFY
Definition: richedit.h:61
static UINT WPARAM wparam
Definition: combo.c:716

◆ WndProc()

LRESULT Window::WndProc ( UINT  nmsg,
WPARAM  wparam,
LPARAM  lparam 
)
protectedvirtual

Reimplemented in ExtContextMenuHandlerT< ShellBrowserChildT< MainFrameBase > >, ExtContextMenuHandlerT< ChildWindow >, ExtContextMenuHandlerT< OwnerDrawParent< DialogWindow > >, ExtContextMenuHandlerT< SubclassedWindow >, ExtContextMenuHandlerT< ShellBrowserChildT< ChildWindow > >, EditController, WebChildWindow, ExplorerAboutDlg, HyperlinkCtrl, ColorStatic, FlatButton, OwnerdrawnButton, OwnerDrawParent< PropSheetPageDlg >, OwnerDrawParent< Window >, OwnerDrawParent< DialogWindow >, OwnerDrawParent< Dialog >, CtlColorParent< OwnerDrawParent< Dialog > >, ResizeController< Dialog >, Dialog, StartMenuRoot, IPCtrlWindow< ChildWindow, SIfacePtr< IWebBrowser2 > >, ChildWindow, MDIShellBrowserChild, ClockWindow, TrayNotifyDlg, StartMenu, ShellBrowserChildT< ChildWindow >, ShellBrowserChildT< MainFrameBase >, SubclassedWindow, DesktopShellView, SDIMainFrame, NotifyArea, StartButton, MDIMainFrame, Pane, DesktopBar, StartMenuButton, FindProgramDlg, FileChildWindow, TaskBar, DesktopWindow, MainFrameBase, QuickLaunchBar, and BackgroundWindow.

Definition at line 280 of file window.cpp.

281 {
282  return DefWindowProc(_hwnd, nmsg, wparam, lparam);
283 }
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
#define DefWindowProc
Definition: ros2win.h:31
static UINT WPARAM wparam
Definition: combo.c:716

Referenced by DialogProc(), WindowWndProc(), MainFrameBase::WndProc(), DesktopWindow::WndProc(), TaskBar::WndProc(), NotifyArea::WndProc(), and ClockWindow::WndProc().

Member Data Documentation

◆ IAccessible_iface

IAccessible Window::IAccessible_iface

Definition at line 29 of file window.c.

◆ IEnumVARIANT_iface

IEnumVARIANT Window::IEnumVARIANT_iface

Definition at line 31 of file window.c.

◆ IOleWindow_iface

IOleWindow Window::IOleWindow_iface

Definition at line 30 of file window.c.

◆ m_bDragged

BOOL Window::m_bDragged
protected

Definition at line 256 of file SHAppBarMessage.cpp.

Referenced by OnCreate(), OnLButtonDown(), OnLButtonUp(), and OnMouseMove().

◆ m_cxSave

LONG Window::m_cxSave
protected

◆ m_cxWidth

LONG Window::m_cxWidth
protected

◆ m_cyHeight

LONG Window::m_cyHeight
protected

◆ m_cySave

LONG Window::m_cySave
protected

◆ m_fAppBarRegd

BOOL Window::m_fAppBarRegd
protected

Definition at line 254 of file SHAppBarMessage.cpp.

Referenced by AppBar_Register(), AppBar_Size(), AppBar_UnRegister(), and OnCreate().

◆ m_fAutoHide

◆ m_fHiding

BOOL Window::m_fHiding
protected

◆ m_fMoving

BOOL Window::m_fMoving
protected

◆ m_fOnTop

BOOL Window::m_fOnTop
protected

Definition at line 247 of file SHAppBarMessage.cpp.

Referenced by AppBar_SetAlwaysOnTop(), OnAppBarCallback(), and OnCreate().

◆ m_hwnd

HWND Window::m_hwnd
protected

Definition at line 245 of file SHAppBarMessage.cpp.

Referenced by OnCreate(), and OnNCDestroy().

◆ m_ptDragOn

POINT Window::m_ptDragOn
protected

Definition at line 257 of file SHAppBarMessage.cpp.

Referenced by OnLButtonDown(), and OnMouseMove().

◆ m_rcAppBar

RECT Window::m_rcAppBar
protected

◆ m_rcDrag

RECT Window::m_rcDrag
protected

Definition at line 259 of file SHAppBarMessage.cpp.

Referenced by OnLButtonUp(), and OnMouseMove().

◆ m_uSide

◆ ref

LONG Window::ref

Definition at line 33 of file window.c.

◆ s_dialogs

WindowSet Window::s_dialogs
staticprotected

Definition at line 138 of file window.h.

Referenced by dispatch_dialog_msg(), register_dialog(), and unregister_dialog().

◆ s_hcbtHook

HHOOK Window::s_hcbtHook = 0
staticprotected

Definition at line 133 of file window.h.

Referenced by create_mdi_child(), MDICBTHookProc(), and PropSheetCBTHookProc().

◆ s_new_info

const void * Window::s_new_info = NULL
staticprotected

Definition at line 119 of file window.h.

Referenced by Create(), create_controller(), create_mdi_child(), and Dialog::DoModal().

◆ s_pretranslate_windows

WindowSet Window::s_pretranslate_windows
staticprotected

Definition at line 137 of file window.h.

Referenced by pretranslate_msg(), register_pretranslate(), and unregister_pretranslate().

◆ s_window_creator

Window::CREATORFUNC Window::s_window_creator = NULL
staticprotected

Definition at line 120 of file window.h.

Referenced by Create(), create_controller(), create_mdi_child(), and Dialog::DoModal().

◆ s_wnd_map

Window::WindowMap Window::s_wnd_map
staticprotected

Definition at line 117 of file window.h.

Referenced by get_window(), Window(), and ~Window().


The documentation for this class was generated from the following files: