Click here to Skip to main content
15,905,913 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Sorting listboxes descending Pin
monrobot132-Oct-02 16:41
monrobot132-Oct-02 16:41 
GeneralRe: Sorting listboxes descending Pin
Ravi Bhavnani3-Oct-02 4:59
professionalRavi Bhavnani3-Oct-02 4:59 
GeneralRe: Sorting listboxes descending Pin
monrobot133-Oct-02 13:26
monrobot133-Oct-02 13:26 
GeneralRe: Sorting listboxes descending Pin
Ravi Bhavnani3-Oct-02 15:26
professionalRavi Bhavnani3-Oct-02 15:26 
GeneralRe: Sorting listboxes descending Pin
monrobot135-Oct-02 8:39
monrobot135-Oct-02 8:39 
GeneralRe: Sorting listboxes descending Pin
Debs3-Oct-02 0:00
Debs3-Oct-02 0:00 
GeneralRe: Sorting listboxes descending Pin
monrobot133-Oct-02 2:17
monrobot133-Oct-02 2:17 
GeneralCListBox WM_MEASUREITEM problems Pin
alex.barylski2-Oct-02 13:34
alex.barylski2-Oct-02 13:34 
How can I can force the control to send itself a WM_MEASUREITEM message each time it is resized...?

Currently default implementation only fires off a WM_MEASUREITEM at the time of creation and thats it...I need it to fire whenever the control is resized...???

I have the following code (from which I stole from Changing Row Height in an owner drawn Control
By Uwe Keim ) inside my CListBox::OnSize()

CListBox::OnSize(nType, cx, cy); 
		
// Prepare control for custom WM_MEASUREITEM
CRect rc;
GetWindowRect( &rc );

WINDOWPOS wp;
wp.hwnd  = m_hWnd;
wp.cx    = rc.Width();
wp.cy    = rc.Height();
wp.flags = SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOOWNERZORDER | SWP_NOZORDER;

// Force control to receive WM_MEASUREITEM on resizes
SendMessage( WM_WINDOWPOSCHANGED, 0, (LPARAM)&wp );

// Redraw display
Invalidate(FALSE); 


However when the code executes I get an exception:

First-chance exception in Timeline2.exe (KERNEL32.DLL): 0xC00000FD: Stack Overflow.

Any ideas as to why this is happening...? Or atleast another way of forcing the control to receive WM_MEASUREITEM on control resizes...?

Thanx a million!

Cheers! Smile | :) Smile | :) Smile | :)

"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
GeneralRe: CListBox WM_MEASUREITEM problems Pin
Shog92-Oct-02 14:18
sitebuilderShog92-Oct-02 14:18 
GeneralRe: CListBox WM_MEASUREITEM problems Pin
alex.barylski2-Oct-02 19:59
alex.barylski2-Oct-02 19:59 
Questionhow the control goes to my own created procedure Pin
imran_rafique2-Oct-02 13:12
imran_rafique2-Oct-02 13:12 
AnswerRe: how the control goes to my own created procedure Pin
Anders Molin2-Oct-02 13:39
professionalAnders Molin2-Oct-02 13:39 
AnswerRe: how the control goes to my own created procedure Pin
jmkhael2-Oct-02 22:50
jmkhael2-Oct-02 22:50 
Questionhow to log off and login user Pin
imran_rafique2-Oct-02 12:56
imran_rafique2-Oct-02 12:56 
AnswerRe: how to log off and login user Pin
Nilesh Karkhanis3-Oct-02 3:51
Nilesh Karkhanis3-Oct-02 3:51 
GeneralRAS from service Pin
Alexey Yakovlev2-Oct-02 12:54
Alexey Yakovlev2-Oct-02 12:54 
Questionhow to halt mouse and key board Pin
imran_rafique2-Oct-02 12:43
imran_rafique2-Oct-02 12:43 
AnswerRe: how to halt mouse and key board Pin
alex.barylski2-Oct-02 13:36
alex.barylski2-Oct-02 13:36 
GeneralRe: how to halt mouse and key board Pin
imran_rafique2-Oct-02 17:02
imran_rafique2-Oct-02 17:02 
GeneralRe: how to halt mouse and key board Pin
Chris Losinger2-Oct-02 19:16
professionalChris Losinger2-Oct-02 19:16 
GeneralMultithreading :: MFC Pin
valikac2-Oct-02 12:18
valikac2-Oct-02 12:18 
GeneralRe: Multithreading :: MFC Pin
Michael Dunn2-Oct-02 19:23
sitebuilderMichael Dunn2-Oct-02 19:23 
GeneralRe: Multithreading :: MFC Pin
valikac2-Oct-02 19:57
valikac2-Oct-02 19:57 
GeneralDetecting disk letter changes on 2K/XP Pin
Mukkie2-Oct-02 11:51
Mukkie2-Oct-02 11:51 
GeneralDC absolute position Pin
Goa2-Oct-02 11:27
Goa2-Oct-02 11:27 

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.