void MainDialog::OnUpdateOption(UINT, int, HWND) { DoDataExchange(true); bool my = (m_format == 0 || m_format == 1); EnableDlgItem(IDC_OPT_COMPRESS, my); EnableDlgItem(IDC_OPT_COMPRESS_FULL, my && m_compress); }
LRESULT MainDialog::OnFinishConvert(UINT, WPARAM wp, LPARAM) { EnableDlgItem(IDC_XML, true); EnableDlgItem(IDC_XML_BROWSE, true); EnableDlgItem(IDC_OUT_IMPORT, true); EnableDlgItem(IDC_OUT_MYSQL, true); EnableDlgItem(IDC_OUT_PSQL7, true); EnableDlgItem(IDC_OUT_PSQL8, true); EnableDlgItem(IDC_OPT_NOTEXT, true); EnableDlgItem(IDC_OUTDIR, true); EnableDlgItem(IDC_OUTDIR_BROWSE, true); EnableDlgItem(IDC_START, true); OnUpdateOption(0, 0, 0); m_converting = false; SetWindowText(RString(IDS_APP_TITLE)); if(!m_abort) { m_csStderr.Lock(); if(wp == 0) { if(m_errbuff.IsEmpty()) { MessageBox(RString(IDS_COMPLETE), MB_ICONINFORMATION); } else { RString mesg(IDS_COMPLETE_WARNING); MessageBox(mesg + m_errbuff, MB_ICONINFORMATION); } } else { MessageBox(m_errbuff, MB_ICONEXCLAMATION); } m_csStderr.Unlock(); } m_abort = false; return 0; }
/** * @brief Handle dialog messages. * @param [in] hDlg Handle to the dialog. * @param [in] iMsg The message. * @param [in] wParam The command in the message. * @param [in] lParam The optional parameter for the command. * @return TRUE if the message was handled, FALSE otherwise. */ INT_PTR CopyDlg::DlgProc(HWindow* pDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch (uMsg) { case WM_INITDIALOG: return OnInitDialog(pDlg); case WM_COMMAND: switch (wParam) { case IDOK: if (Apply(pDlg)) { case IDCANCEL: pDlg->EndDialog(wParam); } return TRUE; case IDC_COPY_OFFSET: case IDC_COPY_BYTES: EnableDlgItem(pDlg, IDC_COPY_OFFSETEDIT, pDlg->IsDlgButtonChecked(IDC_COPY_OFFSET)); EnableDlgItem(pDlg, IDC_COPY_BYTECOUNT, pDlg->IsDlgButtonChecked(IDC_COPY_BYTES)); return TRUE; } break; case WM_HELP: OnHelp(pDlg); break; } return FALSE; }
/** * @brief Initialize the dialog. * @param [in] hDlg Handle to dialog. * @return TRUE. */ BOOL PasteDlg::OnInitDialog(HWindow *pDlg) { if (bSelected) // iPasteMode = 0 { EnableDlgItem(pDlg, IDC_PASTE_OVERWRITE, FALSE); EnableDlgItem(pDlg, IDC_PASTE_INSERT, FALSE); } else if (bInsertMode) // iPasteMode = 2 { pDlg->CheckDlgButton(IDC_PASTE_INSERT, BST_CHECKED); } else // iPasteMode = 1 { pDlg->CheckDlgButton(IDC_PASTE_OVERWRITE, BST_CHECKED); } pDlg->SendDlgItemMessage(IDC_PASTE_CLIPBOARD, WM_PASTE); pDlg->SetDlgItemInt(IDC_PASTE_TIMES, iPasteTimes); pDlg->SetDlgItemInt(IDC_PASTE_SKIPBYTES, iPasteSkip); if (bPasteAsText) pDlg->CheckDlgButton(IDC_PASTE_BINARY, BST_CHECKED); else pDlg->CheckDlgButton(IDC_PASTE_BINARY, BST_UNCHECKED); // Limit edit text lengths pDlg->SendDlgItemMessage(IDC_PASTE_TIMES, EM_SETLIMITTEXT, 16, 0); pDlg->SendDlgItemMessage(IDC_PASTE_SKIPBYTES, EM_SETLIMITTEXT, 16, 0); return TRUE; }
static void RebuildGroupCombo(HWND hwndDlg) { int bHasGroups = pcli->pfnGetGroupName(0, NULL) != 0; HWND hGroupsCombo = GetDlgItem(hwndDlg, IDC_GROUPS); if (bHasGroups) { int curs = SendMessage(hGroupsCombo, CB_GETCURSEL, 0, 0); TCHAR* curst; EnableDlgItem(hwndDlg, IDC_ENABLEGROUPS, TRUE); EnableGroupCombo(hwndDlg); if (curs != CB_ERR) { curst = (TCHAR*)_alloca((SendMessage(hGroupsCombo, CB_GETLBTEXTLEN, curs, 0) + 1) * sizeof(TCHAR)); SendMessage(hGroupsCombo, CB_GETLBTEXT, curs, (LPARAM)curst); } SendMessage(hGroupsCombo, CB_RESETCONTENT, 0, 0); TCHAR *szGroup; for (int i=1; (szGroup = pcli->pfnGetGroupName(i, NULL)) != NULL; i++) { int nIndex = SendMessage(hGroupsCombo, CB_ADDSTRING, 0, (LPARAM)szGroup); SendMessage(hGroupsCombo, CB_SETITEMDATA, nIndex, i); } if (curs != CB_ERR) SendMessage(hGroupsCombo, CB_SELECTSTRING, -1, (LPARAM)curst); else SendMessage(hGroupsCombo, CB_SETCURSEL, 0, 0); } else { // no groups available EnableDlgItem(hwndDlg, IDC_ENABLEGROUPS, FALSE); EnableDlgItem(hwndDlg, IDC_GROUPS, FALSE); } }
void CProgramGuideToolbarOptions::UpdateItemState() { int Sel=m_ItemListView.GetSelectedItem(); EnableDlgItem(m_hDlg,IDC_PROGRAMGUIDETOOLBAR_ITEMLIST_UP,Sel>0); EnableDlgItem(m_hDlg,IDC_PROGRAMGUIDETOOLBAR_ITEMLIST_DOWN, Sel>=0 && Sel+1<m_ItemListView.GetItemCount()); }
void PropShell::UpdateButtons() { bool registered = IsShellExtensionRegistered(); EnableDlgItem(IDC_EXPLORER_CONTEXT, registered); EnableDlgItem(IDC_REGISTER_SHELLEXTENSION, !registered); EnableDlgItem(IDC_UNREGISTER_SHELLEXTENSION, registered); EnableDlgItem(IDC_EXPLORER_ADVANCED, registered && IsDlgButtonChecked(IDC_EXPLORER_CONTEXT)); }
void CMenuOptions::SetDlgItemState(HWND hDlg) { HWND hwndList=::GetDlgItem(hDlg,IDC_MENUOPTIONS_ITEMLIST); int Sel=ListView_GetNextItem(hwndList,-1,LVNI_SELECTED); EnableDlgItem(hDlg,IDC_MENUOPTIONS_ITEMLIST_UP,Sel>0); EnableDlgItem(hDlg,IDC_MENUOPTIONS_ITEMLIST_DOWN,Sel>=0 && Sel+1<ListView_GetItemCount(hwndList)); EnableDlgItem(hDlg,IDC_MENUOPTIONS_ITEMLIST_INSERTSEPARATOR,Sel>=0); EnableDlgItem(hDlg,IDC_MENUOPTIONS_ITEMLIST_REMOVESEPARATOR, Sel>=0 && GetListViewItemParam(hwndList,Sel)==MENU_ID_SEPARATOR); }
BOOL CPublishPrefs::InitDialog() { // Composer/Publishing Preferences EnableDlgItem(IDC_AUTOADJUST_LINKS, !PREF_PrefIsLocked("editor.publish_keep_links")); EnableDlgItem(IDC_KEEP_IMAGE_WITH_DOC, !PREF_PrefIsLocked("editor.publish_keep_images")); EnableDlgItem(IDC_PUBLISH_FTP, !PREF_PrefIsLocked("editor.publish_location")); EnableDlgItem(IDC_PUBLISH_HTTP, !PREF_PrefIsLocked("editor.publish_browse_location")); return CEditorPropertyPage::InitDialog();; }
LRESULT COpenView::OnUpdateStatus(WPARAM wParam, LPARAM lParam) { bool bEnabledButtons = wParam != 0; EnableDlgItem(IDOK, bEnabledButtons); EnableDlgItem(IDC_UNPACKER_EDIT, bEnabledButtons); EnableDlgItem(IDC_SELECT_UNPACKER, bEnabledButtons); SetStatus(HIWORD(lParam)); SetStatus(LOWORD(lParam)); return 0; }
/*------------------------------------------------ selected an alarm name by combobox --------------------------------------------------*/ void OnChangeAutoExec(HWND hDlg) { PAUTOEXECSTRUCT pAS; int index; index = CBGetCurSel(hDlg, IDC_COMBOAUTOEXEC); if(curAutoExec >= 0 && index == curAutoExec) return; if(curAutoExec < 0) { char name[40]; GetDlgItemText(hDlg, IDC_COMBOAUTOEXEC, name, 40); if(name[0] && IsDlgButtonChecked(hDlg, IDC_AUTOEXEC)) { pAS = malloc(sizeof(AUTOEXECSTRUCT)); if(pAS) { int index; GetAutoExecFromDlg(hDlg, pAS); index = CBAddString(hDlg, IDC_COMBOAUTOEXEC, (LPARAM)pAS->name); CBSetItemData(hDlg, IDC_COMBOAUTOEXEC, index, (LPARAM)pAS); curAutoExec = index; //リスト項目の表示数を指定 AdjustDlgConboBoxDropDown(hDlg, IDC_COMBOAUTOEXEC, 7); } } } else { pAS = (PAUTOEXECSTRUCT)CBGetItemData(hDlg, IDC_COMBOAUTOEXEC, curAutoExec); if(pAS) GetAutoExecFromDlg(hDlg, pAS); } pAS = (PAUTOEXECSTRUCT)CBGetItemData(hDlg, IDC_COMBOAUTOEXEC, index); if(pAS) { SetAutoExecToDlg(hDlg, pAS); EnableDlgItem(hDlg, IDC_DELAUTOEXEC, TRUE); curAutoExec = index; } else { AUTOEXECSTRUCT as; memset(&as, 0, sizeof(as)); as.hour = 0xffffff; as.days = 0x7f; SetAutoExecToDlg(hDlg, &as); EnableDlgItem(hDlg, IDC_DELAUTOEXEC, FALSE); curAutoExec = -1; } }
/** * @brief Handle dialog messages. * @param [in] hDlg Handle to the dialog. * @param [in] iMsg The message. * @param [in] wParam The command in the message. * @param [in] lParam The optional parameter for the command. * @return TRUE if the message was handled, FALSE otherwise. */ INT_PTR OpenPartiallyDlg::DlgProc(HWindow* pDlg, UINT iMsg, WPARAM wParam, LPARAM lParam) { switch (iMsg) { case WM_INITDIALOG: return OnInitDialog(pDlg); case WM_COMMAND: switch (wParam) { case IDOK: if (Apply(pDlg)) { case IDCANCEL: pDlg->EndDialog(wParam); } return TRUE; case IDC_OPENPARTIAL_BEGINOFF: case IDC_OPENPARTIAL_ENDBYTES: EnableDlgItem(pDlg, IDC_OPENPARTIAL_OFFSET, pDlg->IsDlgButtonChecked(IDC_OPENPARTIAL_BEGINOFF)); return TRUE; } break; case WM_HELP: OnHelp(pDlg); break; } return FALSE; }
BOOL CEditorPrefs2::InitDialog() { // Composer/Publishing Preferences EnableDlgItem(IDC_PAGEUPDOWN, !PREF_PrefIsLocked("editor.page_updown_move_cursor")); return CEditorPropertyPage::InitDialog();; }
/*--------------------------------------------------- enable/disable to use "background" / "background 2" -----------------------------------------------------*/ void OnCheckColor(HWND hDlg) { HWND hwnd; BOOL b1, b2; b1 = IsDlgButtonChecked(hDlg, IDC_CHKCOLOR); hwnd = GetWindow(GetDlgItem(hDlg, IDC_CHKCOLOR), GW_HWNDNEXT); while(hwnd) { EnableWindow(hwnd, b1); if(hwnd == GetDlgItem(hDlg, IDC_CHKCOLOR2)) break; hwnd = GetWindow(hwnd, GW_HWNDNEXT); } b2 = IsDlgButtonChecked(hDlg, IDC_CHKCOLOR2); hwnd = GetWindow(GetDlgItem(hDlg, IDC_CHKCOLOR2), GW_HWNDNEXT); while(hwnd) { EnableWindow(hwnd, b1 && b2); if(hwnd == GetDlgItem(hDlg, IDC_GRAD2)) break; hwnd = GetWindow(hwnd, GW_HWNDNEXT); } EnableDlgItem(hDlg, IDC_FILLTRAY, b1); }
/*------------------------------------------------ delete an alarm --------------------------------------------------*/ void OnDelAutoExec(HWND hDlg) { PAUTOEXECSTRUCT pAS; if(curAutoExec < 0) return; pAS = (PAUTOEXECSTRUCT)CBGetItemData(hDlg, IDC_COMBOAUTOEXEC, curAutoExec); if(pAS) { PostMessage(hDlg, WM_NEXTDLGCTL, 1, FALSE); CBDeleteString(hDlg, IDC_COMBOAUTOEXEC, curAutoExec); free(pAS); if(curAutoExec > 0) curAutoExec--; CBSetCurSel(hDlg, IDC_COMBOAUTOEXEC, curAutoExec); pAS = (PAUTOEXECSTRUCT)CBGetItemData(hDlg, IDC_COMBOAUTOEXEC, curAutoExec); if(pAS) SetAutoExecToDlg(hDlg, pAS); else { AUTOEXECSTRUCT as; memset(&as, 0, sizeof(as)); as.hour = 0xffffff; as.days = 0x7f; SetAutoExecToDlg(hDlg, &as); EnableDlgItem(hDlg, IDC_DELAUTOEXEC, FALSE); curAutoExec = -1; } } }
/*------------------------------------------------ apply - save settings --------------------------------------------------*/ void OnApply(HWND hDlg) { int i, count, n_autoexec; PAUTOEXECSTRUCT pAS; n_autoexec = 0; if(curAutoExec < 0) { char name[40]; GetDlgItemText(hDlg, IDC_COMBOAUTOEXEC, name, 40); if(name[0] && IsDlgButtonChecked(hDlg, IDC_AUTOEXEC)) { pAS = malloc(sizeof(AUTOEXECSTRUCT)); if(pAS) { int index; GetAutoExecFromDlg(hDlg, pAS); index = CBAddString(hDlg, IDC_COMBOAUTOEXEC, (LPARAM)pAS->name); CBSetItemData(hDlg, IDC_COMBOAUTOEXEC, index, (LPARAM)pAS); curAutoExec = index; CBSetCurSel(hDlg, IDC_COMBOAUTOEXEC, index); EnableDlgItem(hDlg, IDC_DELAUTOEXEC, TRUE); } } } else { pAS = (PAUTOEXECSTRUCT)CBGetItemData(hDlg, IDC_COMBOAUTOEXEC, curAutoExec); if(pAS) GetAutoExecFromDlg(hDlg, pAS); } count = CBGetCount(hDlg, IDC_COMBOAUTOEXEC); for(i = 0; i < count; i++) { PAUTOEXECSTRUCT pAS; pAS = (PAUTOEXECSTRUCT)CBGetItemData(hDlg, IDC_COMBOAUTOEXEC, i); if(pAS) { SaveAutoExecToReg(pAS, n_autoexec); n_autoexec++; } } for(i = n_autoexec; ; i++) { char subkey[20]; wsprintf(subkey, "AutoExec%d", i + 1); if(GetMyRegLong(subkey, "Hour", -1) >= 0) DelMyRegKey(subkey); else break; } SetMyRegLong("", "AutoExecNum", n_autoexec); InitAlarm(); // alarm.c }
/** * @brief Called when item state is changed. * * Disable Edit-button when "None" filter is selected. * @param [in] pNMHDR Listview item data. * @param [out] pResult Result of the action is returned in here. */ void FileFiltersDlg::OnLvnItemchangedFilterfileList(NMHDR *pNMHDR, LRESULT *pResult) { LPNMLISTVIEW pNMLV = reinterpret_cast<LPNMLISTVIEW>(pNMHDR); // If item got selected if (pNMLV->uNewState & LVIS_SELECTED) { String txtNone = theApp.LoadString(IDS_USERCHOICE_NONE); CString txt = m_listFilters.GetItemText(pNMLV->iItem, 0); bool isNone = txt.CompareNoCase(txtNone.c_str()) == 0; EnableDlgItem(this, IDC_FILTERFILE_TEST_BTN, !isNone); EnableDlgItem(this, IDC_FILTERFILE_EDITBTN, !isNone); EnableDlgItem(this, IDC_FILTERFILE_DELETEBTN, !isNone); } *pResult = 0; }
/*------------------------------------------------ "User string" is checked --------------------------------------------------*/ void OnUserStr(HWND hDlg) { BOOL b; b = IsDlgButtonChecked(hDlg, IDC_SHOWUSTR); if(!IsDlgButtonChecked(hDlg, IDC_SHOWTIME)) b = FALSE; if(!m_pTimer) b = FALSE; EnableDlgItem(hDlg, IDC_SHOWUSTRNUM, b); }
int TSendContactsData::SendContactsPacket(HWND hwndDlg, HANDLE *phContacts, int nContacts) { HANDLE hProcc = (HANDLE)CallContactService(hContact, PSS_CONTACTS, MAKEWPARAM(0, nContacts), (LPARAM)phContacts); if (!hProcc) { // on trivial error - do not close dialog ShowErrorDlg(hwndDlg, "Contacts transfer failed!", FALSE); return FALSE; // Failure } TAckData *ackData = gaAckData.Add(hProcc, new TAckData(hContact)); uacklist.Add(hProcc); ackData->nContacts = nContacts; ackData->aContacts = (HANDLE*)mir_alloc(nContacts*sizeof(HANDLE)); memmove(ackData->aContacts, phContacts, nContacts*sizeof(HANDLE)); // copy the array of hContact for ack array EnableDlgItem(hwndDlg, IDOK, FALSE); EnableDlgItem(hwndDlg, IDC_LIST, FALSE); return TRUE; // Success }
static void RebuildGroupCombo(HWND hwndDlg) { DBVARIANT dbv = {0}; char caGroupId[33]; int bHasGroups = !DBGetContactSettingT(NULL, "CListGroups", "0", &dbv); HWND hGroupsCombo = GetDlgItem(hwndDlg, IDC_GROUPS); DBFreeVariant(&dbv); if (bHasGroups) { int curs = SendMessageT(hGroupsCombo, CB_GETCURSEL, 0, 0); TCHAR* curst; EnableDlgItem(hwndDlg, IDC_ENABLEGROUPS, TRUE); EnableGroupCombo(hwndDlg); if (curs != CB_ERR) { curst = (char*)_malloca((SendMessageT(hGroupsCombo, CB_GETLBTEXTLEN, curs, 0) + 1) * sizeof(WCHAR)); SendMessageT(hGroupsCombo, CB_GETLBTEXT, curs, (LPARAM)curst); } SendMessageT(hGroupsCombo, CB_RESETCONTENT, 0, 0); for (int groupId=0; ; groupId++) { itoa(groupId, caGroupId, 10); TCHAR* szGroup = DBGetContactSettingStringT(NULL, "CListGroups", caGroupId, NULL); int nPrefix = g_UnicodeCore ? sizeof(WCHAR) : sizeof(char); if (!szGroup) break; int nIndex = SendMessageT(hGroupsCombo, CB_ADDSTRING, 0, (LPARAM)szGroup + nPrefix); SendMessageT(hGroupsCombo, CB_SETITEMDATA, nIndex, groupId+1); SAFE_FREE((void**)&szGroup); } if (curs != CB_ERR) SendMessageT(hGroupsCombo, CB_SELECTSTRING, -1, (LPARAM)curst); else SendMessageT(hGroupsCombo, CB_SETCURSEL, 0, 0); } else { // no groups available EnableDlgItem(hwndDlg, IDC_ENABLEGROUPS, FALSE); EnableDlgItem(hwndDlg, IDC_GROUPS, FALSE); } }
void TSendContactsData::ShowErrorDlg(HWND hwndDlg, char* szMsg, bool bAllowRetry) { ShowWindow(hwndDlg, SW_SHOWNORMAL); EnableWindow(hwndDlg, FALSE); if (!hError) { hError = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_MSGSENDERROR), hwndDlg, ErrorDlgProc, (LPARAM)(LPTSTR)_A2T(szMsg)); if (!bAllowRetry) EnableDlgItem(hError, IDOK, FALSE); // do not allow again - fatal, could not be better } }
/*------------------------------------------------ file name changed - enable/disable controls --------------------------------------------------*/ void OnFileChange(HWND hDlg, WORD id) { char fname[MAX_PATH]; BOOL b = FALSE; GetDlgItemText(hDlg, id, fname, MAX_PATH); if(IsWindowEnabled(GetDlgItem(hDlg, id))) b = TRUE; EnableDlgItem(hDlg, id + 3, b); }
/*------------------------------------------------ 定期的にネットワーク確認 --------------------------------------------------*/ void OnCheckNet(HWND hDlg) { BOOL b; int i; b = IsDlgButtonChecked(hDlg, IDC_CHECKNETWORK); for(i = IDC_CHECKNETINTERVAL; i <= IDC_NETCHECKSTATIC; i++) EnableDlgItem(hDlg, i, b); SendPSChanged(hDlg); }
/*------------------------------------------------ 「デスクトップカレンダー」の自動更新 --------------------------------------------------*/ void OnDeskcal(HWND hDlg) { BOOL b; int i; b = IsDlgButtonChecked(hDlg, IDC_DESKCAL); for(i = IDC_LABDESKCAL; i <= IDC_WATCHWALL; i++) EnableDlgItem(hDlg, i, b); SendPSChanged(hDlg); }
BOOL CEditorPrefs::InitDialog() { // Composer preferences EnableDlgItem(IDC_HTML_EDITOR, !PREF_PrefIsLocked("editor.html_editor")); EnableDlgItem(IDC_CHOOSE_HTML_EDITOR, !PREF_PrefIsLocked("editor.html_editor")); EnableDlgItem(IDC_IMAGE_EDITOR, !PREF_PrefIsLocked("editor.image_editor")); EnableDlgItem(IDC_CHOOSE_IMAGE_EDITOR, !PREF_PrefIsLocked("editor.image_editor")); EnableDlgItem(IDC_AUTO_SAVE, !PREF_PrefIsLocked("editor.auto_save")); EnableDlgItem(IDC_AUTO_SAVE_MINUTES, !PREF_PrefIsLocked("editor.auto_save_delay")); EnableDlgItem(IDC_FONTSIZE_MODE, !PREF_PrefIsLocked("editor.fontsize_mode")); EnableDlgItem(IDC_FONTSIZE_MODE2, !PREF_PrefIsLocked("editor.fontsize_mode")); EnableDlgItem(IDC_FONTSIZE_MODE3, !PREF_PrefIsLocked("editor.fontsize_mode")); return CEditorPropertyPage::InitDialog();; }
void SetFindTab(HWND hwndFindDlg, int idx, BOOL fMouseActivated) { int i; HWND hwndPanel; SEARCH_PANE_STATE *sps; TabCtrl_SetCurSel(GetDlgItem(hwndFindDlg, IDC_TAB1), idx); // find the current (new) pane and update is state hwndPanel = g_hwndFindPane[idx]; sps = (SEARCH_PANE_STATE *)GetWindowLongPtr(hwndPanel, GWLP_USERDATA); UpdateFindGui(hwndPanel, sps); // display! SetWindowPos(g_hwndFindPane[idx], HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE|SWP_SHOWWINDOW); // was the mouse used to activate this tab? if(fMouseActivated) { SetDlgItemFocus(hwndPanel, IDC_COMBO1); PostMessage(hwndPanel, WM_NEXTDLGCTL, IDC_COMBO1, TRUE); } // hide any other search-pane for(i = 0; i < MAX_FIND_PANES; i++) { if(i != idx) { DelStyle(g_hwndFindPane[i], WS_VISIBLE); //ShowWindow(g_hwndFindPane[i], SW_HIDE); } } // hide the replace/replaceall buttons if necessary EnableDlgItem(hwndFindDlg, IDC_REPLACE, (BOOL)(idx == 3)); EnableDlgItem(hwndFindDlg, IDC_REPLACEALL, (BOOL)(idx == 3)); SetDlgItemFocus(g_hwndFindPane[idx], IDC_COMBO1); PostMessage(g_hwndFindPane[idx], WM_NEXTDLGCTL, IDC_COMBO1, TRUE); PostMessage(g_hwndFindPane[idx], WM_COMMAND, MAKEWPARAM(IDC_COMBO1, CBN_EDITUPDATE), 0); }
BOOL CDownDlg::OnInitDialog(HWND hCtrlFocus, LPARAM lParam, BOOL& bHandled) { m_edtInfo = GetDlgItem(IDC_EDIT_INFO); EnableDlgItem(IDC_BTN_DOWNLOAD, FALSE); TCHAR szDefault[MAX_PATH]; GetModuleFileName(NULL, szDefault, MAX_PATH); *_tcsrchr(szDefault, _T('\\')) = _T('\0'); return TRUE; }
/** \brief Loads or synchronizes updater checkboxes (disable beta checkbox if release isn't set) * \param hDlg * \param state either \c 0 to load from registry or \c 1 to synchronize * \c IDC_UPDATE_BETA with current state of \c IDC_UPDATE_RELEASE */ static void SetUpdateChecks(HWND hDlg, int state/* = 0*/) { if(state == 0) { state = api.GetInt(L"",UPDATE_BETA,0) ? 1 : 0; CheckDlgButton(hDlg, IDC_UPDATE_BETA, state); state = api.GetInt(L"",UPDATE_RELEASE,1) ? 1 : 0; CheckDlgButton(hDlg, IDC_UPDATE_RELEASE, state); } else { state = IsDlgButtonChecked(hDlg, IDC_UPDATE_RELEASE); } EnableDlgItem(hDlg, IDC_UPDATE_BETA, state); }
/*------------------------------------------------ "Show elasped time" is checked --------------------------------------------------*/ void OnShowTime(HWND hDlg) { BOOL b; int i; b = IsDlgButtonChecked(hDlg, IDC_SHOWTIME); for(i = IDC_SHOWWHOLE; i <= IDC_SHOWUSTRNUM; i++) EnableDlgItem(hDlg, i, b); OnUserStr(hDlg); }
/** * @brief Enable / disable color controls on dialog. * @param [in] bEnable If `true` color controls are enabled. */ void PropTextColors::EnableColorButtons(bool bEnable) { EnableDlgItem(IDC_CUSTOM_COLORS_GROUP, bEnable); EnableDlgItem(IDC_WHITESPACE_COLOR_LABEL, bEnable); EnableDlgItem(IDC_TEXT_COLOR_LABEL, bEnable); EnableDlgItem(IDC_SELECTION_COLOR_LABEL, bEnable); EnableDlgItem(IDC_MARGIN_COLOR_LABEL, bEnable); EnableDlgItem(IDC_BACKGROUND_COLUMN_LABEL, bEnable); EnableDlgItem(IDC_TEXT_COLUMN_LABEL, bEnable); }