1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| BOOL CDialog::OnInitDialog(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam)
{
//MessageBox(hWnd,TEXT("init"),TEXT("Info"),MB_ICONINFORMATION);
// Specify that the dialog box should stretch full screen
SHINITDLGINFO shidi = {0};
shidi.dwMask = SHIDIM_FLAGS;
shidi.dwFlags = SHIDIF_SIZEDLGFULLSCREEN ;
shidi.hDlg = hWnd;
if(!SHInitDialog(&shidi))
{
MessageBox(NULL,TEXT("error"),TEXT("Cap"),MB_OK | MB_ICONASTERISK);
return FALSE;
}
// Create menubar
SHMENUBARINFO mbi = {0};
mbi.cbSize = sizeof(SHMENUBARINFO);
mbi.hwndParent = hWnd;
mbi.nToolBarId = this->menuBarId;//*******************
mbi.hInstRes = CDialog::hInstance;
// If we could not initialize the dialog box, return an error
if (!SHCreateMenuBar(&mbi)) {
MessageBox(NULL,TEXT("Menubar failed"),TEXT("Cap"),MB_OK | MB_ICONASTERISK);
DestroyWindow (hWnd);
return FALSE;
}
return TRUE;
} |