Public Types | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes

SubclassedWindow Struct Reference

SubclassedWindow is used to wrap already existing window handles into C++ Window objects. More...

#include <window.h>

Inheritance diagram for SubclassedWindow:
Inheritance graph
[legend]
Collaboration diagram for SubclassedWindow:
Collaboration graph
[legend]

List of all members.

Public Types

typedef Window super

Public Member Functions

 SubclassedWindow (HWND)

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)

Static Protected Member Functions

static LRESULT CALLBACK SubclassedWndProc (HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)

Protected Attributes

WNDPROC _orgWndProc

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


Constructor & Destructor Documentation

SubclassedWindow::SubclassedWindow ( HWND  hwnd )

Definition at line 304 of file window.cpp.

References WindowHandle::_hwnd, _orgWndProc, and SubclassedWndProc().

 :  super(hwnd)
{
    _orgWndProc = SubclassWindow(_hwnd, SubclassedWndProc);

    if (!_orgWndProc)
        delete this;
}

Here is the call graph for this function:


Member Function Documentation

int SubclassedWindow::Command ( int  id,
int  code 
) [protected, virtual]

Reimplemented from Window.

Reimplemented in DesktopShellView, and QuickLaunchBar.

Definition at line 351 of file window.cpp.

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

{
    return 1;   // no command handler found
}

Here is the caller graph for this function:

int SubclassedWindow::Notify ( int  id,
NMHDR *  pnmh 
) [protected, virtual]

Reimplemented from Window.

Reimplemented in DesktopShellView, Pane, and QuickLaunchBar.

Definition at line 356 of file window.cpp.

References WindowHandle::_hwnd, and _orgWndProc.

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

{
    return CallWindowProc(_orgWndProc, _hwnd, WM_NOTIFY, id, (LPARAM)pnmh);
}

Here is the caller graph for this function:

LRESULT CALLBACK SubclassedWindow::SubclassedWndProc ( HWND  hwnd,
UINT  nmsg,
WPARAM  wparam,
LPARAM  lparam 
) [static, protected]

Definition at line 313 of file window.cpp.

References _orgWndProc, Command(), GET_WINDOW, Window::Init(), NFR_CURRENT, Notify(), and WndProc().

Referenced by SubclassedWindow().

{
    SubclassedWindow* pThis = GET_WINDOW(SubclassedWindow, hwnd);
    assert(pThis);

    if (pThis) {
        switch(nmsg) {
          case WM_COMMAND:
            if (!pThis->Command(LOWORD(wparam), HIWORD(wparam)))
                return 0;
            break;

          case WM_NOTIFY:
            return pThis->Notify(wparam, (NMHDR*)lparam);

          case WM_NOTIFYFORMAT:
            return NFR_CURRENT;

          case WM_CREATE:
            return pThis->Init((LPCREATESTRUCT)lparam);

          case WM_NCDESTROY:
            delete pThis;
            return 0;

          default:
            return pThis->WndProc(nmsg, wparam, lparam);
        }
    }

    return CallWindowProc(pThis->_orgWndProc, hwnd, nmsg, wparam, lparam);
}

Here is the call graph for this function:

Here is the caller graph for this function:

LRESULT SubclassedWindow::WndProc ( UINT  nmsg,
WPARAM  wparam,
LPARAM  lparam 
) [protected, virtual]

Member Data Documentation

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:

ROS Explorer Source Code Documentation
generated on 02.01.2013 by doxygen

ROS Explorer Homepage