Click here to Skip to main content
15,881,281 members
Articles / Desktop Programming / WTL

WTL Docking Windows

Rate me:
Please Sign up or sign in to vote.
4.89/5 (73 votes)
21 Nov 20077 min read 825.5K   14.1K   215  
This is an implementation of docking windows for the WTL library
// OutputDockingWindow.h: interface for the COutputDockingWindow class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_OUTPUTDOCKINGWINDOW_H__0D6B82E7_6A06_4FCC_B621_B21ED1C742E9__INCLUDED_)
#define AFX_OUTPUTDOCKINGWINDOW_H__0D6B82E7_6A06_4FCC_B621_B21ED1C742E9__INCLUDED_

#include <ExtDockingWindow.h>

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

class COutputDockingWindow : 
	public dockwins::CTitleDockingWindowImpl< COutputDockingWindow,CWindow,dockwins::CVC6LikeTitleDockingWindowTraits>
{
	typedef COutputDockingWindow thisClass;
	typedef dockwins::CTitleDockingWindowImpl< COutputDockingWindow,CWindow,dockwins::CVC6LikeTitleDockingWindowTraits> baseClass;
public:
    DECLARE_WND_CLASS(_T("COutputDockingWindow"))
	BEGIN_MSG_MAP(thisClass)	
		MESSAGE_HANDLER(WM_CREATE, OnCreate)
		MESSAGE_HANDLER(WM_SIZE, OnSize)
		CHAIN_MSG_MAP(baseClass)		
	END_MSG_MAP()
	LRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
	{
		m_edit.Create(m_hWnd,NULL, NULL, WS_CHILD | WS_VISIBLE );
		m_edit.AppendText(_T("some text here..."));		
		return 0;
	}	
	LRESULT OnSize(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)
	{
		if(wParam != SIZE_MINIMIZED )
		{
			RECT rc;
			GetClientRect(&rc);
			m_edit.SetWindowPos(NULL, &rc ,SWP_NOZORDER | SWP_NOACTIVATE );
		}		
		bHandled = FALSE;
		return 1;
	}

protected:
	CRichEditCtrl m_edit;
};

#endif // !defined(AFX_OUTPUTDOCKINGWINDOW_H__0D6B82E7_6A06_4FCC_B621_B21ED1C742E9__INCLUDED_)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Software Developer
Ireland Ireland
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions