本文整理汇总了C++中EnableDlgItem函数的典型用法代码示例。如果您正苦于以下问题:C++ EnableDlgItem函数的具体用法?C++ EnableDlgItem怎么用?C++ EnableDlgItem使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了EnableDlgItem函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoDataExchange
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);
}
示例2: EnableDlgItem
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;
}
示例3: switch
/**
* @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;
}
示例4: EnableDlgItem
/**
* @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;
}
示例5: RebuildGroupCombo
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);
}
}
示例6: EnableDlgItem
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());
}
示例7: IsShellExtensionRegistered
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));
}
示例8: EnableDlgItem
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);
}
示例9: EnableDlgItem
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();;
}
示例10: EnableDlgItem
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;
}
示例11: OnChangeAutoExec
/*------------------------------------------------
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;
}
}
示例12: switch
/**
* @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;
}
示例13: OnCheckColor
/*---------------------------------------------------
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);
}
示例14: OnDelAutoExec
/*------------------------------------------------
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;
}
}
}
示例15: OnApply
/*------------------------------------------------
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
}