STDMETHODIMP CAtlBase::ShowProgressForm(LONG bShow) { if (bShow) { if (!g_bProgressInited) { g_bProgressInited = TRUE; g_ProgressDlg.Create(NULL); g_ProgressDlg.CenterWindow(); HWND hName = g_ProgressDlg.GetDlgItem(IDC_STATIC_NAME); g_ProgressName.Attach(hName); HWND hProgress = g_ProgressDlg.GetDlgItem(IDC_PROGRESS1); g_ProgressProgress.Attach(hProgress); } g_ProgressDlg.ShowWindow(SW_SHOW); } else { g_ProgressDlg.ShowWindow(SW_HIDE); g_ProgressName.SetWindowText(""); g_ProgressProgress.SetPos(0); } return S_OK; }
VOID CBindTypePage::UpdateControls (UINT32 nType) { CComboBox ctlComboBox; ctlComboBox.Attach(GetDlgItem(IDC_COMBO_DISKCOUNT)); ctlComboBox.ResetContent(); CString strDesc; switch(nType) { case NMT_AGGREGATE : ctlComboBox.InsertString(-1, _T("2")); ctlComboBox.InsertString(-1, _T("3")); ctlComboBox.InsertString(-1, _T("4")); ctlComboBox.InsertString(-1, _T("5")); ctlComboBox.InsertString(-1, _T("6")); ctlComboBox.InsertString(-1, _T("7")); ctlComboBox.InsertString(-1, _T("8")); strDesc.LoadString(IDS_BNZ_DESC_AGGREGATION); break; case NMT_RAID0 : ctlComboBox.InsertString(-1, _T("2")); ctlComboBox.InsertString(-1, _T("4")); ctlComboBox.InsertString(-1, _T("8")); strDesc.LoadString(IDS_BNZ_DESC_RAID0); break; case NMT_RAID1R3 : ctlComboBox.InsertString(-1, _T("2")); strDesc.LoadString(IDS_BNZ_DESC_RAID1); break; case NMT_RAID4R3 : ctlComboBox.InsertString(-1, _T("3")); ctlComboBox.InsertString(-1, _T("5")); ctlComboBox.InsertString(-1, _T("9")); strDesc.LoadString(IDS_BNZ_DESC_RAID4); break; case NMT_RAID5 : ctlComboBox.InsertString(-1, _T("3")); ctlComboBox.InsertString(-1, _T("5")); ctlComboBox.InsertString(-1, _T("9")); strDesc.LoadString(IDS_BNZ_DESC_RAID5); break; default: break; } ctlComboBox.SetCurSel(0); CStatic ctlStatic; ctlStatic.Attach(GetDlgItem(IDC_BIND_TYPE_DESCRIPTION)); ctlStatic.SetWindowText(strDesc); }
LRESULT CAboutDialog::OnInitDialog(HWND hWnd, LPARAM lParam) { CenterWindow(GetParent()); m_wndHyperLink.SubclassWindow(GetDlgItem(IDC_LINK)); CListViewCtrl wndListView(GetDlgItem(IDC_COMPVER)); wndListView.AddColumn(TEXT("Component"), 0); wndListView.AddColumn(TEXT("Version"), 1); wndListView.SetColumnWidth(0, 200); wndListView.SetColumnWidth(1, 100); CString szVer(TEXT("2.10.0 QFE 1")); CStatic wndAppName; wndAppName.Attach(GetDlgItem(IDC_APPNAME)); // CFont hFont; // hFont.Attach(wndAppName.GetFont()); // LOGFONT logFont; // hFont.GetLogFont(&logFont); // logFont.lfHeight = -MulDiv(14, GetDeviceCaps(CWindowDC(m_hWnd), LOGPIXELSY), 72); // hFont.GetLogFont(&logFont); // hFont.Detach(); // wndAppName.SetFont(hFont); wndListView.AddItem(0, 0, TEXT("NDAS Device Management")); wndListView.SetItemText(0, 1, szVer); CString szAppVer; TCHAR szAppVerFmt[256]; GetDlgItemText(IDC_APPVER, szAppVerFmt, 256); szAppVer.Format(szAppVerFmt, szVer); SetDlgItemText(IDC_APPVER, szAppVer); // m_dibHeader.LoadBitmap(IDB_HEADER); // m_bmpHeader.LoadBitmap(IDB_HEADER); m_pix.LoadFromResource( _Module.GetResourceInstance(), IDB_ABOUT_HEADER, _T("IMAGE")); return TRUE; }
LRESULT CNBSelectDeviceDlg::OnInitDialog(HWND /*hwndCtl*/, LPARAM /*lParam*/) { CenterWindow(); CString strText; strText.LoadString(m_nCaptionID); SetWindowText(strText); CStatic ctlMessage; ctlMessage.Attach(GetDlgItem(IDC_STATIC_MESSAGE)); strText.LoadString(m_nMessageID); ctlMessage.SetWindowText(strText); m_wndListSingle.SubclassWindow( GetDlgItem(IDC_LIST_DEVICE) ); if(0 == m_nSelectCount) { m_wndListSingle.ModifyStyle(NULL, WS_DISABLED); } else if(1 == m_nSelectCount) { m_wndListSingle.ModifyStyle(NULL, LVS_SINGLESEL); } else { m_wndListSingle.ModifyStyle(LVS_SINGLESEL, NULL); } DWORD dwExtStyle = LVS_EX_FULLROWSELECT; //| LVS_EX_GRIDLINES //| LVS_EX_INFOTIP m_wndListSingle.SetExtendedListViewStyle( dwExtStyle ); m_wndListSingle.InitColumn(); m_wndListSingle.AddDiskObjectList(m_listDevices); OnListSelChanged(NULL); DoDataExchange(FALSE); return TRUE; }
LRESULT CAboutDialog::OnInitDialog(HWND hWnd, LPARAM lParam) { BOOL fSuccess = FALSE; CenterWindow(GetParent()); m_wndHyperLink.SubclassWindow(GetDlgItem(IDC_LINK)); CString strHyperLink; strHyperLink.LoadString(IDS_ABOUTDLG_HYPERLINK); m_wndHyperLink.SetHyperLink(strHyperLink); CString strAppVer, strProdVer; pGetVersionStrings(strAppVer, strProdVer); CString strProdVerText; TCHAR szProdVerFmt[256] = {0}; CStatic wndProdVer; wndProdVer.Attach(GetDlgItem(IDC_PRODVER)); wndProdVer.GetWindowText(szProdVerFmt, 256); strProdVerText.FormatMessage(szProdVerFmt, strProdVer); wndProdVer.SetWindowText(strProdVerText); CStatic wndProdName; wndProdName.Attach(GetDlgItem(IDC_PRODNAME)); wndProdName.SetFont(pGetTitleFont()); CListViewCtrl wndListView(GetDlgItem(IDC_COMPVER)); CString colName[2]; fSuccess = colName[0].LoadString(IDS_ABOUTDLG_COL_COMPONENT); ATLASSERT(fSuccess); fSuccess = colName[1].LoadString(IDS_ABOUTDLG_COL_VERSION); ATLASSERT(fSuccess); wndListView.AddColumn(colName[0], 0); wndListView.AddColumn(colName[1], 1); wndListView.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT); CString strAppTitle; strAppTitle.LoadString(IDS_MAIN_TITLE); wndListView.AddItem(0, 0, strAppTitle); wndListView.SetItemText(0, 1, strAppVer); CRect rcListView; wndListView.GetClientRect(rcListView); wndListView.SetColumnWidth(0, LVSCW_AUTOSIZE); wndListView.SetColumnWidth(1, rcListView.Width() - wndListView.GetColumnWidth(0)); // // Image Header // m_pix.LoadFromResource( _Module.GetResourceInstance(), IDB_ABOUT_HEADER, _T("IMAGE")); // // Enable/Disable Check for update button // m_wndUpdate.Attach(GetDlgItem(IDC_CHECK_UPDATE)); AutoHModule hUpdateDLL = ::LoadLibrary(_T("ndupdate.dll")); if (NULL != (HMODULE)hUpdateDLL) { } else { m_wndUpdate.ShowWindow(FALSE); } return TRUE; }
BOOL CCompletionPage::OnSetActive() { WTL::CString strText, strText2; SetWizardButtons(PSWIZB_FINISH); CStatic ctlStaticResult; ctlStaticResult.Attach(GetDlgItem(IDC_BIND_RESULT)); CEdit ctlEditResult; ctlEditResult.Attach(GetDlgItem(IDC_EDIT_BIND_SETTING)); // add bind type to list strText2.LoadString( (NMT_AGGREGATE == m_pWizData->m_nBindType) ? IDS_LOGDEV_TYPE_AGGREGATED_DISK : (NMT_RAID0 == m_pWizData->m_nBindType) ? IDS_LOGDEV_TYPE_DISK_RAID0 : (NMT_RAID1 == m_pWizData->m_nBindType) ? IDS_LOGDEV_TYPE_DISK_RAID1 : (NMT_RAID4 == m_pWizData->m_nBindType) ? IDS_LOGDEV_TYPE_DISK_RAID4 : IDS_LOGDEV_TYPE ); strText.FormatMessage(IDS_BNZ_COMPLETE_RESULT_TYPE_FMT, strText2); ctlEditResult.AppendText(strText); ctlEditResult.AppendText(_T("\n")); // add disk titles to list strText.LoadString(IDS_BNZ_COMPLETE_RESULT_DISKS); int i; NBUnitDevicePtrList::iterator itr; CNBUnitDevice *UnitDiskObject, *UnitDiskObjectFailed; for(i = 0, itr = m_pWizData->listUnitDevicesBind.begin(); itr != m_pWizData->listUnitDevicesBind.end(); ++itr, i++) { UnitDiskObject = *itr; if(m_pWizData->m_BindResult == i) UnitDiskObjectFailed = UnitDiskObject; if(itr != m_pWizData->listUnitDevicesBind.begin()) strText += _T(", "); strText += UnitDiskObject->GetName(); } ctlEditResult.AppendText(strText); ctlEditResult.AppendText(_T("\n")); if(m_pWizData->m_BindResult == m_pWizData->m_nDiskCount) { // success strText.LoadString(IDS_BNZ_COMPLETE_SUCCESS); ctlStaticResult.SetWindowText(strText); // size pGetDiskSizeString(strText2, m_pWizData->m_nBindType, m_pWizData->m_nDiskCount, m_pWizData->listUnitDevicesBind); strText.FormatMessage(IDS_BNZ_COMPLETE_RESULT_SIZE_FMT, strText2); ctlEditResult.AppendText(strText); ctlEditResult.AppendText(_T("\n")); } else { // fail strText.LoadString(IDS_BNZ_COMPLETE_FAIL); ctlStaticResult.SetWindowText(strText); if(m_pWizData->m_BindResult != 0xFFFFFFFF) // single disk error { strText.FormatMessage(IDS_BNZ_COMPLETE_RESULT_FAILED_ON_FMT, UnitDiskObjectFailed->GetName()); ctlEditResult.AppendText(strText); ctlEditResult.AppendText(_T("\n")); } GetDescription(strText, m_pWizData->dwBindLastError); ctlEditResult.AppendText(strText); ctlEditResult.AppendText(_T("\n")); } return TRUE; }