Wanting2LearnMan
asked on
Dialog Fullscreen question
I have a windows mobile app writen using MFC in VS2005. I have made all my dialogs fullscreen using the following:
BOOL CMyClass::OnInitDialog()
{
SHINITDLGINFO shidi;
shidi.dwMask = SHIDIM_FLAGS;
shidi.dwFlags =SHIDIF_FULLSCREENNOMENUBA R;
shidi.hDlg = m_hWnd;
::SHInitDialog(&shidi);
SetForegroundWindow();
SHFullScreen( m_hWnd, SHFS_HIDESTARTICON|
SHFS_HIDETASKBAR|
SHFS_HIDESIPBUTTON );
MoveWindow(0,0,240,320,TRU E);
HWND hWnd;
hWnd = ::SHFindMenuBar(this->m_hW nd);
::ShowWindow(hWnd, SW_HIDE);
}
AND
void COptions::OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized)
{
CDialog::OnActivate(nState , pWndOther, bMinimized);
SHFullScreen( m_hWnd, SHFS_HIDESTARTICON|SHFS_HI DETASKBAR|
SHFS_HIDESIPBUTTON );
MoveWindow(0,0,240,320,TRU E);
HWND hWnd;
hWnd = ::SHFindMenuBar(this->m_hW nd);
::ShowWindow(hWnd, SW_HIDE);
}
But I am having a problem with one of my dialogs which contains a tab control with 3 tabs. In each tab I have a seperate dialog and I place each one like so:
//Tab Options
dlgTab1Dlg = new CTab1(this);
dlgTab1Dlg->Create(IDD_TAB 1_DIALOG, this);
dlgTab1Dlg->SetParent(&m_t abOptions) ;
dlgTab1Dlg->ShowWindow(SW_ SHOW);
dlgTab1Dlg->SetWindowPos(N ULL, rTab.left, rTab.top, rTab.Width(), rTab.Height(), SWP_NOZORDER);
dlgTab2Dlg = new CTab2(this);
dlgTab2Dlg->Create(IDD_TAB 2_DIALOG, this);
dlgTab2Dlg->SetParent(&m_t abOptions) ;
dlgTab2Dlg->ShowWindow(SW_ SHOW);
dlgTab2Dlg->SetWindowPos(N ULL, rTab.left, rTab.top, rTab.Width(), rTab.Height(), SWP_NOZORDER);
etc...
I cannot get the dialog which contains these tab dialogs to hide the bottom menu bar. Why would doing the above affect this??
BOOL CMyClass::OnInitDialog()
{
SHINITDLGINFO shidi;
shidi.dwMask = SHIDIM_FLAGS;
shidi.dwFlags =SHIDIF_FULLSCREENNOMENUBA
shidi.hDlg = m_hWnd;
::SHInitDialog(&shidi);
SetForegroundWindow();
SHFullScreen( m_hWnd, SHFS_HIDESTARTICON|
SHFS_HIDETASKBAR|
SHFS_HIDESIPBUTTON );
MoveWindow(0,0,240,320,TRU
HWND hWnd;
hWnd = ::SHFindMenuBar(this->m_hW
::ShowWindow(hWnd, SW_HIDE);
}
AND
void COptions::OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized)
{
CDialog::OnActivate(nState
SHFullScreen( m_hWnd, SHFS_HIDESTARTICON|SHFS_HI
SHFS_HIDESIPBUTTON );
MoveWindow(0,0,240,320,TRU
HWND hWnd;
hWnd = ::SHFindMenuBar(this->m_hW
::ShowWindow(hWnd, SW_HIDE);
}
But I am having a problem with one of my dialogs which contains a tab control with 3 tabs. In each tab I have a seperate dialog and I place each one like so:
//Tab Options
dlgTab1Dlg = new CTab1(this);
dlgTab1Dlg->Create(IDD_TAB
dlgTab1Dlg->SetParent(&m_t
dlgTab1Dlg->ShowWindow(SW_
dlgTab1Dlg->SetWindowPos(N
dlgTab2Dlg = new CTab2(this);
dlgTab2Dlg->Create(IDD_TAB
dlgTab2Dlg->SetParent(&m_t
dlgTab2Dlg->ShowWindow(SW_
dlgTab2Dlg->SetWindowPos(N
etc...
I cannot get the dialog which contains these tab dialogs to hide the bottom menu bar. Why would doing the above affect this??
I can be wrong here. Also I don't understand - the task is to hide the MS controls and don't see them in the application at all? Or sometimes you need to show them?
How I remember you need to hide MS bars and menus only once in your application, you don't need to do it in each dialog. I don't know remember it will look like if you will open and close them all the time. When you do it (show/hide for the such system controls) you have to redraw your window each time.
In CDialog::OnInitDialog should be a line like:
m_bFullScreen = TRUE;
so just make m_bFullScreen = FALSE in your dialog.
How I remember you need to hide MS bars and menus only once in your application, you don't need to do it in each dialog. I don't know remember it will look like if you will open and close them all the time. When you do it (show/hide for the such system controls) you have to redraw your window each time.
In CDialog::OnInitDialog should be a line like:
m_bFullScreen = TRUE;
so just make m_bFullScreen = FALSE in your dialog.
ASKER
Yes the task is to hide the MS controls and don't see them in the application at all. I dont want to see them anytime.
I have found that I have to do it in the OnInitDialog AND OnActivate because if you launch a new dialog the menubar will reappear. The problem I have is strange as the addition of the Tab control with these other dialogs placed inside the tab control seem to not allow me to hide the menubar like I normally do.
Any other ideas? Thanks
I have found that I have to do it in the OnInitDialog AND OnActivate because if you launch a new dialog the menubar will reappear. The problem I have is strange as the addition of the Tab control with these other dialogs placed inside the tab control seem to not allow me to hide the menubar like I normally do.
Any other ideas? Thanks
ASKER
Also, why would I make m_bFullScreen = FALSE ? when I want my dialog to be fullscreen?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
dlgTab1Dlg->Create(IDD_INC
and
dlgTab2Dlg->Create(IDD_INC
Then my dialogs are shown fullscreen with the bottom menu bar hidden (The dialogs in the tabs are not shown but this may give a hint as to whats wrong)