Click here to Skip to main content
15,904,655 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: ClistBox problem here........help!!!!! :-( Pin
Mike Danberg16-Oct-03 10:01
Mike Danberg16-Oct-03 10:01 
GeneralRe: ClistBox problem here........help!!!!! :-( Pin
Steve Obbayi16-Oct-03 19:07
professionalSteve Obbayi16-Oct-03 19:07 
GeneralCComboBox Pin
De Nardis Andrea16-Oct-03 3:29
De Nardis Andrea16-Oct-03 3:29 
GeneralRe: CComboBox Pin
David Crow16-Oct-03 7:07
David Crow16-Oct-03 7:07 
GeneralRe: CComboBox Pin
De Nardis Andrea16-Oct-03 8:04
De Nardis Andrea16-Oct-03 8:04 
Generalbluetooth Pin
da_adel16-Oct-03 3:28
da_adel16-Oct-03 3:28 
Questionhow do i make a bitmap appear on a button when i click on the button Pin
swerajan16-Oct-03 2:51
swerajan16-Oct-03 2:51 
GeneralOwner Drawn CHeaderCtrl Items Pin
Uller16-Oct-03 1:58
Uller16-Oct-03 1:58 
All right...Mad | :mad: ... I spent all day yesterday beating my head on the wall trying to get this to work. I have a need to draw the header items of a CHeaderCtrl myself.

I declared my class like this:

class CHPTHeaderCtrl : public CHeaderCtrl
{
public:
//member function declarations go here...
void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);

private:
//member vars go here
}

My DrawItem function is implemented as follows:
void CHPTHeaderCtrl::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
//draw stuff here
}

I create my header control like this:

BOOL Header = m_Header.Create( WS_CHILD | WS_VISIBLE | HDS_BUTTONS | S_HORZ,
rect, CWnd::FromHandle(m_hWnd));

I insert items like this (in an insert function):

HDITEM hdi;

hdi.mask = HDI_TEXT | HDI_FORMAT | HDI_LPARAM;

hdi.cxy = Width;
hdi.fmt = HDF_OWNERDRAW;
hdi.lParam = (LPARAM)pHeaderData;
hdi.pszText = (LPTSTR)strText;

CHeaderCtrl::InsertItem(p_iPosition_i, &hdi);

The result is that my header control draws fine. I can click the buttons, add new columns, (drag and drop if I use the drag/drop flag), etc. Everything seems to work fine, but my DrawItem function is NEVER called!!! Is there something I'm missing?

Thanks.
GeneralRe: Owner Drawn CHeaderCtrl Items Pin
Roger Allen16-Oct-03 2:19
Roger Allen16-Oct-03 2:19 
GeneralRe: Owner Drawn CHeaderCtrl Items Pin
Uller16-Oct-03 3:39
Uller16-Oct-03 3:39 
GeneralRe: Owner Drawn CHeaderCtrl Items Pin
Uller16-Oct-03 2:21
Uller16-Oct-03 2:21 
GeneralRe: Owner Drawn CHeaderCtrl Items Pin
Roger Allen16-Oct-03 5:25
Roger Allen16-Oct-03 5:25 
GeneralRe: Owner Drawn CHeaderCtrl Items Pin
Uller16-Oct-03 7:33
Uller16-Oct-03 7:33 
GeneralImage resolution.. Pin
Neha16-Oct-03 1:42
Neha16-Oct-03 1:42 
Generalinfix to postfix Pin
16-Oct-03 0:45
suss16-Oct-03 0:45 
QuestionHow to draw selection with different color?? Pin
Umesh Sharma16-Oct-03 0:42
Umesh Sharma16-Oct-03 0:42 
QuestionHow to make .ACS(agent character storage) Pin
sunju16-Oct-03 0:34
sunju16-Oct-03 0:34 
GeneralUnexpected Win32 Thread when using sockets Pin
Niklas Andersson15-Oct-03 23:30
Niklas Andersson15-Oct-03 23:30 
GeneralRe: Unexpected Win32 Thread when using sockets Pin
cmk16-Oct-03 9:20
cmk16-Oct-03 9:20 
GeneralRemoveDirectory - help Pin
Boby.George15-Oct-03 23:08
professionalBoby.George15-Oct-03 23:08 
GeneralRe: RemoveDirectory - help Pin
murali_utr16-Oct-03 0:33
murali_utr16-Oct-03 0:33 
GeneralRe: re you? Pin
jhwurmbach15-Oct-03 22:55
jhwurmbach15-Oct-03 22:55 
QuestionClass Problem? Pin
wow999915-Oct-03 21:43
wow999915-Oct-03 21:43 
AnswerRe: Class Problem? Pin
souldog15-Oct-03 22:26
souldog15-Oct-03 22:26 
QuestionHow catch a button in the system taskbar?online wait! Pin
Paristam15-Oct-03 21:14
Paristam15-Oct-03 21:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.