Click here to Skip to main content
15,892,797 members
Articles / Mobile Apps

Window Tabs (WndTabs) Add-In for DevStudio

Rate me:
Please Sign up or sign in to vote.
5.00/5 (37 votes)
11 Jul 2002 365.8K   7.3K   94  
Window and File Management add-in for Visual C++
/***************************************************************************/
/* NOTE:                                                                   */
/* This document is copyright (c) by Oz Solomonovich.  All non-commercial  */
/* use is allowed, as long as this document not altered in any way, and    */
/* due credit is given.                                                    */
/***************************************************************************/

// DevStudioWnd.cpp : implementation file
//
// This class is used to capture messages sent to DevStudio's main window.
// Currently, the WM_GETTEXT message is captured.  Each time WM_GETTEXT is
// used, WndTabs checks if the title of the DevStudio window was changed.  A
// change in the title indicates that the tabs need to be updated.


#include "stdafx.h"
#include "wndtabs.h"
#include "DevStudioWnd.h"
#include "TabsWindow.h"
#include "TabManagerWindow.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CDevStudioWnd

CDevStudioWnd::CDevStudioWnd(HWND hWndDevStudio) : 
    CSubclassWnd(hWndDevStudio)
{
    DoSubclass();
}

CDevStudioWnd::~CDevStudioWnd()
{
}


BEGIN_MESSAGE_MAP(CDevStudioWnd, CSubclassWnd)
	//{{AFX_MSG_MAP(CDevStudioWnd)
	//}}AFX_MSG_MAP
    ON_MESSAGE(WM_GETTEXT, OnGetWindowText)
END_MESSAGE_MAP()


/////////////////////////////////////////////////////////////////////////////
// CDevStudioWnd message handlers

LRESULT CDevStudioWnd::OnGetWindowText(WPARAM wParam, LPARAM lParam)
{
    LRESULT lResult = Default();

    if (m_cTitle.Compare((LPCTSTR)lParam) != 0)
    {
        m_cTitle = (LPCTSTR)lParam;
        if (pGlobalActiveManager)
        {
            pGlobalActiveManager->PostUpdateMessage();
        }
    }

    return lResult; 
}

void CDevStudioWnd::PreSubclassWindow() 
{
    GetWindowText(m_cTitle);     
	CSubclassWnd::PreSubclassWindow();
}

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
Experion
Canada Canada
You may know Oz from his WndTabs days. Oz has long since left client side development to work on web technologies and to consult in the R&D management field.

Comments and Discussions