Solved

No WM_CREATE for CListCtrl?

Posted on 1997-05-14
2
530 Views
Last Modified: 2013-11-19
I have derived a class from CListCtrl.  I need to set the control's column widths as soon as the control is attached to the CWnd.  Although WM_DESTROY is sent to the control, WM_CREATE is not, so that's out.  Is there a message that I can handle in my derived class that will come exactly one time, after the control is ready to accept SetColumnWidth()?  
0
Comment
Question by:laleonard
2 Comments
 
LVL 3

Accepted Solution

by:
Melange earned 50 total points
ID: 1301555
Is your control being accessed via the DDX_Control function or is it part of a CListView?

If the control is in a dialog and is being subclassed through DDX_Control, then one way that should work would be to override the PreSubclassWindow function. Your control won't yet be receiving messages in this function, but it should have the correct HWND to be able to call the CListCtrl functions like SetColumnWidth.

The reason you're not getting the WM_CREATE message is that it is sent immediately when the control is created and subclassing doesn't ocurr until later.

0
 

Author Comment

by:laleonard
ID: 1301556
(I am using DDX_CONTROL).  Great!  That makes sense; the WM_CREATE probably could be caught in the view.  PreSubclassWindow() works fine, though.  Thanks.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Strange date stored 22 100
Define unique primary key 9 81
centeredAverage challenge 8 124
Path of Workbook 3 45
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now