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

Window not shown when not in Focus

Status
Not open for further replies.

scottmanjoe

Technical User
Mar 28, 2003
15
IN
Hi,
These are elements of my dialog based application-
CSetupDlg : CDialog
CMainSheet : CPropertySheet
CPage1 : CPropertyPage
CPage2 : CPropertyPage

Cpage1 and CPage2 are the Pages of the PropertySheet CMainSheet.
The following is called to invoke PropertySheet from CSetupDlg:
////////////////
CMainSheet m_sheetMainPage(strCaption);//
ShowWindow(SW_HIDE);
m_sheetMainPage.DoModal();
////////////////
Now the PropertySheet with the corresponding PropertyPages are displayed._BUT_
Problem:
--------
When I deactivate the PropertySheet window(for ex. by clicking on other windows), the PropertySheet window is not shown in task-bar(it actually shud be shown as a minimized window). Only when I use (ALT+TAB), I am able to again setFocus on that window and invoke it.

Can anyone please suggest anything so that the Window is enabled and available at the task-bar even after out of focus?
Thanks,
Scott
 
I'm sure this isn't the best way, but you could probably resize the main window to make it really small and just hide it behind the property sheet, then restore it to normal after DoModal returns.
 
Hi Timmay,
DoModal is working fine and it displays the PropertySheet window alongwith the PropertyPages.
But It does not display that window in the Task-bar.
Now, when My window is shown and I click on some other window, My window disappears from the task-bar.
But, It is still there in processing coz I can again invoke it by selecting through (ALT+TAB).
I think your suggestion will work when DoModal returns(). But in this case that does not return.
Thanks,
Scott
 
It does not show window in the task bar because the parent of this window is not null. Take a look at thread116-643509.

Ion Filipski
1c.bmp
 
Hi Ion,
Well My problem is that I am calling a CPropertySheet Object's DoModal from a CWinApp's Object's InitInstance.

CMyApp theApp; /*The one and only App Object*/
BOOL CMyApp::InitInstance()
{
....
CString strMainSheet("\0");
strMainSheet.LoadString(IDS_MAIN_SHEET_CAPTION);
CMainSheet Maindlg(strMainSheet,bOption);
/***********/
int nResponseMain = Maindlg.DoModal();
/***********/
....
}

where CMainSheet is defined as:
class CMainSheet : public CPropertySheet
{
...
}

Problem:
-------
Afer calling the Maindlg.DoModal(), the OnInitDialog of the MainSheet is called._BUT_ just after that the function returns without creating the PropertySheet alongwith the PropertyPages in the Window.
Do you have a solution?

Thanks,
Scott
 
The solution is you to analyze more attentive your code and take in consideration the above responces to your question.

Ion Filipski
1c.bmp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top