Click here to Skip to main content
15,898,981 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Question Pin
rfixxxer11-Aug-04 9:00
rfixxxer11-Aug-04 9:00 
Generaloutputing images from C++ to Excel Pin
John W.11-Aug-04 1:22
John W.11-Aug-04 1:22 
GeneralRe: outputing images from C++ to Excel Pin
Jaime Stuardo11-Aug-04 4:32
Jaime Stuardo11-Aug-04 4:32 
GeneralRe: outputing images from C++ to Excel Pin
John W.12-Aug-04 1:53
John W.12-Aug-04 1:53 
Generaltesting random numbers Pin
chepah11-Aug-04 0:39
chepah11-Aug-04 0:39 
GeneralRe: testing random numbers Pin
thowra11-Aug-04 0:48
thowra11-Aug-04 0:48 
GeneralTalking to CListCtrl that resides in a different process window Pin
Muhammad Ahmed11-Aug-04 0:36
Muhammad Ahmed11-Aug-04 0:36 
GeneralRe: Talking to CListCtrl that resides in a different process window Pin
Antti Keskinen11-Aug-04 2:30
Antti Keskinen11-Aug-04 2:30 
If you have the CWnd pointer of the target window (main window, for now), then continuing from there is very, very easy.

First, use GetTopWindow to get the first child window of the main window. Save this into a seperate pointer. Using the returned pointer, first call ::GetClassName to get the class name of the window. Specify CWnd::m_hWnd as the HWND parameter. If the returned name matches "SysListView32", then this CWnd is the list view control.

If the name doesn't match, use the child window pointer and call CWnd::GetWindow( GWL_HWNDNEXT ) to retrieve the next window in the chain. When the pointer is returned, use CWnd::IsChild with the main window pointer to determine if this window is still a child of the target window. If it is, compare the ::GetClassName again with the list view control classname.

After you find the CWnd that
a) Is a child of the main window
b) Matches the list view control classname,
then use DYNAMIC_DOWNCAST like this:
CListCtrl* pListCtrl = DYNAMIC_DOWNCAST( CListCtrl, pMainWindow );
This will give you a pointer to the CListCtrl class of the list control. If the returned value is NULL, the cast failed. It shouldn't be NULL, because the SysListView32 is encapsulated by the CListCtrl. Remember that your project must be compiled with the Run-Time Type Checking option set to Yes. Otherwise the cast will also fail.

Now use the CListCtrl pointer to manipulate the list view control.

-Antti Keskinen

----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
GeneralCreating a combobox & checkbox dynamically Pin
PrashantJ11-Aug-04 0:18
PrashantJ11-Aug-04 0:18 
GeneralRe: Creating a combobox & checkbox dynamically Pin
dipeka11-Aug-04 1:30
dipeka11-Aug-04 1:30 
GeneralRe: Creating a combobox & checkbox dynamically Pin
PrashantJ11-Aug-04 1:47
PrashantJ11-Aug-04 1:47 
GeneralRe: Creating a combobox & checkbox dynamically Pin
dipeka11-Aug-04 2:11
dipeka11-Aug-04 2:11 
GeneralRe: Creating a combobox & checkbox dynamically Pin
Antti Keskinen11-Aug-04 2:50
Antti Keskinen11-Aug-04 2:50 
GeneralRe: Creating a combobox & checkbox dynamically Pin
David Crow11-Aug-04 5:13
David Crow11-Aug-04 5:13 
GeneralRe: Creating a combobox & checkbox dynamically Pin
PrashantJ11-Aug-04 18:44
PrashantJ11-Aug-04 18:44 
GeneralPipe in release mode Pin
A T I F11-Aug-04 0:03
A T I F11-Aug-04 0:03 
QuestionHow to build bitmaps from the scratch? Pin
User-37793610-Aug-04 23:57
User-37793610-Aug-04 23:57 
AnswerRe: How to build bitmaps from the scratch? Pin
V.11-Aug-04 0:23
professionalV.11-Aug-04 0:23 
AnswerRe: How to build bitmaps from the scratch? Pin
Antony M Kancidrowski11-Aug-04 3:01
Antony M Kancidrowski11-Aug-04 3:01 
GeneralRe: How to build bitmaps from the scratch? Pin
Anonymous11-Aug-04 7:47
Anonymous11-Aug-04 7:47 
GeneralSDI Different Views Pin
Rassul Yunussov10-Aug-04 22:51
Rassul Yunussov10-Aug-04 22:51 
GeneralRe: SDI Different Views Pin
Michael P Butler10-Aug-04 23:37
Michael P Butler10-Aug-04 23:37 
GeneralRe: SDI Different Views Pin
Joel Holdsworth10-Aug-04 23:43
Joel Holdsworth10-Aug-04 23:43 
GeneralLists of a class : where to put a typedef Pin
Jerome Conus10-Aug-04 22:50
Jerome Conus10-Aug-04 22:50 
GeneralRe: Lists of a class : where to put a typedef Pin
Antony M Kancidrowski11-Aug-04 0:04
Antony M Kancidrowski11-Aug-04 0:04 

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.