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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Showing a window

Status
Not open for further replies.

psnead

Programmer
Jul 5, 2000
41
DK
I have an MDI application with four different document types. I only want the user to have one of each document type open at a time. Does anyone know how to do this?

Currently, in my class derived from CWinApp I call myTemplate->GetFirstDocView() to see if there is a document window open. If there is a Document window open, how do I put it at the top of the z-order. I know that there are functions like ShowWindow(), but I don't know how to get a CWnd* from the CWinApp class.
 
is a nonsence to do try to get it from winapp. See you CWnd/CFrame*/CDialog... You will show the instance of window what you interest, not some kind of window from the app what could be here or not. John Fill
1c.bmp


ivfmd@mail.md
 
About the detection of another child window active for the specified template
You can use the following functions:
- GetActiveDocument and GetActiveView(From the CMainFrame class) - to get a pointer use (CMainFrame*)AfxGetMainWnd()
- GetFirstDocTemplatePosition and GetNextDocTemplatePosition(from the CWinApp derived class) - you can get a pointer with (CMyApp*)AfxGetApp()

For activating a child window you have:

CMDIFrameWnd::MDIActivate(CWnd* pWndActivate), you can call it from your CMainFrame class or from another place.

Hope this helps, s-)

Blessed is he who in the name of justice and good will, shepards the week through the valley of darknees...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top