本文整理汇总了C++中CMsnProto::getTString方法的典型用法代码示例。如果您正苦于以下问题:C++ CMsnProto::getTString方法的具体用法?C++ CMsnProto::getTString怎么用?C++ CMsnProto::getTString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMsnProto
的用法示例。
在下文中一共展示了CMsnProto::getTString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DlgProcSetNickname
static INT_PTR CALLBACK DlgProcSetNickname(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg)
{
case WM_INITDIALOG:
{
TranslateDialogDefault(hwndDlg);
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
CMsnProto* proto = (CMsnProto*)lParam;
SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)LoadIconEx("main", true));
SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)LoadIconEx("main"));
SendMessage(GetDlgItem(hwndDlg, IDC_NICKNAME), EM_LIMITTEXT, 129, 0);
DBVARIANT dbv;
if (!proto->getTString("Nick", &dbv)) {
SetDlgItemText(hwndDlg, IDC_NICKNAME, dbv.ptszVal);
MSN_FreeVariant(&dbv);
}
return TRUE;
}
case WM_COMMAND:
switch(wParam)
{
case IDOK:
{
CMsnProto* proto = (CMsnProto*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
if (proto->msnLoggedIn)
{
TCHAR str[130];
GetDlgItemText(hwndDlg, IDC_NICKNAME, str, SIZEOF(str));
proto->MSN_SendNickname(str);
}
}
case IDCANCEL:
DestroyWindow(hwndDlg);
break;
}
break;
case WM_CLOSE:
DestroyWindow(hwndDlg);
break;
case WM_DESTROY:
ReleaseIconEx("main");
ReleaseIconEx("main", true);
break;
}
return FALSE;
}
示例2: CheckDlgButton
static INT_PTR CALLBACK DlgProcMsnOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
{
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
CMsnProto* proto = (CMsnProto*)lParam;
SetDlgItemTextA(hwndDlg, IDC_HANDLE, proto->MyOptions.szEmail);
char tBuffer[MAX_PATH];
if (!db_get_static(NULL, proto->m_szModuleName, "Password", tBuffer, sizeof(tBuffer))) {
tBuffer[16] = 0;
SetDlgItemTextA(hwndDlg, IDC_PASSWORD, tBuffer);
}
SendDlgItemMessage(hwndDlg, IDC_PASSWORD, EM_SETLIMITTEXT, 16, 0);
HWND wnd = GetDlgItem(hwndDlg, IDC_HANDLE2);
DBVARIANT dbv;
if (!proto->getTString("Nick", &dbv)) {
SetWindowText(wnd, dbv.ptszVal);
db_free(&dbv);
}
EnableWindow(wnd, proto->msnLoggedIn);
EnableWindow(GetDlgItem(hwndDlg, IDC_MOBILESEND), proto->msnLoggedIn &&
proto->getByte("MobileEnabled", 0) && proto->getByte("MobileAllowed", 0));
CheckDlgButton(hwndDlg, IDC_MOBILESEND, proto->getByte("MobileAllowed", 0) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_SENDFONTINFO, proto->getByte("SendFontInfo", 1) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_MANAGEGROUPS, proto->getByte("ManageServer", 1) ? BST_CHECKED : BST_UNCHECKED);
int tValue = proto->getByte("RunMailerOnHotmail", 0);
CheckDlgButton(hwndDlg, IDC_RUN_APP_ON_HOTMAIL, tValue ? BST_CHECKED : BST_UNCHECKED);
EnableWindow(GetDlgItem(hwndDlg, IDC_MAILER_APP), tValue);
EnableWindow(GetDlgItem(hwndDlg, IDC_ENTER_MAILER_APP), tValue);
if (!db_get_static(NULL, proto->m_szModuleName, "MailerPath", tBuffer, sizeof(tBuffer)))
SetDlgItemTextA(hwndDlg, IDC_MAILER_APP, tBuffer);
if (!proto->msnLoggedIn) {
EnableWindow(GetDlgItem(hwndDlg, IDC_MANAGEGROUPS), FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_DISABLE_ANOTHER_CONTACTS), FALSE);
}
else CheckDlgButton(hwndDlg, IDC_DISABLE_ANOTHER_CONTACTS, proto->msnOtherContactsBlocked ? BST_CHECKED : BST_UNCHECKED);
}
return TRUE;
case WM_COMMAND:
if (LOWORD(wParam) == IDC_NEWMSNACCOUNTLINK) {
Utils_OpenUrl("https://signup.live.com");
return TRUE;
}
if (HIWORD(wParam) == EN_CHANGE && (HWND)lParam == GetFocus()) {
switch (LOWORD(wParam)) {
case IDC_HANDLE:
case IDC_PASSWORD:
case IDC_HANDLE2:
case IDC_GATEWAYSERVER:
case IDC_YOURHOST:
case IDC_DIRECTSERVER:
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
}
}
if (HIWORD(wParam) == BN_CLICKED) {
switch (LOWORD(wParam)) {
case IDC_SENDFONTINFO:
case IDC_DISABLE_ANOTHER_CONTACTS:
case IDC_MOBILESEND:
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
case IDC_MANAGEGROUPS:
if (IsDlgButtonChecked(hwndDlg, IDC_MANAGEGROUPS)) {
if (IDYES == MessageBox(hwndDlg,
TranslateT("Server groups import may change your contact list layout after next login. Do you want to upload your groups to the server?"),
TranslateT("MSN Protocol"), MB_YESNOCANCEL)) {
CMsnProto* proto = (CMsnProto*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
proto->MSN_UploadServerGroups(NULL);
}
}
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
case IDC_RUN_APP_ON_HOTMAIL:
{
BOOL tIsChosen = IsDlgButtonChecked(hwndDlg, IDC_RUN_APP_ON_HOTMAIL);
EnableWindow(GetDlgItem(hwndDlg, IDC_MAILER_APP), tIsChosen);
EnableWindow(GetDlgItem(hwndDlg, IDC_ENTER_MAILER_APP), tIsChosen);
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
}
break;
case IDC_ENTER_MAILER_APP:
char szFile[MAX_PATH + 2];
{
HWND tEditField = GetDlgItem(hwndDlg, IDC_MAILER_APP);
//.........这里部分代码省略.........
示例3: DlgProcAccMgrUI
static INT_PTR CALLBACK DlgProcAccMgrUI(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
{
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
CMsnProto* proto = (CMsnProto*)lParam;
SetDlgItemTextA(hwndDlg, IDC_HANDLE, proto->MyOptions.szEmail);
char tBuffer[MAX_PATH];
if (!db_get_static(NULL, proto->m_szModuleName, "Password", tBuffer, sizeof(tBuffer))) {
tBuffer[16] = 0;
SetDlgItemTextA(hwndDlg, IDC_PASSWORD, tBuffer);
}
SendDlgItemMessage(hwndDlg, IDC_PASSWORD, EM_SETLIMITTEXT, 16, 0);
DBVARIANT dbv;
if (!proto->getTString("Place", &dbv)) {
SetDlgItemText(hwndDlg, IDC_PLACE, dbv.ptszVal);
db_free(&dbv);
}
}
return TRUE;
case WM_COMMAND:
if (LOWORD(wParam) == IDC_NEWMSNACCOUNTLINK) {
Utils_OpenUrl("https://signup.live.com");
return TRUE;
}
if (HIWORD(wParam) == EN_CHANGE && (HWND)lParam == GetFocus()) {
switch (LOWORD(wParam)) {
case IDC_HANDLE:
case IDC_PASSWORD:
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
}
}
break;
case WM_NOTIFY:
if (((LPNMHDR)lParam)->code == (UINT)PSN_APPLY) {
char password[100], szEmail[MSN_MAX_EMAIL_LEN];
DBVARIANT dbv;
CMsnProto* proto = (CMsnProto*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
GetDlgItemTextA(hwndDlg, IDC_HANDLE, szEmail, _countof(szEmail));
if (mir_strcmp(szEmail, proto->MyOptions.szEmail)) {
mir_strcpy(proto->MyOptions.szEmail, szEmail);
proto->setString("e-mail", szEmail);
proto->setString("wlid", szEmail);
proto->setDword("netId", (proto->MyOptions.netId = proto->GetMyNetID()));
}
GetDlgItemTextA(hwndDlg, IDC_PASSWORD, password, _countof(password));
if (!proto->getString("Password", &dbv)) {
if (mir_strcmp(password, dbv.pszVal))
proto->setString("Password", password);
db_free(&dbv);
}
else proto->setString("Password", password);
TCHAR szPlace[64];
GetDlgItemText(hwndDlg, IDC_PLACE, szPlace, _countof(szPlace));
if (szPlace[0])
proto->setTString("Place", szPlace);
else
proto->delSetting("Place");
return TRUE;
}
break;
}
return FALSE;
}