本文整理汇总了C++中SetDlgItemInt函数的典型用法代码示例。如果您正苦于以下问题:C++ SetDlgItemInt函数的具体用法?C++ SetDlgItemInt怎么用?C++ SetDlgItemInt使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SetDlgItemInt函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _ExIf
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// 命令处理
VOID COpenDlg::OnCommand(WPARAM wParam, LPARAM lParam)
{
INT i;
RECT rtRect;
BOOL bPreview;
PUINT puValue;
const UINT c_uFormats[][2] =
{
{352, 288}, {176, 144}, {128, 96},
{320, 240}, {160, 120},
{640, 480}, {320, 240}, {160, 120},
{352, 240}, {352, 288},
{720, 480}, {720, 576},
};
_ExIf((HWND) lParam == m_hToolbar, SetFocus(m_hToolbar));
switch (LOWORD(wParam))
{
case IDC_Open_MulSignText:
if (m_hFormatMenu == NULL)
{
m_hFormatMenu = LoadMenu(g_hInst, MAKEINTRESOURCE(IDR_Menu_Format));
}
GetWindowRect(GetDlgItem(m_hWnd, IDC_Open_MulSignText), &rtRect);
TrackPopupMenu(GetSubMenu(m_hFormatMenu, 0), TPM_TOPALIGN, rtRect.left, rtRect.top, 0, m_hWnd, NULL);
break;
case IDM_Format_CIF:
case IDM_Format_QCIF:
case IDM_Format_SUBQCIF:
case IDM_Format_SIF:
case IDM_Format_QSIF:
case IDM_Format_VGA:
case IDM_Format_QVGA:
case IDM_Format_QQVGA:
case IDM_Format_VCDNTSC:
case IDM_Format_VCDPAL:
case IDM_Format_DVDNTSC:
case IDM_Format_DVDPAL:
i = LOWORD(wParam) - IDM_Format_CIF;
SetDlgItemInt(m_hWnd, IDC_Open_Width, c_uFormats[i][0], FALSE);
SetDlgItemInt(m_hWnd, IDC_Open_Height, c_uFormats[i][1], TRUE);
OnCommand(MAKELONG(IDC_Open_Width, EN_KILLFOCUS));
OnCommand(MAKELONG(IDC_Open_Height, EN_KILLFOCUS));
break;
case IDC_Open_Preview:
// 切换预览
if (HIWORD(wParam) == BN_CLICKED)
{
IsPreviewChecked() ? InvalidateRect(m_hWnd, &m_rtPreview, TRUE) : m_pWnd->Stop();
OnCommand(IDC_RawVideo_Seek);
}
break;
case IDC_Open_Width:
case IDC_Open_Height:
case IDC_Open_FrameRate:
case IDC_Open_FrameStep:
if (HIWORD(wParam) == EN_KILLFOCUS)
{
switch (LOWORD(wParam))
{
case IDC_Open_Width:
puValue = &m_riFormat.m_uWidth;
break;
case IDC_Open_Height:
puValue = (PUINT) &m_riFormat.m_iHeight;
break;
case IDC_Open_FrameRate:
puValue = &m_riFormat.m_uFrameRate;
break;
case IDC_Open_FrameStep:
puValue = (PUINT) &m_riFormat.m_iFrameStep;
break;
}
// 限制尺寸范围
*puValue = GetDlgItemInt(m_hWnd, LOWORD(wParam), NULL, TRUE);
m_pWnd->Open(m_pWnd->m_tzFileName, &m_riFormat);
SetDlgItemInt(m_hWnd, LOWORD(wParam), *puValue, TRUE);
}
break;
case IDM_Play_Play:
m_pWnd->TogglePlay();
break;
case IDM_Play_GotoStart:
m_pWnd->Stop();
m_pWnd->Seek(0);
break;
case IDM_Play_GotoEnd:
m_pWnd->Stop();
//.........这里部分代码省略.........
示例2: se
BOOL CAdaptiveDlg::UpdateDataPlus(BOOL bSaveAndValidate)
{
char buffer[128];
CString s, se("Existing value will be used.");
double out[2], xf[2];
int i, m[4], x[2], right;
CButton *hRadio;
UpdateData(bSaveAndValidate);
if (!bSaveAndValidate)
{
sprintfFloat(adap.stepsize[0], 4, buffer, sizeof(buffer));
s = buffer;
SetDlgItemText (IDC_STEP1, s);
sprintfFloat(adap.stepsize[1], 4, buffer, sizeof(buffer));
s = buffer;
SetDlgItemText (IDC_STEP2, s);
SetDlgItemInt(IDC_REVERSALS1, adap.reversal[0]);
SetDlgItemInt(IDC_REVERSALS2, adap.reversal[1]);
SetDlgItemInt(IDC_DOWN, adap.down);
SetDlgItemInt(IDC_UP, adap.up);
sprintfFloat(adap.initialPt, 3, buffer, sizeof(buffer));
s = buffer;
SetDlgItemText (IDC_INIT_VAL, s);
SetDlgItemInt(IDC_FINAL_REV_4AVG, adap.finalRev4Avg);
if (adap.descending)
{
hRadio = (CButton *)GetDlgItem(IDC_ASCENDING);
hRadio->SetCheck(0);
hRadio = (CButton *)GetDlgItem(IDC_DESCENDING);
hRadio->SetCheck(1);
}
else
{
hRadio = (CButton *)GetDlgItem(IDC_ASCENDING);
hRadio->SetCheck(1);
hRadio = (CButton *)GetDlgItem(IDC_DESCENDING);
hRadio->SetCheck(0);
}
hRadio = (CButton *)GetDlgItem(IDC_FACTOR);
if (adap.factor) hRadio->SetCheck(1);
else hRadio->SetCheck(0);
OnUpdateInitVal();
}
else
{
hRadio = (CButton*)GetDlgItem(IDC_DESCENDING);
adap.descending = (hRadio->GetCheck()) ? 1:0;
//Validation
s = "Stepsize Validation failed.";
CECD(xf[0],IDC_STEP1, s)
CECD(xf[1],IDC_STEP2, s)
s = "reversal Validation failed.";
CECI(x[0],IDC_REVERSALS1, s)
CECI(x[1],IDC_REVERSALS2, s)
s = "Down invalid."; CECI(m[0],IDC_DOWN,s)
s = "Up invalid."; CECI(m[1],IDC_UP,s)
s = "Number of final reversals invalid.";
CECI(m[2],IDC_FINAL_REV_4AVG,s)
GetDlgItemText (IDC_INIT_VAL, buffer, sizeof(buffer));
i=str2array(out, 2, buffer, " ,");
if (i==0) { MessageBox ("Invalid initial value","Existing value will be used."); return FALSE;}
if (i==2)
{
adap.dualSeries=1;
adap2.initialPt = out[1];
}
adap.initialPt = out[0];
hRadio = (CButton *)GetDlgItem(IDC_FACTOR);
adap.factor = (hRadio->GetCheck()==BST_CHECKED);
//Update
adap.down = m[0];
adap.up = m[1];
adap.finalRev4Avg = m[2];
memcpy((void*)adap.stepsize, (void*)xf, sizeof(xf));
memcpy((void*)adap.reversal, (void*)x, sizeof(x));
SyncAdap();
}
return TRUE;
}
示例3: sizeof
//.........这里部分代码省略.........
{
RegSetValueEx(hKey, L"RoamScanFreq", 0, REG_DWORD, (LPBYTE)&m_dwRoamScanFreq, sizeof(m_dwRoamScanFreq) );
}
else
{
m_dwRoamScanFreq = dwData;
}
//
// FullRoamScanInterval
//
dwType = REG_DWORD;
dwDataSize = sizeof(DWORD);
lRet = RegQueryValueEx(hKey, L"FullRoamScanInterval", NULL, &dwType, (LPBYTE)&dwData, &dwDataSize);
if( (lRet != ERROR_SUCCESS) || (dwData<0) )
{
RegSetValueEx(hKey, L"FullRoamScanInterval", 0, REG_DWORD, (LPBYTE)&m_dwFullRoamScanInterval, sizeof(m_dwFullRoamScanInterval) );
}
else
{
m_dwFullRoamScanInterval = dwData;
}
//
// PowerSaveMode
//
dwType = REG_DWORD;
dwDataSize = sizeof(DWORD);
lRet = RegQueryValueEx(hKey, L"PowerSaveMode", NULL, &dwType, (LPBYTE)&dwData, &dwDataSize);
RETAILMSG(1, (TEXT("[NETUI] PowerSaveMode(%d) \r\n"),dwData ));
if( (lRet != ERROR_SUCCESS) || (dwData<0) )
{
m_spinPowerSaveMode.SetPos(DEFAULT_VALUE_POWERSAVEMODE);
dwData = m_spinPowerSaveMode.GetPos();
RegSetValueEx(hKey, L"PowerSaveMode", 0, REG_DWORD, (LPBYTE)&dwData, sizeof(dwData) );
}
else
{
if(dwData != 0 && dwData != 1 && dwData != 2)
{
m_spinPowerSaveMode.SetPos(DEFAULT_VALUE_POWERSAVEMODE);
}
else
{
m_spinPowerSaveMode.SetPos(dwData);
}
}
RegCloseKey(hKey);
}
#if 0 // 현 버전의 USI 드라이버에는 Roam Enable 보는 레지스트리가 잘못 되어있음 (항상 RoamEnable 임)
// Set Data to Controls
if(m_bRoamEnable)
{
CheckDlgButton(IDC_CHECK_ROAM_ENABLE, BST_CHECKED);
}
else
{
CheckDlgButton(IDC_CHECK_ROAM_ENABLE, BST_UNCHECKED);
}
#else
CheckDlgButton(IDC_CHECK_ROAM_ENABLE, BST_CHECKED);
GetDlgItem(IDC_CHECK_ROAM_ENABLE)->EnableWindow(FALSE);
#endif
// 콤보 박스 선택을 위한 비교
for(int i = 0; i< m_comboRoamTrigger.GetCount(); i++)
{
TCHAR tszTemp[32] = L"";
m_comboRoamTrigger.GetLBText(i, tszTemp);
if( _tcscmp(tszTemp, m_strRoamTrigger.GetBuffer(0)) == 0)
{
m_comboRoamTrigger.SetCurSel(i);
break;
}
}
SetDlgItemInt(IDC_EDIT_ROAM_SCANFREQ, m_dwRoamScanFreq);
SetDlgItemInt(IDC_EDIT_ROAM_SCANPRD, m_dwRoamScanPrd);
SetDlgItemInt(IDC_EDIT_ROAM_FULLROAMSCNITV, m_dwFullRoamScanInterval);
}
示例4: EspLoadOtherInfo
NTSTATUS EspLoadOtherInfo(
_In_ HWND hwndDlg,
_In_ PSERVICE_OTHER_CONTEXT Context
)
{
NTSTATUS status = STATUS_SUCCESS;
SC_HANDLE serviceHandle;
ULONG returnLength;
SERVICE_PRESHUTDOWN_INFO preshutdownInfo;
LPSERVICE_REQUIRED_PRIVILEGES_INFO requiredPrivilegesInfo;
SERVICE_SID_INFO sidInfo;
SERVICE_LAUNCH_PROTECTED_INFO launchProtectedInfo;
if (!(serviceHandle = PhOpenService(Context->ServiceItem->Name->Buffer, SERVICE_QUERY_CONFIG)))
return NTSTATUS_FROM_WIN32(GetLastError());
// Preshutdown timeout
if (QueryServiceConfig2(serviceHandle,
SERVICE_CONFIG_PRESHUTDOWN_INFO,
(PBYTE)&preshutdownInfo,
sizeof(SERVICE_PRESHUTDOWN_INFO),
&returnLength
))
{
SetDlgItemInt(hwndDlg, IDC_PRESHUTDOWNTIMEOUT, preshutdownInfo.dwPreshutdownTimeout, FALSE);
Context->PreshutdownTimeoutValid = TRUE;
}
// Required privileges
if (requiredPrivilegesInfo = PhQueryServiceVariableSize(serviceHandle, SERVICE_CONFIG_REQUIRED_PRIVILEGES_INFO))
{
PWSTR privilege;
ULONG privilegeLength;
INT lvItemIndex;
PH_STRINGREF privilegeSr;
PPH_STRING privilegeString;
PPH_STRING displayName;
privilege = requiredPrivilegesInfo->pmszRequiredPrivileges;
if (privilege)
{
while (TRUE)
{
privilegeLength = (ULONG)PhCountStringZ(privilege);
if (privilegeLength == 0)
break;
privilegeString = PhCreateStringEx(privilege, privilegeLength * sizeof(WCHAR));
PhAddItemList(Context->PrivilegeList, privilegeString);
lvItemIndex = PhAddListViewItem(Context->PrivilegesLv, MAXINT, privilege, privilegeString);
privilegeSr.Buffer = privilege;
privilegeSr.Length = privilegeLength * sizeof(WCHAR);
if (PhLookupPrivilegeDisplayName(&privilegeSr, &displayName))
{
PhSetListViewSubItem(Context->PrivilegesLv, lvItemIndex, 1, displayName->Buffer);
PhDereferenceObject(displayName);
}
privilege += privilegeLength + 1;
}
}
ExtendedListView_SortItems(Context->PrivilegesLv);
PhFree(requiredPrivilegesInfo);
Context->RequiredPrivilegesValid = TRUE;
}
// SID type
if (QueryServiceConfig2(serviceHandle,
SERVICE_CONFIG_SERVICE_SID_INFO,
(PBYTE)&sidInfo,
sizeof(SERVICE_SID_INFO),
&returnLength
))
{
PhSelectComboBoxString(GetDlgItem(hwndDlg, IDC_SIDTYPE),
EspGetServiceSidTypeString(sidInfo.dwServiceSidType), FALSE);
Context->SidTypeValid = TRUE;
}
// Launch protected
if (QueryServiceConfig2(serviceHandle,
SERVICE_CONFIG_LAUNCH_PROTECTED,
(PBYTE)&launchProtectedInfo,
sizeof(SERVICE_LAUNCH_PROTECTED_INFO),
&returnLength
))
{
PhSelectComboBoxString(GetDlgItem(hwndDlg, IDC_PROTECTION),
EspGetServiceLaunchProtectedString(launchProtectedInfo.dwLaunchProtected), FALSE);
Context->LaunchProtectedValid = TRUE;
//.........这里部分代码省略.........
示例5: switch
//.........这里部分代码省略.........
bool bUseQSV = AppConfig->GetInt(TEXT("Video Encoding"), TEXT("UseQSV")) != 0;
SendMessage(GetDlgItem(hwnd, IDC_USEQSV), BM_SETCHECK, bUseQSV ? BST_CHECKED : BST_UNCHECKED, 0);
bool bQSVUseVideoEncoderSettings = AppConfig->GetInt(TEXT("Video Encoding"), TEXT("QSVUseVideoEncoderSettings")) != 0;
SendMessage(GetDlgItem(hwnd, IDC_QSVUSEVIDEOENCODERSETTINGS), BM_SETCHECK, bQSVUseVideoEncoderSettings ? BST_CHECKED : BST_UNCHECKED, 0);
ti.lpszText = (LPWSTR)Str("Settings.Advanced.QSVUseVideoEncoderSettingsTooltip");
ti.uId = (UINT_PTR)GetDlgItem(hwnd, IDC_QSVUSEVIDEOENCODERSETTINGS);
SendMessage(hwndToolTip, TTM_ADDTOOL, 0, (LPARAM)&ti);
EnableWindow(GetDlgItem(hwnd, IDC_QSVUSEVIDEOENCODERSETTINGS), bHasQSV && bUseQSV);
//------------------------------------
bool bSyncToVideoTime = AppConfig->GetInt(TEXT("Audio"), TEXT("SyncToVideoTime")) != 0;
SendMessage(GetDlgItem(hwnd, IDC_SYNCTOVIDEOTIME), BM_SETCHECK, bSyncToVideoTime ? BST_CHECKED : BST_UNCHECKED, 0);
//------------------------------------
bool bUseMicQPC = GlobalConfig->GetInt(TEXT("Audio"), TEXT("UseMicQPC")) != 0;
SendMessage(GetDlgItem(hwnd, IDC_USEMICQPC), BM_SETCHECK, bUseMicQPC ? BST_CHECKED : BST_UNCHECKED, 0);
//------------------------------------
int bufferTime = GlobalConfig->GetInt(TEXT("General"), TEXT("SceneBufferingTime"), 400);
int globalAudioTimeAdjust = GlobalConfig->GetInt(TEXT("Audio"), TEXT("GlobalAudioTimeAdjust"));
SendMessage(GetDlgItem(hwnd, IDC_AUDIOTIMEADJUST), UDM_SETRANGE32, -bufferTime, 1000);
SendMessage(GetDlgItem(hwnd, IDC_AUDIOTIMEADJUST), UDM_SETPOS32, 0, globalAudioTimeAdjust);
//------------------------------------
int lowLatencyFactor = AppConfig->GetInt(TEXT("Publish"), TEXT("LatencyFactor"), 20);
SetDlgItemInt(hwnd, IDC_LATENCYTUNE, lowLatencyFactor, TRUE);
int bLowLatencyAutoMethod = AppConfig->GetInt(TEXT("Publish"), TEXT("LowLatencyMethod"), 0);
SendMessage(GetDlgItem(hwnd, IDC_LATENCYMETHOD), BM_SETCHECK, bLowLatencyAutoMethod ? BST_CHECKED : BST_UNCHECKED, 0);
//------------------------------------
MIB_IPADDRTABLE tempTable;
DWORD dwSize = 0;
if (GetIpAddrTable (&tempTable, &dwSize, TRUE) == ERROR_INSUFFICIENT_BUFFER)
{
PMIB_IPADDRTABLE ipTable;
ipTable = (PMIB_IPADDRTABLE)Allocate(dwSize);
if (GetIpAddrTable (ipTable, &dwSize, TRUE) == NO_ERROR)
{
DWORD i;
hwndTemp = GetDlgItem(hwnd, IDC_BINDIP);
SendMessage(hwndTemp, CB_ADDSTRING, 0, (LPARAM)TEXT("Default"));
for (i=0; i < ipTable->dwNumEntries; i++)
{
String strAddress;
DWORD strLength = 32;
// don't allow binding to localhost
if ((ipTable->table[i].dwAddr & 0xFF) == 127)
continue;
strAddress.SetLength(strLength);
示例6: DlgProcMISC
BOOL CALLBACK DlgProcMISC(HWND hwnd, UINT uMsg,
WPARAM wParam, LPARAM lParam)
{
switch (uMsg) {
case WM_INITDIALOG:
{
initdone6=false;
SendMessage( GetDlgItem(hwnd, IDC_DISABLETRAY), BM_SETCHECK, DisableTrayIcon, 0);
SendMessage( GetDlgItem(hwnd, IDC_KICKRDP), BM_SETCHECK, kickrdp, 0);
SendMessage( GetDlgItem(hwnd, IDC_DISINI), BM_SETCHECK, BUseRegistry, 0);
SetDlgItemInt(hwnd, IDC_SCALE, DefaultScale, false);
SetDlgItemText(hwnd, IDC_SCL, servicecmdline);
bool debug=false;
if (DebugMode >= 2)
{
debug=true;
CheckDlgButton(hwnd, IDC_LOG, BST_CHECKED);
}
else
CheckDlgButton(hwnd, IDC_LOG, BST_UNCHECKED);
if (DebugMode==2)
{
SendMessage(GetDlgItem(hwnd, IDC_FILE),BM_SETCHECK,TRUE,0);
SendMessage(GetDlgItem(hwnd, IDC_WINDOW),BM_SETCHECK,FALSE,0);
}
if (DebugMode==4)
{
SendMessage(GetDlgItem(hwnd, IDC_WINDOW),BM_SETCHECK,TRUE,0);
SendMessage(GetDlgItem(hwnd, IDC_FILE),BM_SETCHECK,FALSE,0);
}
if (DebugLevel>=10)
{
SendMessage(GetDlgItem(hwnd, IDC_ALL),BM_SETCHECK,TRUE,0);
SendMessage(GetDlgItem(hwnd, IDC_INFO),BM_SETCHECK,FALSE,0);
SendMessage(GetDlgItem(hwnd, IDC_WARN),BM_SETCHECK,FALSE,0);
}
if (DebugLevel==9)
{
SendMessage(GetDlgItem(hwnd, IDC_ALL),BM_SETCHECK,FALSE,0);
SendMessage(GetDlgItem(hwnd, IDC_INFO),BM_SETCHECK,TRUE,0);
SendMessage(GetDlgItem(hwnd, IDC_WARN),BM_SETCHECK,FALSE,0);
}
if (DebugLevel<=8)
{
SendMessage(GetDlgItem(hwnd, IDC_ALL),BM_SETCHECK,FALSE,0);
SendMessage(GetDlgItem(hwnd, IDC_INFO),BM_SETCHECK,FALSE,0);
SendMessage(GetDlgItem(hwnd, IDC_WARN),BM_SETCHECK,TRUE,0);
}
EnableWindow(GetDlgItem(hwnd, IDC_WINDOW), debug);
EnableWindow(GetDlgItem(hwnd, IDC_FILE), debug);
EnableWindow(GetDlgItem(hwnd, IDC_ALL), debug);
EnableWindow(GetDlgItem(hwnd, IDC_INFO), debug);
EnableWindow(GetDlgItem(hwnd, IDC_WARN), debug);
if (Avilog)
{
if (strlen(path)==0)
{
char WORKDIR[MAX_PATH];
if (GetModuleFileName(NULL, WORKDIR, MAX_PATH))
{
char* p = strrchr(WORKDIR, '\\');
if (p == NULL) return true;
*p = '\0';
}
strcpy(path,WORKDIR);
}
SetDlgItemText(hwnd, IDC_EDIT_PATH, path);
EnableWindow(GetDlgItem(hwnd, IDC_EDIT_PATH), true);
CheckDlgButton(hwnd, IDC_VIDEO, BST_CHECKED);
}
else
{
if (strlen(path)==0)
{
char WORKDIR[MAX_PATH];
if (GetModuleFileName(NULL, WORKDIR, MAX_PATH))
{
char* p = strrchr(WORKDIR, '\\');
if (p == NULL) return true;
*p = '\0';
}
strcpy(path,WORKDIR);
}
SetDlgItemText(hwnd, IDC_EDIT_PATH, path);
EnableWindow(GetDlgItem(hwnd, IDC_EDIT_PATH), false);
CheckDlgButton(hwnd, IDC_VIDEO, BST_UNCHECKED);
}
initdone6=true;
return TRUE;
}
//.........这里部分代码省略.........
示例7: TlenPopupsDlgProc
static BOOL CALLBACK TlenPopupsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg) {
case WM_INITDIALOG:
{
BYTE delayMode;
TranslateDialogDefault(hwndDlg);
CheckDlgButton(hwndDlg, IDC_ENABLEPOPUP, DBGetContactSettingByte(NULL, jabberProtoName, "MailPopupEnabled", TRUE));
SendDlgItemMessage(hwndDlg, IDC_COLORBKG, CPM_SETCOLOUR, 0, DBGetContactSettingDword(NULL, jabberProtoName, "MailPopupBack", POPUP_DEFAULT_COLORBKG));
SendDlgItemMessage(hwndDlg, IDC_COLORTXT, CPM_SETCOLOUR, 0, DBGetContactSettingDword(NULL, jabberProtoName, "MailPopupText", POPUP_DEFAULT_COLORTXT));
SetDlgItemInt(hwndDlg, IDC_DELAY, DBGetContactSettingDword(NULL, jabberProtoName, "MailPopupDelay", 4), FALSE);
delayMode = DBGetContactSettingByte(NULL, jabberProtoName, "MailPopupDelayMode", 0);
if (delayMode==1) {
CheckDlgButton(hwndDlg, IDC_DELAY_CUSTOM, TRUE);
} else if (delayMode==2) {
CheckDlgButton(hwndDlg, IDC_DELAY_PERMANENT, TRUE);
} else {
CheckDlgButton(hwndDlg, IDC_DELAY_POPUP, TRUE);
}
return TRUE;
}
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDC_COLORTXT:
case IDC_COLORBKG:
case IDC_ENABLEPOPUP:
case IDC_DELAY:
case IDC_DELAY_POPUP:
case IDC_DELAY_CUSTOM:
case IDC_DELAY_PERMANENT:
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
case IDC_PREVIEW:
{
int delay;
if (IsDlgButtonChecked(hwndDlg, IDC_DELAY_POPUP)) {
delay=0;
} else if (IsDlgButtonChecked(hwndDlg, IDC_DELAY_PERMANENT)) {
delay=-1;
} else {
delay=GetDlgItemInt(hwndDlg, IDC_DELAY, NULL, FALSE);
}
MailPopupPreview((DWORD) SendDlgItemMessage(hwndDlg,IDC_COLORBKG,CPM_GETCOLOUR,0,0),
(DWORD) SendDlgItemMessage(hwndDlg,IDC_COLORTXT,CPM_GETCOLOUR,0,0),
"New mail",
"From: [email protected]\nSubject: test",
delay);
}
}
break;
case WM_NOTIFY:
switch (((LPNMHDR) lParam)->code) {
case PSN_APPLY:
{
BYTE delayMode;
DBWriteContactSettingByte(NULL, jabberProtoName, "MailPopupEnabled", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_ENABLEPOPUP));
DBWriteContactSettingDword(NULL, jabberProtoName, "MailPopupBack", (DWORD) SendDlgItemMessage(hwndDlg,IDC_COLORBKG,CPM_GETCOLOUR,0,0));
DBWriteContactSettingDword(NULL, jabberProtoName, "MailPopupText", (DWORD) SendDlgItemMessage(hwndDlg,IDC_COLORTXT,CPM_GETCOLOUR,0,0));
DBWriteContactSettingDword(NULL, jabberProtoName, "MailPopupDelay", (DWORD) GetDlgItemInt(hwndDlg,IDC_DELAY, NULL, FALSE));
delayMode=0;
if (IsDlgButtonChecked(hwndDlg, IDC_DELAY_CUSTOM)) {
delayMode=1;
} else if (IsDlgButtonChecked(hwndDlg, IDC_DELAY_PERMANENT)) {
delayMode=2;
}
DBWriteContactSettingByte(NULL, jabberProtoName, "MailPopupDelayMode", delayMode);
return TRUE;
}
}
break;
}
return FALSE;
}
示例8: MainDialog
// Message handler for the Main dialog box
LRESULT CALLBACK MainDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
RECT rt;
HWND hCurrentRadioButton;
wchar_t wdirname[MAX_PATH], msg[1024], *title;
int ret, valid, ntxns, written;
switch (message)
{
case WM_INITDIALOG:
// maximize the dialog.
GetClientRect(GetParent(hDlg), &rt);
SetWindowPos(hDlg, HWND_TOP, 0, 0, rt.right, rt.bottom,
SWP_SHOWWINDOW);
CheckRadioButton(hDlg, IDC_MEDIUM_RADIO,
IDC_SMALL_RADIO, IDC_SMALL_RADIO);
SetDlgItemText(hDlg, IDC_HOME_EDIT,
tpcb->getHomeDirW(wdirname, MAX_PATH));
SetDlgItemInt(hDlg, IDC_TXN_EDIT, 1000, 0);
SetWindowText(hDlg, L"BDB TPCB Example app");
ShowWindow(hDlg, SW_SHOWNORMAL);
return TRUE;
case WM_COMMAND:
if (LOWORD(wParam) == IDC_INIT_BUTTON ||
LOWORD(wParam) == IDC_RUN_BUTTON ) {
hCurrentRadioButton = GetDlgItem(hDlg,
IDC_SMALL_RADIO);
if(BST_CHECKED ==
SendMessage(hCurrentRadioButton,
BM_GETCHECK, NULL, NULL)) {
tpcb->accounts = 500;
tpcb->branches = 10;
tpcb->tellers = 50;
tpcb->history = 5000;
}
hCurrentRadioButton = GetDlgItem(hDlg,
IDC_MEDIUM_RADIO);
if(BST_CHECKED ==
SendMessage(hCurrentRadioButton,
BM_GETCHECK, NULL, NULL)) {
tpcb->accounts = 1000;
tpcb->branches = 10;
tpcb->tellers = 100;
tpcb->history = 10000;
}
hCurrentRadioButton = GetDlgItem(hDlg,
IDC_LARGE_RADIO);
if(BST_CHECKED ==
SendMessage(hCurrentRadioButton,
BM_GETCHECK, NULL, NULL)) {
tpcb->accounts = 100000;
tpcb->branches = 10;
tpcb->tellers = 100;
tpcb->history = 259200;
}
EnableWindow(GetDlgItem(hDlg, IDC_INIT_BUTTON),
FALSE);
EnableWindow(GetDlgItem(hDlg, IDC_RUN_BUTTON),
FALSE);
EnableWindow(GetDlgItem(hDlg, IDC_ADV_BUTTON),
FALSE);
}
if (LOWORD(wParam) == IDC_ADV_BUTTON) {
CreateDialog(hInst,
MAKEINTRESOURCE(IDD_ADVANCEDDIALOG), hDlg,
(DLGPROC)AdvancedDialog);
} else if (LOWORD(wParam) == IDC_INIT_BUTTON) {
// Close the environment first.
// In case this is a re-initialization.
tpcb->closeEnv();
GetHomeDirectory(hDlg, TRUE);
tpcb->createEnv(0);
ret = tpcb->populate();
} else if (LOWORD(wParam) == IDC_RUN_BUTTON) {
GetHomeDirectory(hDlg, FALSE);
if (GetFileAttributes(
tpcb->getHomeDirW(wdirname, MAX_PATH)) !=
FILE_ATTRIBUTE_DIRECTORY) {
_snwprintf(msg, 1024,
L"Target directory: %s does not exist, or is not a directory.\nMake sure the "
L"directory name is correct, and that you ran the initialization phase.",
wdirname);
MessageBox(hDlg, msg, L"Error", MB_OK);
EnableWindow(GetDlgItem(hDlg,
IDC_INIT_BUTTON), TRUE);
EnableWindow(GetDlgItem(hDlg,
IDC_RUN_BUTTON), TRUE);
EnableWindow(GetDlgItem(hDlg,
IDC_ADV_BUTTON), TRUE);
return FALSE;
}
// TODO: Check for an empty directory?
ntxns = GetDlgItemInt(hDlg, IDC_TXN_EDIT,
&valid, FALSE);
if (valid == FALSE) {
MessageBox(hDlg,
L"Invalid number in transaction field.",
L"Error", MB_OK);
//.........这里部分代码省略.........
示例9: AdvancedDialog
// Message handler for the Advanced dialog box
LRESULT CALLBACK AdvancedDialog(HWND hDlg, UINT message,
WPARAM wParam, LPARAM lParam)
{
RECT rt;
HWND hCurrentCheckBox;
int currentInt, valid;
switch (message)
{
case WM_INITDIALOG:
GetClientRect(GetParent(hDlg), &rt);
SetWindowPos(hDlg, HWND_TOP, 0, 0, rt.right, rt.bottom,
SWP_SHOWWINDOW);
if (tpcb->fast_mode == 0) {
hCurrentCheckBox =
GetDlgItem(hDlg, IDC_FASTMODE_CHECK);
SendMessage(hCurrentCheckBox, BM_SETCHECK,
BST_CHECKED, 0);
}
if (tpcb->verbose == 1) {
hCurrentCheckBox =
GetDlgItem(hDlg, IDC_VERBOSE_CHECK);
SendMessage(hCurrentCheckBox, BM_SETCHECK,
BST_CHECKED, 0);
}
if (tpcb->cachesize != 0) {
SetDlgItemInt(hDlg, IDC_CACHE_EDIT,
tpcb->cachesize/1024, FALSE);
}
break;
case WM_COMMAND:
if (LOWORD(wParam) == IDC_DONE_BUTTON) {
hCurrentCheckBox =
GetDlgItem(hDlg, IDC_FASTMODE_CHECK);
if(BST_CHECKED == SendMessage(hCurrentCheckBox,
BM_GETCHECK, NULL, NULL))
tpcb->fast_mode = 0;
else
tpcb->fast_mode = 1;
hCurrentCheckBox =
GetDlgItem(hDlg, IDC_VERBOSE_CHECK);
if(BST_CHECKED == SendMessage(hCurrentCheckBox,
BM_GETCHECK, NULL, NULL))
tpcb->verbose = 1;
else
tpcb->verbose = 0;
currentInt = GetDlgItemInt(hDlg,
IDC_RANDOM_EDIT, &valid, FALSE);
if (valid != FALSE)
tpcb->rand_seed = currentInt;
currentInt = GetDlgItemInt(hDlg,
IDC_CACHE_EDIT, &valid, FALSE);
if (valid != FALSE) {
if (currentInt < 20) {
MessageBox(hDlg,
L"Min cache size is 20kb.",
L"Error", MB_OK);
return FALSE;
}
tpcb->cachesize = currentInt*1024;
}
EndDialog(hDlg, LOWORD(wParam));
DestroyWindow(hDlg);
}
break;
default:
return DefWindowProc(hDlg, message, wParam, lParam);
}
return TRUE;
}
示例10: OnSelChange
static BOOL
OnSelChange(HWND hwndDlg, PVIRTMEM pVirtMem)
{
TCHAR szBuffer[64];
MEMORYSTATUSEX MemoryStatus;
ULARGE_INTEGER FreeDiskSpace;
UINT /*i,*/ FreeMemMb /*, PageFileSizeMb*/;
INT Index;
Index = (INT)SendDlgItemMessage(hwndDlg,
IDC_PAGEFILELIST,
LB_GETCURSEL,
0,
0);
if (Index >= 0 && Index < pVirtMem->Count)
{
/* Set drive letter */
SetDlgItemText(hwndDlg, IDC_DRIVE,
pVirtMem->Pagefile[Index].szDrive);
/* Set available disk space */
if (GetDiskFreeSpaceEx(pVirtMem->Pagefile[Index].szDrive,
NULL, NULL, &FreeDiskSpace))
{
pVirtMem->Pagefile[Index].FreeSize = (UINT)(FreeDiskSpace.QuadPart / (1024 * 1024));
_stprintf(szBuffer, _T("%u MB"), pVirtMem->Pagefile[Index].FreeSize);
SetDlgItemText(hwndDlg, IDC_SPACEAVAIL, szBuffer);
}
if (pVirtMem->Pagefile[Index].NewMinSize == -1 &&
pVirtMem->Pagefile[Index].NewMaxSize == -1)
{
/* No pagefile */
EnableWindow(GetDlgItem(pVirtMem->hSelf, IDC_MAXSIZE), FALSE);
EnableWindow(GetDlgItem(pVirtMem->hSelf, IDC_INITIALSIZE), FALSE);
CheckDlgButton(pVirtMem->hSelf, IDC_NOPAGEFILE, BST_CHECKED);
}
else if (pVirtMem->Pagefile[Index].NewMinSize == 0 &&
pVirtMem->Pagefile[Index].NewMaxSize == 0)
{
/* System managed size*/
EnableWindow(GetDlgItem(pVirtMem->hSelf, IDC_MAXSIZE), FALSE);
EnableWindow(GetDlgItem(pVirtMem->hSelf, IDC_INITIALSIZE), FALSE);
CheckDlgButton(pVirtMem->hSelf, IDC_SYSMANSIZE, BST_CHECKED);
}
else
{
/* Custom size */
/* Enable and fill the custom values */
EnableWindow(GetDlgItem(pVirtMem->hSelf, IDC_MAXSIZE), TRUE);
EnableWindow(GetDlgItem(pVirtMem->hSelf, IDC_INITIALSIZE), TRUE);
SetDlgItemInt(pVirtMem->hSelf,
IDC_INITIALSIZE,
pVirtMem->Pagefile[Index].NewMinSize,
FALSE);
SetDlgItemInt(pVirtMem->hSelf,
IDC_MAXSIZE,
pVirtMem->Pagefile[Index].NewMaxSize,
FALSE);
CheckDlgButton(pVirtMem->hSelf,
IDC_CUSTOM,
BST_CHECKED);
}
/* Set minimum pagefile size */
SetDlgItemText(hwndDlg, IDC_MINIMUM, _T("16 MB"));
/* Set recommended pagefile size */
MemoryStatus.dwLength = sizeof(MEMORYSTATUSEX);
if (GlobalMemoryStatusEx(&MemoryStatus))
{
FreeMemMb = (UINT)(MemoryStatus.ullTotalPhys / (1024 * 1024));
_stprintf(szBuffer, _T("%u MB"), FreeMemMb + (FreeMemMb / 2));
SetDlgItemText(hwndDlg, IDC_RECOMMENDED, szBuffer);
}
/* Set current pagefile size */
#if 0
PageFileSizeMb = 0;
for (i = 0; i < 26; i++)
{
PageFileSizeMb += pVirtMem->Pagefile[i].InitialSize;
}
_stprintf(szBuffer, _T("%u MB"), PageFileSizeMb);
SetDlgItemText(hwndDlg, IDC_CURRENT, szBuffer);
#endif
}
return TRUE;
}
示例11: MainDlgProc
//Methode für den Optionsdialog
int CALLBACK MainDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam){
switch (uMsg){
case WM_INITDIALOG:
// Die Dialogfelder vorbereiten:
TranslateDialogDefault(hwndDlg);
SetDlgItemInt(hwndDlg, IDC_Timer, options.iTimeOut, TRUE);
CheckDlgButton(hwndDlg,IDC_cStatus,options.cStatus);
CheckDlgButton(hwndDlg,IDC_cTime,options.cTime);
CheckDlgButton(hwndDlg,IDC_cAway,options.cAway);
CheckDlgButton(hwndDlg,IDC_cNA,options.cNa);
CheckDlgButton(hwndDlg,IDC_cOcc,options.cOcc);
CheckDlgButton(hwndDlg,IDC_cDnd,options.cDnd);
CheckDlgButton(hwndDlg,IDC_cFfc,options.cFfc);
SetDlgItemText(hwndDlg,IDC_file_away, options.file_away);
SetDlgItemText(hwndDlg,IDC_file_na, options.file_na);
SetDlgItemText(hwndDlg,IDC_file_occ, options.file_occ);
SetDlgItemText(hwndDlg,IDC_file_dnd, options.file_dnd);
SetDlgItemText(hwndDlg,IDC_file_ffc, options.file_ffc);
SendMessage(hwndDlg, WMU_SETBUTTONS, 0, 0);
return TRUE;
case WMU_SETBUTTONS:
{
bool en=(IsDlgButtonChecked(hwndDlg,IDC_cTime)==1)||(IsDlgButtonChecked(hwndDlg,IDC_cStatus)==1);
EnableWindow(GetDlgItem(hwndDlg, IDC_file_away),(IsDlgButtonChecked(hwndDlg,IDC_cAway)==1)&&en);
EnableWindow(GetDlgItem(hwndDlg, IDC_file_na),(IsDlgButtonChecked(hwndDlg,IDC_cNA)==1)&&en);
EnableWindow(GetDlgItem(hwndDlg, IDC_file_occ),(IsDlgButtonChecked(hwndDlg,IDC_cOcc)==1)&&en);
EnableWindow(GetDlgItem(hwndDlg, IDC_file_dnd),(IsDlgButtonChecked(hwndDlg,IDC_cDnd)==1)&&en);
EnableWindow(GetDlgItem(hwndDlg, IDC_file_ffc),(IsDlgButtonChecked(hwndDlg,IDC_cFfc)==1)&&en);
EnableWindow(GetDlgItem(hwndDlg, IDC_Timer),IsDlgButtonChecked(hwndDlg,IDC_cTime)==1);
EnableWindow(GetDlgItem(hwndDlg, IDC_cAway),en);
EnableWindow(GetDlgItem(hwndDlg, IDC_cNA),en);
EnableWindow(GetDlgItem(hwndDlg, IDC_cOcc),en);
EnableWindow(GetDlgItem(hwndDlg, IDC_cDnd),en);
EnableWindow(GetDlgItem(hwndDlg, IDC_cFfc),en);
}
return TRUE;
case WM_COMMAND:
if ( HIWORD( wParam ) == BN_CLICKED ) {
SendMessage(hwndDlg, WMU_SETBUTTONS, 0, 0);
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
} else if ( HIWORD( wParam ) == EN_CHANGE && ( HWND )lParam == GetFocus()) {
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
}
break;
case WM_NOTIFY:{
NMHDR* nmhdr = (NMHDR*)lParam;
switch (nmhdr->code){
case PSN_APPLY:
// DIe DIalogfelder auslesen, in die Variablen speichern und in die Datenbank schreiben
options.iTimeOut = GetDlgItemInt(hwndDlg, IDC_Timer, NULL, TRUE);
if (options.iTimeOut<1) {
options.iTimeOut=1;
SetDlgItemInt(hwndDlg, IDC_Timer, 1, TRUE);
}
DBWriteContactSettingDword(NULL, RMC, "TimeOut", options.iTimeOut);
options.cStatus = IsDlgButtonChecked(hwndDlg,IDC_cStatus)==1;
DBWriteContactSettingByte(NULL,RMC,"enable_status",(BYTE)options.cStatus);
options.cTime = IsDlgButtonChecked(hwndDlg,IDC_cTime)==1;
DBWriteContactSettingByte(NULL,RMC,"enable_time",(BYTE)options.cTime);
options.cAway = IsDlgButtonChecked(hwndDlg,IDC_cAway)==1;
DBWriteContactSettingByte(NULL,RMC,"enable_away",(BYTE)options.cAway);
options.cNa = IsDlgButtonChecked(hwndDlg,IDC_cNA)==1;
DBWriteContactSettingByte(NULL,RMC,"enable_na",(BYTE)options.cNa);
options.cOcc = IsDlgButtonChecked(hwndDlg,IDC_cOcc)==1;
DBWriteContactSettingByte(NULL,RMC,"enable_occ",(BYTE)options.cOcc);
options.cDnd = IsDlgButtonChecked(hwndDlg,IDC_cDnd)==1;
DBWriteContactSettingByte(NULL,RMC,"enable_dnd",(BYTE)options.cDnd);
options.cFfc = IsDlgButtonChecked(hwndDlg,IDC_cFfc)==1;
DBWriteContactSettingByte(NULL,RMC,"enable_ffc",(BYTE)options.cFfc);
GetDlgItemText(hwndDlg,IDC_file_away,options.file_away,STRING_LENGTH);
DBWriteContactSettingString(NULL,RMC,"file_away",options.file_away);
GetDlgItemText(hwndDlg,IDC_file_na,options.file_na,STRING_LENGTH);
DBWriteContactSettingString(NULL,RMC,"file_na",options.file_na);
GetDlgItemText(hwndDlg,IDC_file_occ,options.file_occ,STRING_LENGTH);
DBWriteContactSettingString(NULL,RMC,"file_occ",options.file_occ);
GetDlgItemText(hwndDlg,IDC_file_dnd,options.file_dnd,STRING_LENGTH);
DBWriteContactSettingString(NULL,RMC,"file_dnd",options.file_dnd);
GetDlgItemText(hwndDlg,IDC_file_ffc,options.file_ffc,STRING_LENGTH);
DBWriteContactSettingString(NULL,RMC,"file_ffc",options.file_ffc);
//.........这里部分代码省略.........
示例12: SetDlgItemInt
BOOL HawkPreferences::on_dialog_init(CWindow, LPARAM) {
SetDlgItemInt(IDC_RATIO_CUTOFF, cfg_ratio_cutoff, FALSE);
SetDlgItemInt(IDC_MAX_PLAYLISTS, cfg_max_playlists, FALSE);
return FALSE;
}
示例13: while
void CConfigNetwork::GetConfig()
{
if (!m_pDev || m_bInited)
{
return;
}
while (m_ethernetsel.GetCount() > 0)
{
m_ethernetsel.DeleteString(0);
}
BOOL bRet = FALSE;
DWORD retlen = 0;
bRet = CLIENT_GetDevConfig(m_pDev->LoginID, DH_DEV_DEVICECFG, 0,
&m_sysCFG, sizeof(DHDEV_SYSTEM_ATTR_CFG), &retlen, CONFIG_WAITTIME*4);
if (!bRet || retlen != sizeof(DHDEV_SYSTEM_ATTR_CFG))
{
((CNetSDKDemoDlg*)AfxGetMainWnd())->LastError();
return;
}
CString strEth;
for (int i = 0; i < m_sysCFG.byNetIONum; i++)
{
strEth.Format(ConvertString("Ethernet %d"), i+1);
m_ethernetsel.InsertString(i, strEth);
}
bRet = CLIENT_GetDevConfig(m_pDev->LoginID, DH_DEV_NETCFG, 0,
&m_netCFG, sizeof(DHDEV_NET_CFG), &retlen, CONFIG_WAITTIME*4);
if (!bRet || retlen != sizeof(DHDEV_NET_CFG))
{
((CNetSDKDemoDlg*)AfxGetMainWnd())->LastError();
return;
}
else
{
m_bInited = TRUE;
}
//show config information
SetDlgItemText(IDC_EDIT_DEVNAME, m_netCFG.sDevName);
SetDlgItemInt(IDC_EDIT_MAXTCP, m_netCFG.wTcpMaxConnectNum);
SetDlgItemInt(IDC_EDIT_TCPPORT, m_netCFG.wTcpPort);
SetDlgItemInt(IDC_EDIT_UDPPORT, m_netCFG.wUdpPort);
SetDlgItemInt(IDC_EDIT_HTTPPORT, m_netCFG.wHttpPort);
SetDlgItemInt(IDC_EDIT_HTTPSPORT, m_netCFG.wHttpsPort);
SetDlgItemInt(IDC_EDIT_SSLPORT, m_netCFG.wSslPort);
SetDlgItemInt(IDC_EDIT_MAXTCP, m_netCFG.wTcpMaxConnectNum);
SetDlgItemInt(IDC_EDIT_MAXTCP, m_netCFG.wTcpMaxConnectNum);
//ethernet config
if (m_ethernetsel.GetCount() > 0)
{
m_ethernetsel.SetCurSel(0);
OnSelchangeComboEthernet();
}
//remote config
if (m_remotehostsel.GetCount() > 0)
{
m_remotehostsel.SetCurSel(0);
OnSelchangeComboRemotehost();
}
//mail config
SetDlgItemText(IDC_EDIT_MAILUSERNAME, m_netCFG.struMail.sUserName);
SetDlgItemText(IDC_EDIT_MAILUSERPSW, m_netCFG.struMail.sUserPsw);
SetDlgItemText(IDC_EDIT_MAILIP, m_netCFG.struMail.sMailIPAddr);
SetDlgItemInt(IDC_EDIT_MAILPORT, m_netCFG.struMail.wMailPort);
SetDlgItemText(IDC_EDIT_MAILDESADDR, m_netCFG.struMail.sDestAddr);
SetDlgItemText(IDC_EDIT_MAILCCADDR, m_netCFG.struMail.sCcAddr);
SetDlgItemText(IDC_EDIT_MAILBCCADDR, m_netCFG.struMail.sBccAddr);
SetDlgItemText(IDC_EDIT_MAILSUBJECT, m_netCFG.struMail.sSubject);
//Begin: Add by li_deming(11517) 2008-1-30
//DDNS config
bRet = FALSE;
bRet = CLIENT_GetDevConfig(m_pDev->LoginID, DH_DEV_MULTI_DDNS, 0,
&m_ddnsCFG, sizeof(DHDEV_MULTI_DDNS_CFG), &retlen, CONFIG_WAITTIME*4);
selIndexOld=-1;
if(bRet == TRUE)
{
CString strItem="";
m_ctlDDNSIDList.Clear();
for(int i=0; i<m_ddnsCFG.dwDdnsServerNum;i++)
{
strItem="";
strItem.Format(ConvertString("DDNS %d"),i);
m_ctlDDNSIDList.InsertString( i, strItem);
}
UpdateData(FALSE);
m_ctlDDNSIDList.SetCurSel(0);
OnSelchangeComboDdnsid();
}
else
{
AfxMessageBox(ConvertString("Get Dev Multi DDNS Info Fail!"));
}
//.........这里部分代码省略.........
示例14: GetDlgItemText
void CConfigChannel::OnSelchangeComboChanno()
{
if (!m_bInited)
{
return;
}
int strmIdx,osdIdx;
//store current config
if (m_chnIdx < 0)
{
goto skipsave;
}
strmIdx = m_streamsel.GetCurSel();
if (strmIdx < 0)
{
return;
}
osdIdx = m_osdsel.GetCurSel();
if (osdIdx < 0)
{
return;
}
GetDlgItemText(IDC_EDIT_CHANNAME, m_chnCFG[m_chnIdx].szChannelName, DH_CHAN_NAME_LEN+1);
BYTE rsOIdx, ecOIdx;
GetOrigIndex(&rsOIdx, m_resolutionsel.GetCurSel(), m_sysCFG.stDspEncodeCap.dwImageSizeMask);
GetOrigIndex(&ecOIdx, m_encodetypesel.GetCurSel(), m_sysCFG.stDspEncodeCap.dwEncodeModeMask);
if (strmIdx < 3) //main stream - for record
{
m_chnCFG[m_chnIdx].stMainVideoEncOpt[strmIdx].byVideoEnable= m_videochk.GetCheck();
m_chnCFG[m_chnIdx].stMainVideoEncOpt[strmIdx].byAudioEnable= m_audiochk.GetCheck();
m_chnCFG[m_chnIdx].stMainVideoEncOpt[strmIdx].byBitRateControl= m_bitratectrlsel.GetCurSel();
m_chnCFG[m_chnIdx].stMainVideoEncOpt[strmIdx].byFramesPerSec= m_framesel.GetCurSel();
m_chnCFG[m_chnIdx].stMainVideoEncOpt[strmIdx].byEncodeMode= ecOIdx;
m_chnCFG[m_chnIdx].stMainVideoEncOpt[strmIdx].byImageSize= rsOIdx;
m_chnCFG[m_chnIdx].stMainVideoEncOpt[strmIdx].byImageQlty= m_imgqualitysel.GetCurSel()+1;
}
else if (strmIdx < 6) //assistant - for net-transfor
{
m_chnCFG[m_chnIdx].stAssiVideoEncOpt[strmIdx-3].byVideoEnable= m_videochk.GetCheck();
m_chnCFG[m_chnIdx].stAssiVideoEncOpt[strmIdx-3].byAudioEnable= m_audiochk.GetCheck();
m_chnCFG[m_chnIdx].stAssiVideoEncOpt[strmIdx-3].byBitRateControl= m_bitratectrlsel.GetCurSel();
m_chnCFG[m_chnIdx].stAssiVideoEncOpt[strmIdx-3].byFramesPerSec= m_framesel.GetCurSel();
m_chnCFG[m_chnIdx].stAssiVideoEncOpt[strmIdx-3].byEncodeMode= ecOIdx;
m_chnCFG[m_chnIdx].stAssiVideoEncOpt[strmIdx-3].byImageSize= rsOIdx;
m_chnCFG[m_chnIdx].stAssiVideoEncOpt[strmIdx-3].byImageQlty= m_imgqualitysel.GetCurSel()+1;
}
m_chnCFG[m_chnIdx].stColorCfg[0].byBrightness = GetDlgItemInt(IDC_EDIT_BRIGHTNESS);
m_chnCFG[m_chnIdx].stColorCfg[0].bySaturation = GetDlgItemInt(IDC_EDIT_SATURATION);
m_chnCFG[m_chnIdx].stColorCfg[0].byContrast = GetDlgItemInt(IDC_EDIT_CONTRAST);
m_chnCFG[m_chnIdx].stColorCfg[0].byHue = GetDlgItemInt(IDC_EDIT_HUE);
m_chnCFG[m_chnIdx].stColorCfg[0].byGainEn = m_gainchk.GetCheck();
m_chnCFG[m_chnIdx].stColorCfg[0].byGain = GetDlgItemInt(IDC_EDIT_GAIN);
//show new config
skipsave:
int chnIdx = m_channelsel.GetCurSel();
if (chnIdx < 0)
{
return;
}
m_chnIdx = chnIdx;
char tmpName[DH_CHAN_NAME_LEN+1] = {0};
memcpy(tmpName, m_chnCFG[chnIdx].szChannelName, DH_CHAN_NAME_LEN);
SetDlgItemText(IDC_EDIT_CHANNAME, tmpName);
SetDlgItemInt(IDC_EDIT_BRIGHTNESS, m_chnCFG[chnIdx].stColorCfg[0].byBrightness);
SetDlgItemInt(IDC_EDIT_SATURATION, m_chnCFG[chnIdx].stColorCfg[0].bySaturation);
SetDlgItemInt(IDC_EDIT_CONTRAST, m_chnCFG[chnIdx].stColorCfg[0].byContrast);
SetDlgItemInt(IDC_EDIT_HUE, m_chnCFG[chnIdx].stColorCfg[0].byHue);
SetDlgItemInt(IDC_EDIT_GAIN, m_chnCFG[chnIdx].stColorCfg[0].byGain);
m_gainchk.SetCheck(m_chnCFG[chnIdx].stColorCfg[0].byGainEn?1:0);
// SetDlgItemInt(IDC_EDIT_MONADDR, m_chnCFG[chnIdx].dwMonitorAddr);
//refresh every area
if (m_streamsel.GetCount())
{
m_streamsel.SetCurSel(0);
}
m_strmIdx = -1; //prevent from unwanted saving
OnSelchangeComboStream();
if (m_osdsel.GetCount() > 0)
{
m_osdsel.SetCurSel(0);
}
m_osdIdx = -1; //prevent from unwanted saving
OnSelchangeComboOsd();
}
示例15: SetDlgItemInt
void CDlgCfgAccessControl::StuToDlg()
{
// door open method
m_cmbOpenMethod.SetCurSel((CFG_DOOR_OPEN_METHOD)m_stuInfo.emDoorOpenMethod);
// door unlock hold time
SetDlgItemInt(IDC_ACCESSCONTROL_EDT_UNLOCKHOLD, m_stuInfo.nUnlockHoldInterval);
// door close timeout
SetDlgItemInt(IDC_ACCESSCONTROL_EDT_CLOSETIMEOUT, m_stuInfo.nCloseTimeout);
// open time index in config of AccessTimeSchedule, start from 0
m_cmbOpenTimeIndex.SetCurSel(m_stuInfo.nOpenAlwaysTimeIndex);
// holiday record set recNo
SetDlgItemInt(IDC_ACCESSCONTROL_EDT_HOLIDAYTIMERECNO, m_stuInfo.nHolidayTimeRecoNo);
// break in alarm enable
if (m_stuInfo.bBreakInAlarmEnable)
{
m_chkBreakAlarm.SetCheck(BST_CHECKED);
}
else
{
m_chkBreakAlarm.SetCheck(BST_UNCHECKED);
}
// repeat enter alarm enable
if (m_stuInfo.bRepeatEnterAlarm)
{
m_chkRepeatEnterAlarm.SetCheck(BST_CHECKED);
}
else
{
m_chkRepeatEnterAlarm.SetCheck(BST_UNCHECKED);
}
// door not close enable
if (m_stuInfo.bDoorNotClosedAlarmEnable)
{
m_chkDoorNotCloseAlarm.SetCheck(BST_CHECKED);
}
else
{
m_chkDoorNotCloseAlarm.SetCheck(BST_UNCHECKED);
}
// duress alarm enable
if (m_stuInfo.bDuressAlarmEnable)
{
m_chkDuressAlarm.SetCheck(BST_CHECKED);
}
else
{
m_chkDuressAlarm.SetCheck(BST_UNCHECKED);
}
// sensor alarm enable
if (m_stuInfo.bSensorEnable)
{
m_chkSensor.SetCheck(BST_CHECKED);
}
else
{
m_chkSensor.SetCheck(BST_UNCHECKED);
}
// time section...
}