Link to home
Start Free TrialLog in
Avatar of Wanting2LearnMan
Wanting2LearnManFlag for United Kingdom of Great Britain and Northern Ireland

asked on

AfxMessageBox windows message

When I pop up a message box like so:
AfxMessageBox(_T("message"));

What windows message is posted when the user presses OK?
SOLUTION
Avatar of AndyAinscow
AndyAinscow
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Wanting2LearnMan

ASKER

Thanks.  Would the AfxMessageBox function couse the OnActivatefunction to be called?  My problem is that I want my dialog fullscreen.  I have a tab control in my dialog and it is doing something funny as the dialog does not go fullscreen once the tabs dialogs are created.  If I put in AfxMessageBox in my OnInit then after I press OK it goes fullscreen.

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);

}

I create the dialogs for my tab control in the OnInit of my dialog 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);
The above OnInit should be:
BOOL CMyClass::OnInitDialog()
{
//Tab Options
     m_tabOptions.InsertItem(0, _T("Tab 1"));
     m_tabOptions.InsertItem(1, _T("Tab 2"));
......
.....
     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);


      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);
}

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial