?
Solved

Dialog Fullscreen question

Posted on 2009-05-15
5
Medium Priority
?
478 Views
Last Modified: 2013-12-27
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_FULLSCREENNOMENUBAR;
      shidi.hDlg = m_hWnd;
      ::SHInitDialog(&shidi);
      SetForegroundWindow();
      SHFullScreen( m_hWnd, SHFS_HIDESTARTICON|
      SHFS_HIDETASKBAR|
      SHFS_HIDESIPBUTTON );

      MoveWindow(0,0,240,320,TRUE);

      HWND hWnd;
      hWnd = ::SHFindMenuBar(this->m_hWnd);
      ::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_HIDETASKBAR|
                                                SHFS_HIDESIPBUTTON );

     MoveWindow(0,0,240,320,TRUE);

     HWND hWnd;
     hWnd = ::SHFindMenuBar(this->m_hWnd);
     ::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_TAB1_DIALOG, this);
     dlgTab1Dlg->SetParent(&m_tabOptions);
     dlgTab1Dlg->ShowWindow(SW_SHOW);
     dlgTab1Dlg->SetWindowPos(NULL, rTab.left, rTab.top, rTab.Width(), rTab.Height(), SWP_NOZORDER);

     dlgTab2Dlg = new CTab2(this);
     dlgTab2Dlg->Create(IDD_TAB2_DIALOG, this);
     dlgTab2Dlg->SetParent(&m_tabOptions);
     dlgTab2Dlg->ShowWindow(SW_SHOW);
     dlgTab2Dlg->SetWindowPos(NULL, 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??
0
Comment
Question by:Wanting2LearnMan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 

Author Comment

by:Wanting2LearnMan
ID: 24401105
If I comment out the lines:
dlgTab1Dlg->Create(IDD_INCLUDE_DIALOG, this);
and
dlgTab2Dlg->Create(IDD_INCLUDE_DIALOG, this);

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)
0
 
LVL 33

Expert Comment

by:pgnatyuk
ID: 24401701
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.
0
 

Author Comment

by:Wanting2LearnMan
ID: 24401812
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
0
 

Author Comment

by:Wanting2LearnMan
ID: 24401815
Also, why would I make m_bFullScreen = FALSE ? when I want my dialog to be fullscreen?
0
 
LVL 33

Accepted Solution

by:
pgnatyuk earned 2000 total points
ID: 24403533
m_bFullScreen is from the MFC, if you will debug your OnInitDialog you can get in into CDialog::OnInitDiallog and see what's going on there. It should TRUE, that was my misunderstanding or a mistake.
How I remember,  MFC calls SHInitDialog, so in each full screen dialog you see the command bar again. You need to hide it and redraw your dialog. You need to handle WM_ACTIVATE. You see - you draw your window millions of times.
I was lucky to escape from this, I don't use MFC. So only when the application starts up, I need to hide the command bar and I need to handle WM_ACTIVATE only in the main window.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you are anything like me, you install many apps on your phone and have your life on it, sometimes literally.  When I bought my current phone, a Samsung Galaxy S5 from Verizon, they were only selling the versions with 16 GB internal.  I didn't rea…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
Suggested Courses
Course of the Month8 days, 7 hours left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question