Click here to Skip to main content
13,594,656 members
Click here to Skip to main content


33 bookmarked
Posted 26 Jun 2004

Owner Drawn ListViews In WTL

, 26 Jun 2004
An overview of handling owner drawn listview controls in WTL.
// demoproject1.cpp : main source file for demoproject1.exe

#include "stdafx.h"

#include "resource.h"

#include "aboutdlg.h"
#include "MainDlg.h"

CAppModule _Module;

int Run(LPTSTR /*lpstrCmdLine*/ = NULL, int nCmdShow = SW_SHOWDEFAULT)
	CMessageLoop theLoop;

	CMainDlg dlgMain;

	if(dlgMain.Create(NULL) == NULL)
		ATLTRACE(_T("Main dialog creation failed!\n"));
		return 0;


	int nRet = theLoop.Run();

	return nRet;

int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPTSTR lpstrCmdLine, int nCmdShow)
	HRESULT hRes = ::CoInitialize(NULL);
// If you are running on NT 4.0 or higher you can use the following call instead to 
// make the EXE free threaded. This means that calls come in on a random RPC thread.

	// this resolves ATL window thunking problem when Microsoft Layer for Unicode (MSLU) is used
	::DefWindowProc(NULL, 0, 0, 0L);

	AtlInitCommonControls(ICC_BAR_CLASSES);	// add flags to support other controls

	hRes = _Module.Init(NULL, hInstance);

	int nRet = Run(lpstrCmdLine, nCmdShow);


	return nRet;

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.


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


About the Author

Mark Petrik
United States United States
No Biography provided

You may also be interested in...

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web04-2016 | 2.8.180621.3 | Last Updated 27 Jun 2004
Article Copyright 2004 by Mark Petrik
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid