BOOL CWizardPage3::OnSetActive() { CPropertySheet* parent = (CPropertySheet*)GetParent(); parent->SetWizardButtons(PSWIZB_BACK | PSWIZB_FINISH); CString csMsg; LOADSTRING(csMsg,IDS_MAIN_SETTINGS); parent->SetWindowTextW(csMsg); return CPropertyPage::OnSetActive(); }
BOOL CWizardPage3::OnInitDialog() { CPropertyPage::OnInitDialog(); m_pBtnRecording = new CButtonST; m_pBtnSystem = new CButtonST; m_pBtnApp = new CButtonST; CRect rect,rectClient; GetClientRect(rectClient); COLORREF clBG = GLOBALBKCOLOR; int nHoveOver = (int)BTNST_AUTO_GRAY; DWORD dwStyle = BS_PUSHBUTTON |BS_NOTIFY |WS_VISIBLE; CString csCaption,csTmp; // set some static messages LOADSTRING(csCaption,IDS_WIZARD_P3_1); GetDlgItem(IDC_STATIC_WIZARD_P3_1)->SetWindowTextW(csCaption); LOADSTRING(csCaption,IDS_WIZARD_P3_2); GetDlgItem(IDC_STATIC_WIZARD_P3_2)->SetWindowTextW(csCaption); LOADSTRING(csTmp,IDS_WIZARD_P3_3); csCaption.Format(csTmp, CProductDefine::m_tzProductName); GetDlgItem(IDC_STATIC_WIZARD_P3_3)->SetWindowTextW(csCaption); //Recording Button GetDlgItem(IDC_STATIC_WIZARD_P3_2)->GetWindowRect(&rect); m_pBtnRecording->Create(NULL, dwStyle, CRect(rectClient.left+BTNDISTANCE, 120, BTNWIDTH+rectClient.left+BTNDISTANCE, BTNWIDTH+130), this, IDC_TREECTRL+2); m_pBtnRecording->SetBitmaps(IDB_RECORDING, clBG ,nHoveOver); GetDlgItem(IDC_STATIC_WIZARD_P3_3)->GetWindowRect(&rect); m_pBtnSystem->Create(NULL, dwStyle, CRect(rectClient.left+BTNDISTANCE, 220, BTNWIDTH+rectClient.left+BTNDISTANCE, BTNWIDTH+230), this, IDC_TREECTRL+3); m_pBtnSystem->SetBitmaps(IDB_SYSTEM, clBG ,nHoveOver); /*m_pBtnApp->Create(NULL, dwStyle, CRect(rect.left,rect.top+ BTNDISTANCE*2,BTNWIDTH,BTNWIDTH+ BTNDISTANCE*2), this, IDC_TREECTRL+4); m_pBtnApp->SetBitmaps(IDB_APPNEW, clBG ,nHoveOver);*/ return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
void CAddDevice::DisplayError(ErrorMsg msg) { CString csMsg; switch(msg) { case NOT_FOUND_DEVICE: { LOADSTRING(csMsg, IDS_ADD_CAM_NOT_FOUND); } break; case SEARCHING_DEVICE: { csMsg = _T("Searching device, please wait!"); } break; } AfxMessageBox(csMsg); }
BOOL CALLBACK SearchCallback(HWND hDlg, UINT uMsg, WPARAM wPar, LPARAM lPar) { extern BOOL SearchBoxPosition, HexEditTextSide; extern INT SearchBoxX, SearchBoxY; static RECT DlgRect; static BOOL Enabled; static CHAR CloseString[10]; PARAM_NOT_USED(lPar); switch (uMsg) { RECT r; case WM_INITDIALOG: GetWindowRect(hDlg, &DlgRect); GetWindowRect(GetDlgItem(hDlg, IDC_REPLACE), &r); SetWindowPos(hDlg, 0, SearchBoxX, SearchBoxY, DlgRect.right - DlgRect.left, r.top - DlgRect.top, SearchBoxPosition ? SWP_NOZORDER : SWP_NOZORDER | SWP_NOMOVE); SendMessage(hDlg, DM_REPOSITION, 0, 0); EnableWindow(GetDlgItem(hDlg, IDC_SHOWREPLACE), FALSE); if (HexInput != (HexEditMode && !HexEditTextSide)) { HexInput ^= TRUE; *SearchBuf = '\0'; } if (SelectCount && (HexInput ? 3 : 1) * SelectCount < WSIZE(SearchBuf)) { POSITION SelPos; INT i, c; PWSTR p = SearchBuf; SelPos = SelectStart; for (i=(INT)SelectCount; i; --i) { if (HexInput) { c = ByteAt(&SelPos); if (Advance(&SelPos, 1) != 1) break; if (UtfEncoding == 16 && i > 1) { if (UtfLsbFirst) c |= ByteAt(&SelPos) << 8; else c = (c << 8) | ByteAt(&SelPos); if (Advance(&SelPos, 1) != 1) break; --i; } p += _snwprintf(p, WSIZE(SearchBuf) - (p-SearchBuf), UtfEncoding == 16 ? L"%04x " : L"%02x ", c); } else { if ((c = CharAt(&SelPos)) == C_CRLF) c = '\r'; else if (!UtfEncoding) c = CharSetToUnicode(c); if (UtfEncoding == 16) { if (i > 1) --i; if (Advance(&SelPos, 2) != 2) break; } else if (Advance(&SelPos, 1) != 1) break; *p++ = c; } } if (HexInput) --p; *p = '\0'; if (*SearchBuf && !ViewOnlyFlag) EnableWindow(GetDlgItem(hDlg, IDC_SHOWREPLACE), TRUE); } else { PWSTR p; if ((p = ExtractIdentifier(NULL)) != NULL) wcsncpy(SearchBuf, p, WSIZE(SearchBuf)); } Enabled = *SearchBuf!='\0'; if (Enabled) { EnableWindow(GetDlgItem(hDlg, IDOK), TRUE); SetDlgItemTextW(hDlg, IDC_SEARCHSTRING, SearchBuf); SendMessage(hDlg, DM_SETDEFID, IDOK, 0L); } else { SendMessage(hDlg, DM_SETDEFID, IDCANCEL, 0L); EnableWindow(GetDlgItem(hDlg, IDOK), FALSE); } EnableWindow(GetDlgItem(hDlg, IDC_REPLACESTRING), FALSE); EnableWindow(GetDlgItem(hDlg, IDC_REPLACE), FALSE); EnableWindow(GetDlgItem(hDlg, IDC_REPLACEALL), FALSE); CheckDlgButton(hDlg, *SrchDispBuf=='?' ? IDC_BACKWARD : IDC_FORWARD, TRUE); CheckDlgButton(hDlg, IDC_MATCHCASE, !IgnoreCaseFlag); CheckDlgButton(hDlg, IDC_MAGIC, Magic); CheckDlgButton(hDlg, IDC_HEXSEARCH, HexInput); CheckDlgButton(hDlg, IDC_WHOLEWORD, WholeWord); CheckDlgButton(hDlg, IDC_WRAPSCAN, WrapScanFlag); LOADSTRING(hInst, 909, CloseString, sizeof(CloseString)); ReplaceOpen = FALSE; PostMessage(hDlg, WM_COMMAND, 4569, 0); /*for Wine*/ return (TRUE); case WM_COMMAND: switch (COMMAND) { case 4569: /*Disable/enable again for Wine...*/ EnableWindow(GetDlgItem(hDlg, IDOK), Enabled); break; case IDOK: SearchOk(hDlg); break; case IDCANCEL: if (ReplacingAll) Interrupted = TRUE; PostMessage(hDlg, WM_CLOSE, 0, 0); break; case IDC_SEARCHSTRING: GetDlgItemTextW(hDlg, IDC_SEARCHSTRING, CommandBuf, 4); if (Enabled != (*CommandBuf != '\0')) { if (Enabled ^= TRUE) { EnableWindow(GetDlgItem(hDlg, IDOK), TRUE); SendMessage(hDlg, DM_SETDEFID, IDOK, 0L); } else { SendMessage(hDlg, DM_SETDEFID, IDCANCEL, 0L); EnableWindow(GetDlgItem(hDlg, IDOK), FALSE); } if (ReplaceOpen) { EnableWindow(GetDlgItem(hDlg,IDC_REPLACE), Enabled); EnableWindow(GetDlgItem(hDlg,IDC_REPLACEALL),Enabled); } } break; case IDC_SHOWREPLACE: EnableWindow(GetDlgItem(hDlg, IDC_REPLACESTRING), TRUE); EnableWindow(GetDlgItem(hDlg, IDC_REPLACE), SelectCount!=0); EnableWindow(GetDlgItem(hDlg, IDC_REPLACEALL), TRUE); SetWindowPos(hDlg, 0,0,0, DlgRect.right-DlgRect.left, DlgRect.bottom-DlgRect.top, SWP_NOZORDER | SWP_NOMOVE); SendMessage(hDlg, DM_REPOSITION, 0, 0); SetFocus(GetDlgItem(hDlg, IDC_REPLACESTRING)); SendMessage(hDlg, DM_SETDEFID, IDC_REPLACE, 0L); EnableWindow(GetDlgItem(hDlg, IDC_SHOWREPLACE), FALSE); ReplaceOpen = TRUE; break; case IDC_REPLACE: ReplaceSearched(hDlg); SetDlgItemText(hDlg, IDCANCEL, CloseString); break; case IDC_REPLACEALL: SetupSearchString(hDlg, NULL); GlobalSubst(hDlg); SetDlgItemText(hDlg, IDCANCEL, CloseString); } return (TRUE); case WM_MOVE: case WM_CLOSE: SearchBoxPosition = TRUE; GetWindowRect(hDlg, &r); SearchBoxX = r.left; SearchBoxY = r.top; if (uMsg == WM_CLOSE) { DestroyWindow(hDlg); hwndSearch = NULL; } return (TRUE); } return (FALSE); }
BOOL DlgMatrixTab::OnInitDialog() { //if (m_bPopupDialog) //{ // SetWindowLong(this->m_hWnd, GWL_STYLE, // ((GetWindowLong(this->m_hWnd, GWL_STYLE) & ~(WS_CHILD)) | WS_POPUP)); // //| DS_FIXEDSYS | WS_CHILD | WS_VISIBLE // //STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU // //DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_SYSMENU // //ModifyStyle(WS_CHILD, DS_MODALFRAME | WS_POPUP | WS_CAPTION ); //}else //{ //GWL_EXSTYLE // SetWindowLong(this->m_hWnd, GWL_STYLE, // ((GetWindowLong(this->m_hWnd, GWL_STYLE) & ~(WS_POPUP)) | WS_CHILD)); // //ModifyStyle( WS_POPUP, WS_CHILD); //} //POINT pos; //GetCursorPos(&pos); // here is your coordinates //int i_x=pos.x; //int i_y=pos.y; //int i_h=70, i_w=48, i_gap=30, i_sw=10, i_dw=410, i_y1=50 ; //SetWindowPos(NULL, i_x-i_dw, i_y, 0, 0, SWP_NOSIZE | SWP_NOZORDER); CDialog::OnInitDialog(); if (m_bPopupDialog) { m_Brushbk.CreateSolidBrush(GLOBALBKCOLOR); SetWindowLong(this->m_hWnd, GWL_STYLE, (GetStyle() | DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_SYSMENU |WS_BORDER)); } else m_Brushbk.CreateSolidBrush(BKCOLOR); DWORD dwStyle = BS_PUSHBUTTON |BS_NOTIFY |WS_VISIBLE; COLORREF clBG = BKCOLOR; int nHoveOver = (int)BTNST_AUTO_GRAY; CRect rc; GetClientRect(rc); //ClientToScreen(rc); //MoveWindow(rc.left, rc.top, rc.right, rc.bottom, SWP_NOSIZE | SWP_NOZORDER); CString csMsg; LOADSTRING(csMsg,IDS_EMAPLIVEVIEW); AfxExtractSubString(csMsg, csMsg.GetBuffer(), 0, ':'); TCITEM tcItem; tcItem.mask = TCIF_TEXT; tcItem.pszText = (LPWSTR)(LPCTSTR)csMsg; m_TabCtrl.InsertItem(LV, &tcItem); m_dlgMatrixTag = new CDlgMatrixTag; m_dlgMatrixTag->Create(IDD_DLG_MATRIX,&m_TabCtrl); LOADSTRING(csMsg,IDS_ADD_CAM_EVENT_GROUP) tcItem.pszText = (LPWSTR)(LPCTSTR)csMsg; m_TabCtrl.InsertItem(EVENTLV, &tcItem); m_dlgMatrixEvent = new CDlgMatrixEvent; m_dlgMatrixEvent->Create(IDD_DLG_MATRIX_EVENT,&m_TabCtrl); LOADSTRING(csMsg,IDS_FLYAWAY); tcItem.pszText = (LPWSTR)(LPCTSTR)csMsg; m_TabCtrl.InsertItem(IPWALL, &tcItem); vSetTabCtrlStyle(); CRect rect; //rect.OffsetRect(-10, -10); m_TabCtrl.GetClientRect(&rect); //ClientToScreen(rect); rect.top+=20; //rect.bottom-=4; //rect.left+=4; //rect.right-=4; m_dlgMatrixTag->MoveWindow(&rect); m_dlgMatrixEvent->MoveWindow(&rect); m_dlgMatrixTag->ShowWindow(SW_SHOW); m_dlgMatrixEvent->ShowWindow(SW_HIDE); // this runs first than CEtroExplorerView::OnInitialUpdate(), so i have to get this value from ini CIniReader ini; CString csEventLV = ini.getKeyValue(_T("EventLV"),_T("video")); if( _ttoi(csEventLV) == 1) { m_TabCtrl.SetCurSel(1);// select event tab m_dlgMatrixEvent->ShowWindow(SW_SHOW); m_dlgMatrixTag->ShowWindow(SW_HIDE); ((CMainFrame*)AfxGetMainWnd())->m_bEventLV = true; } else ((CMainFrame*)AfxGetMainWnd())->m_bEventLV = false; ((CMainFrame*)AfxGetMainWnd())->m_bIPWallSelected = false; //if (m_bPopupDialog) //{ // SetWindowLong(this->m_hWnd, GWL_STYLE, // ((GetWindowLong(this->m_hWnd, GWL_STYLE) & ~(WS_CHILD)) | WS_POPUP | DS_MODALFRAME)); // //| DS_FIXEDSYS | WS_CHILD | WS_VISIBLE // //STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU // //DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_SYSMENU // //ModifyStyle(WS_CHILD, DS_MODALFRAME | WS_POPUP | WS_CAPTION ); // CRect rc; // GetWindowRect(rc); // SetWindowPos(this, rc.left, rc.top,rc.Width(),rc.Height(),WS_EX_TOPMOST); // CenterWindow(); //}else //{ // SetWindowLong(this->m_hWnd, GWL_STYLE, // ((GetWindowLong(this->m_hWnd, GWL_STYLE) & ~(WS_POPUP)) | WS_CHILD)); //} return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
void CDlgSettingFtpEmail::vInitEmail(void) { pServerList = (CListCtrl*) GetDlgItem(IDC_LISTSERVER); pEmailList = (CListCtrl*) GetDlgItem(IDC_LIST1); DWORD dwStyle = pServerList->GetStyle(); dwStyle |= LVS_EX_FULLROWSELECT ; pServerList->SetExtendedStyle(dwStyle); pEmailList->SetExtendedStyle(LVS_EX_FULLROWSELECT); int ll_y=30; //CBitmapButton* m_butSAdd= new CBitmapButton ; dwStyle = WS_CHILD|WS_VISIBLE|BS_OWNERDRAW ; m_butSAdd.Create(NULL, dwStyle, CRect(20, ll_y, 44, ll_y+24) ,this ,IDC_BUT_SERVERADD); m_butSAdd.LoadBitmaps(IDB_CAMGROUP_ADD, IDB_CAMGROUP_ADD, IDB_CAMGROUP_ADD,IDB_CAMGROUP_ADD); m_butSAdd.ShowWindow(SW_SHOW); //CBitmapButton* m_butSDel = new CBitmapButton ; m_butSDel.Create(NULL, dwStyle, CRect(50, ll_y, 74, ll_y+24) ,this ,IDC_BUT_SERVERDEL); m_butSDel.LoadBitmaps(IDB_CAMGROUP_DEL, IDB_CAMGROUP_DEL, IDB_CAMGROUP_DEL,IDB_CAMGROUP_DEL_DIS); m_butSDel.ShowWindow(SW_SHOW); //CBitmapButton* m_butSMod = new CBitmapButton ; m_butSMod.Create(NULL, dwStyle, CRect(80, ll_y, 104, ll_y+24) ,this , IDC_BUT_SERVERMOD); m_butSMod.LoadBitmaps(IDB_CAMGROUP_EDIT, IDB_CAMGROUP_EDIT, IDB_CAMGROUP_EDIT,IDB_CAMGROUP_EDIT_DIS); m_butSMod.ShowWindow(SW_SHOW); ll_y = 185; //CBitmapButton* m_butAdd= new CBitmapButton ; //DWORD dwStyle = WS_CHILD|WS_VISIBLE|BS_OWNERDRAW ; m_butAdd.Create(NULL, dwStyle, CRect(20, ll_y, 44, ll_y+24) ,this ,IDC_BUT_ADD); m_butAdd.LoadBitmaps(IDB_CAMGROUP_ADD, IDB_CAMGROUP_ADD, IDB_CAMGROUP_ADD,IDB_CAMGROUP_ADD); m_butAdd.ShowWindow(SW_SHOW); //CBitmapButton* m_butDel = new CBitmapButton ; m_butDel.Create(NULL, dwStyle, CRect(50, ll_y, 74, ll_y+24) ,this ,IDC_BUT_DEL); m_butDel.LoadBitmaps(IDB_CAMGROUP_DEL, IDB_CAMGROUP_DEL, IDB_CAMGROUP_DEL,IDB_CAMGROUP_DEL_DIS); m_butDel.ShowWindow(SW_SHOW); //CBitmapButton* m_butMod = new CBitmapButton ; m_butMod.Create(NULL, dwStyle, CRect(80, ll_y, 104, ll_y+24) ,this , IDC_BUT_MOD); m_butMod.LoadBitmaps(IDB_CAMGROUP_EDIT, IDB_CAMGROUP_EDIT, IDB_CAMGROUP_EDIT,IDB_CAMGROUP_EDIT_DIS); m_butMod.ShowWindow(SW_SHOW); //Create columns for server LV_COLUMN ListColumn; WCHAR * ListTitles[3] = {_T("SMTP Server"), _T("User Name"), _T("Password")}; int ll_colw=176; for(int i = 0; i < 3; i++) { ListColumn.mask = LVCF_FMT | LVCF_SUBITEM | LVCF_TEXT | LVCF_WIDTH; ListColumn.fmt = LVCFMT_LEFT; ListColumn.iSubItem = i; {ListColumn.cx = ll_colw;} ListColumn.pszText = ListTitles[i]; pServerList->InsertColumn(i, &ListColumn); } //Create columns for email WCHAR * ListTit[1] = {_T("Email Address")}; ll_colw=530; ListColumn.mask = LVCF_FMT | LVCF_SUBITEM | LVCF_TEXT | LVCF_WIDTH; ListColumn.fmt = LVCFMT_LEFT; ListColumn.iSubItem = 0; ListColumn.cx = ll_colw; ListColumn.pszText = ListTit[0]; pEmailList->InsertColumn(0, &ListColumn); /*--Microhelp on buttons--*/ m_ToolTip= new CToolTipCtrl(); m_ToolTip->Create(this); CString ls_st; //string table LOADSTRING(ls_st, IDS_TOOL_ADD_SMTP_SERVER); //ls_st.LoadString(CGS::g_hResStr, IDS_TOOL_ADD_SMTP_SERVER); m_ToolTip->AddTool(&m_butSAdd,ls_st); LOADSTRING(ls_st, IDS_TOOL_DEL_SMTP_SERVER); //ls_st.LoadString(CGS::g_hResStr, IDS_TOOL_DEL_SMTP_SERVER); m_ToolTip->AddTool(&m_butSDel,ls_st); LOADSTRING(ls_st, IDS_TOOL_MOD_SMTP_SERVER); //ls_st.LoadString(CGS::g_hResStr, IDS_TOOL_MOD_SMTP_SERVER); m_ToolTip->AddTool(&m_butSMod,ls_st); LOADSTRING(ls_st, IDS_TOOL_ADD_EMAIL_ADDRESS); //ls_st.LoadString(CGS::g_hResStr, IDS_TOOL_ADD_EMAIL_ADDRESS); m_ToolTip->AddTool(&m_butAdd,ls_st); LOADSTRING(ls_st, IDS_TOOL_DEL_EMAIL_ADDRESS); //ls_st.LoadString(CGS::g_hResStr, IDS_TOOL_DEL_EMAIL_ADDRESS); m_ToolTip->AddTool(&m_butDel,ls_st); LOADSTRING(ls_st, IDS_TOOL_MOD_EMAIL_ADDRESS); //ls_st.LoadString(CGS::g_hResStr, IDS_TOOL_MOD_EMAIL_ADDRESS); m_ToolTip->AddTool(&m_butMod,ls_st); //m_ToolTip->AddTool(&m_butSAdd,_T("Add New SMTP Server")); //m_ToolTip->AddTool(&m_butSDel,_T("Delete SMTP Server")); //m_ToolTip->AddTool(&m_butSMod,_T("Modify SMTP Server")); //m_ToolTip->AddTool(&m_butAdd,_T("Add new email address")); //m_ToolTip->AddTool(&m_butDel,_T("Delete email address")); //m_ToolTip->AddTool(&m_butMod,_T("Modify Email Server")); m_ToolTip->Activate(TRUE); }