Click here to Skip to main content
15,892,059 members
Articles / Programming Languages / C++

Windows Switcher Add-In

Rate me:
Please Sign up or sign in to vote.
3.50/5 (2 votes)
4 Jan 20042 min read 45.4K   388   11  
How to speed-up navigating in big workspace using keyboard
// Commands.cpp : implementation file
//

#include "stdafx.h"
#include "WindowsSwitcher.h"
#include "Commands.h"
#include "WindowsListDialog.h"

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

/////////////////////////////////////////////////////////////////////////////
// CCommands

CCommands::CCommands()
{
	m_pApplication = NULL;
}

CCommands::~CCommands()
{
	ASSERT (m_pApplication != NULL);
	m_pApplication->Release();
}

void CCommands::SetApplicationObject(IApplication* pApplication)
{
	// This function assumes pApplication has already been AddRef'd
	//  for us, which CDSAddIn did in its QueryInterface call
	//  just before it called us.
	m_pApplication = pApplication;
}


/////////////////////////////////////////////////////////////////////////////
// CCommands methods

STDMETHODIMP CCommands::WindowsSwitcherCommandMethod() 
{
	AFX_MANAGE_STATE(AfxGetStaticModuleState());

	// TODO: Replace this with the actual code to execute this command
	//  Use m_pApplication to access the Developer Studio Application object,
	//  and VERIFY_OK to see error strings in DEBUG builds of your add-in
	//  (see stdafx.h)

	VERIFY_OK(m_pApplication->EnableModeless(VARIANT_FALSE));
	
	CWindowsListDialog oWindowsListDialog( m_pApplication );

	oWindowsListDialog.DoModal();

	VERIFY_OK(m_pApplication->EnableModeless(VARIANT_TRUE));
	return S_OK;
}

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
Web Developer
Poland Poland
Mariusz Wojtysiak started his career as coder on ZX-Spectrum demo-scene under nickname Maniu. He graduated Poznan University of Technology. His skills are: project/develop/maintenance of Oracle and MS SQL databases, programming in C++ (including MFC, ATL, Soap), Oracle Forms, and Assembler.
Currently works in IN-Software as developer. Live in Poznan/Poland.

Comments and Discussions