mfc >> List ctrl issues

by Murrgon » Tue, 25 Jan 2005 07:04:57 GMT

I have an MDI Child window that is using a ListView. I
am running the list view in report mode with one column.
I want the column to take up the full width of the window,
but I am running into some problems.

I cannot ask the list view for its client rect in the
OnCreate function because that always returns and empty
rectangle. I don't know at what stage the window rect
will become valid so it is difficult to determine where
to put my column sizing code. Obviously it will be valid
after the window is painted, but there is no message for
"after first paint".

Any tips on how/when I can get the width of the window to
size my column?

Thanks


mfc >> List ctrl issues

by Michael K. O'Neill » Tue, 25 Jan 2005 07:44:06 GMT


Maybe in OnInitialUpdate.

But you will also need to handle WM_SIZE with the same code, so maybe it's
better to put it there. Please note that you might need to test the
validity of the HWND of the list control, since I think WM_SIZE is sent a
few times before all the child windows of the view are created.

Mike








mfc >> List ctrl issues

by Jiangsheng[MVP/VC] » Tue, 25 Jan 2005 11:54:52 GMT

How about OnInitupdate?
"Murrgon" < XXXX@XXXXX.COM > : XXXX@XXXXX.COM ...




List ctrl issues

by Murrgon » Wed, 26 Jan 2005 00:05:58 GMT

All I can say is... duh. Sometimes your brain freezes and you forget
things that you have been doing for, like, ever. Thanks for the
reminder.




Similar Threads

1. Core issues list rev 41 and library issues lists rev 42 available

2. The C++ core issues list rev 42 and library issues list rev 43 are now available

3. 2008-12 mailing available, plus core issues list rev 60 and library issues list rev 61

4. 2008-12 mailing available, plus core issues list rev 60 and library issues list rev 61

5. 2008-12 mailing available, plus core issues list rev 60 and library issues list rev 61

6. Security issue running unmanaged code in a win form ctrl hosted in - CSharp/C#

7. Handling ENter event on LIst Ctrl

I have a list control. On doubleclick of list item, a new dlg opens.  Now, i want to handle 'OnEnter Key'also. i.e. When a list item is selected & Enter key is pressed, the new dlg shd open
I tried implementing with NM_RETURN. But, the application does not catch this msg
Also i tried with LVN_KEYDOWN.
void CListExDlg::OnKeydownList(NMHDR* pNMHDR, LRESULT* pResult)

	LV_KEYDOWN* pLVKeyDow = (LV_KEYDOWN*)pNMHDR
	// TODO: Add your control notification handler code her

	if(pLVKeyDow->wVKey == VK_RETURN
	
		AfxMessageBox("KeyDOwn");
	
	els
	
		AfxMessageBox("NO");
	
	*pResult = 0


But it does not catch 'Enter' Key of KeyBoard.
But when if(pLVKeyDow->wVKey == VK_SHIFT), this works fine

Please let me know how 'Enter' Key event can be checked

8. How to HitTest an item of a List Ctrl owned by another thread