ReactOS  0.4.13-dev-257-gfabbd7c
SubclassedWindow Struct Reference

#include <window.h>

Inheritance diagram for SubclassedWindow:
Collaboration diagram for SubclassedWindow:

Public Types

typedef Window super
 
- Public Types inherited from Window
typedef map< HWND, Window * > WindowMap
 
typedef Window *(* CREATORFUNC) (HWND)
 
typedef Window *(* CREATORFUNC_INFO) (HWND, const void *)
 

Public Member Functions

 SubclassedWindow (HWND)
 
- Public Member Functions inherited from Window
 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)
 

Protected Member Functions

virtual LRESULT WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
 
virtual int Command (int id, int code)
 
virtual int Notify (int id, NMHDR *pnmh)
 
- Protected Member Functions inherited from Window
virtual LRESULT Init (LPCREATESTRUCT pcs)
 

Static Protected Member Functions

static LRESULT CALLBACK SubclassedWndProc (HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
 
- Static Protected Member Functions inherited from Window
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

WNDPROC _orgWndProc
 

Additional Inherited Members

- Static Public Member Functions inherited from Window
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 ()
 
- Public Attributes inherited from Window
IAccessible IAccessible_iface
 
IOleWindow IOleWindow_iface
 
IEnumVARIANT IEnumVARIANT_iface
 
LONG ref
 
- Static Protected Attributes inherited from Window
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

SubclassedWindow is used to wrap already existing window handles into C++ Window objects. To construct a object, use the "new" operator to put it in the heap. It is automatically freed, when the window gets destroyed.

Definition at line 176 of file window.h.

Member Typedef Documentation

◆ super

Definition at line 178 of file window.h.

Constructor & Destructor Documentation

◆ SubclassedWindow()

SubclassedWindow::SubclassedWindow ( HWND  hwnd)

Definition at line 301 of file window.cpp.

302  : super(hwnd)
303 {
305 
306  if (!_orgWndProc)
307  delete this;
308 }
WNDPROC _orgWndProc
Definition: window.h:183
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static LRESULT CALLBACK SubclassedWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
Definition: window.cpp:310
#define SubclassWindow(hwnd, lpfn)
Definition: windowsx.h:512
Window super
Definition: window.h:178

Member Function Documentation

◆ Command()

int SubclassedWindow::Command ( int  id,
int  code 
)
protectedvirtual

Reimplemented from Window.

Reimplemented in DesktopShellView, and QuickLaunchBar.

Definition at line 348 of file window.cpp.

349 {
350  return 1; // no command handler found
351 }

Referenced by DesktopShellView::Command(), and SubclassedWndProc().

◆ Notify()

int SubclassedWindow::Notify ( int  id,
NMHDR pnmh 
)
protectedvirtual

Reimplemented from Window.

Reimplemented in DesktopShellView, Pane, and QuickLaunchBar.

Definition at line 353 of file window.cpp.

354 {
355  return CallWindowProc(_orgWndProc, _hwnd, WM_NOTIFY, id, (LPARAM)pnmh);
356 }
#define CallWindowProc
Definition: winuser.h:5601
WNDPROC _orgWndProc
Definition: window.h:183
LONG_PTR LPARAM
Definition: windef.h:208
#define WM_NOTIFY
Definition: richedit.h:61

Referenced by QuickLaunchBar::Notify(), Pane::Notify(), DesktopShellView::Notify(), and SubclassedWndProc().

◆ SubclassedWndProc()

LRESULT CALLBACK SubclassedWindow::SubclassedWndProc ( HWND  hwnd,
UINT  nmsg,
WPARAM  wparam,
LPARAM  lparam 
)
staticprotected

Definition at line 310 of file window.cpp.

311 {
313  assert(pThis);
314 
315  if (pThis) {
316  switch(nmsg) {
317  case WM_COMMAND:
318  if (!pThis->Command(LOWORD(wparam), HIWORD(wparam)))
319  return 0;
320  break;
321 
322  case WM_NOTIFY:
323  return pThis->Notify(wparam, (NMHDR*)lparam);
324 
325  case WM_NOTIFYFORMAT:
326  return NFR_CURRENT;
327 
328  case WM_CREATE:
329  return pThis->Init((LPCREATESTRUCT)lparam);
330 
331  case WM_NCDESTROY:
332  delete pThis;
333  return 0;
334 
335  default:
336  return pThis->WndProc(nmsg, wparam, lparam);
337  }
338  }
339 
340  return CallWindowProc(pThis->_orgWndProc, hwnd, nmsg, wparam, lparam);
341 }
#define CallWindowProc
Definition: winuser.h:5601
WNDPROC _orgWndProc
Definition: window.h:183
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
virtual LRESULT Init(LPCREATESTRUCT pcs)
Definition: window.cpp:241
#define assert(x)
Definition: debug.h:53
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
#define NFR_CURRENT
Definition: window.h:144
#define WM_NCDESTROY
Definition: winuser.h:1666
virtual int Command(int id, int code)
Definition: window.cpp:348
#define WM_COMMAND
Definition: winuser.h:1716
#define GET_WINDOW(CLASS, hwnd)
Definition: window.h:88
virtual LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
Definition: window.cpp:343
#define WM_CREATE
Definition: winuser.h:1590
#define HIWORD(l)
Definition: typedefs.h:246
virtual int Notify(int id, NMHDR *pnmh)
Definition: window.cpp:353
#define LOWORD(l)
Definition: pedump.c:82
#define WM_NOTIFY
Definition: richedit.h:61
static UINT WPARAM wparam
Definition: combo.c:716

Referenced by SubclassedWindow().

◆ WndProc()

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

Member Data Documentation

◆ _orgWndProc

WNDPROC SubclassedWindow::_orgWndProc
protected

Definition at line 183 of file window.h.

Referenced by Notify(), SubclassedWindow(), SubclassedWndProc(), and WndProc().


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