Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parent of Dialog is NULL

Status
Not open for further replies.

sweep123

Technical User
Joined
May 1, 2003
Messages
185
Location
GB
I wist to create a dialog that does not minimise when the main application is minimised.

The code I use to create the other dialog is:-

CAData::CAData(CUDP_RxDlg* pParent /*=NULL*/)
: CDialog(CAData::IDD, pParent)

Where CUDP_RxDlg is the Main dialog of the application.

I am told that if I set the parent to NULL then this is how to do it, but I get errors if I do the following:-

CAData::CAircraftData(CUDP_RxDlg* NULL)
: CDialog(CAData::IDD, pParent)

What am I doing wrong?

Sweep
 
just remove WS_CHILD from dialog's window style.

Ion Filipski
1c.bmp

ICQ: 95034075
AIM: IonFilipski
filipski@excite.com
 
The Style property was set to Overlapped already, so still a bit confused.

Did try popup but still no good.

Sweep
 
window style of your box is a combination of flags. Remove WS_CHILD from the combination and call
SetParent(yourDlgWnd, NULL);

Ion Filipski
1c.bmp

ICQ: 95034075
AIM: IonFilipski
filipski@excite.com
 
Thankf for the post however I am using Visual Studio .Net and SetParent only takes one parameter.

I dont understand the tern remove WS_CHILD from the combination - not using it anywhere in the code

Sweep
 
put this in a member function of your dialog class
Code:
	CDialog::ModifyStyle( WS_CHILD,0);
	CDialog::SetParent(NULL);

-pete
 
I placed the statement you suggested above in the Modeless dialog that is created by the main application.

However when I minimise the main application this dialog is also minimised. What I was looking for was this dialog (no parent) to remain on display when the main application is minimised.

I think its possible but not there yet!

Sweep
 
Sweep,

Then you don't really want a modeless dialog you want another top level window. You are trying to put a square peg in a round hole [wink]


-pete
 
OK, but I am a bit lossed as how to create another dialog and have it remain on display when the main application is minimised.

Sweep
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top