Click here to Skip to main content
15,909,953 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to start another application and run it within another application Pin
Muhammad Azam5-Oct-04 20:24
Muhammad Azam5-Oct-04 20:24 
GeneralExitProcess Pin
elephantstar28-Sep-04 12:58
elephantstar28-Sep-04 12:58 
GeneralRe: ExitProcess Pin
Antti Keskinen28-Sep-04 18:01
Antti Keskinen28-Sep-04 18:01 
GeneralRe: ExitProcess Pin
elephantstar29-Sep-04 7:23
elephantstar29-Sep-04 7:23 
GeneralInvalid CTempWnd problem Pin
PJ Arends28-Sep-04 12:57
professionalPJ Arends28-Sep-04 12:57 
GeneralRe: Invalid CTempWnd problem Pin
Antti Keskinen28-Sep-04 18:08
Antti Keskinen28-Sep-04 18:08 
GeneralRe: Invalid CTempWnd problem Pin
PJ Arends29-Sep-04 6:21
professionalPJ Arends29-Sep-04 6:21 
GeneralRe: Invalid CTempWnd problem Pin
Antti Keskinen29-Sep-04 6:40
Antti Keskinen29-Sep-04 6:40 
If you had a normal Windows control, it would always have the HWND of the parent window. Thus, getting this HWND and enumerating the child windows would return the control itself at some point.

The COneClickButton is a similar case: it is an MFC control (I presume), thus it needs to be derived from CWnd. In this case, it has the GetParent function, which allows it to get a pointer to the parent's CWnd class.

The most object-oriented way (I think) would be to first use GetParent to get the parent window (property page) and then use EnumChildWindows to query through all children of this page, looking for one which has the same class name as the grid control.

I don't think there is a more object oriented way than that without breaking the way Windows works.. Or at least, I'm not aware of one if there is..

-Antti Keskinen

----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
GeneralDatabase replication - network and island Pin
Ted Christiansen28-Sep-04 11:56
Ted Christiansen28-Sep-04 11:56 
GeneralRe: Database replication - network and island Pin
ssanoj29-Sep-04 9:59
ssanoj29-Sep-04 9:59 
GeneralSetForegroundWindow fails Pin
Neville Franks28-Sep-04 11:47
Neville Franks28-Sep-04 11:47 
GeneralRe: SetForegroundWindow fails Pin
vcplusplus28-Sep-04 12:14
vcplusplus28-Sep-04 12:14 
GeneralRe: SetForegroundWindow fails Pin
vcplusplus28-Sep-04 12:30
vcplusplus28-Sep-04 12:30 
GeneralRe: SetForegroundWindow fails Pin
Neville Franks28-Sep-04 13:07
Neville Franks28-Sep-04 13:07 
GeneralRe: SetForegroundWindow fails Pin
Neville Franks28-Sep-04 13:42
Neville Franks28-Sep-04 13:42 
GeneralRe: SetForegroundWindow fails Pin
Scott H. Settlemier28-Sep-04 14:46
Scott H. Settlemier28-Sep-04 14:46 
GeneralRe: SetForegroundWindow fails Pin
Neville Franks28-Sep-04 15:15
Neville Franks28-Sep-04 15:15 
GeneralRe: SetForegroundWindow fails Pin
Phil J Pearson29-Sep-04 3:49
Phil J Pearson29-Sep-04 3:49 
GeneralRe: SetForegroundWindow fails Pin
Neville Franks29-Sep-04 10:34
Neville Franks29-Sep-04 10:34 
GeneralRe: SetForegroundWindow fails Pin
Phil J Pearson29-Sep-04 10:53
Phil J Pearson29-Sep-04 10:53 
GeneralRe: SetForegroundWindow fails Pin
Neville Franks29-Sep-04 11:04
Neville Franks29-Sep-04 11:04 
GeneralRe: SetForegroundWindow fails Pin
Phil J Pearson30-Sep-04 7:10
Phil J Pearson30-Sep-04 7:10 
GeneralChange style of window owned by another app in 98? Works in XP. Pin
Alex Gibbs28-Sep-04 8:42
Alex Gibbs28-Sep-04 8:42 
GeneralRe: Change style of window owned by another app in 98? Works in XP. Pin
agentnem28-Sep-04 9:16
agentnem28-Sep-04 9:16 
GeneralRe: Change style of window owned by another app in 98? Works in XP. Pin
Alex Gibbs2-Oct-04 7:45
Alex Gibbs2-Oct-04 7:45 

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.