int ESCP_Ansi() { int NumErrors = 0; // error count - to be returned int rc; // return code if (Verbose) { printf("\n---- A version ----\n\n"); } // Variation 1 - installed CodePageCtr = 0; rc = EnumSystemCodePagesA( MyFuncCPA, CP_INSTALLED ); CheckReturnValidEnum( rc, TRUE, CodePageCtr, NUM_INSTALLED_CPS, "A version Flag installed", &NumErrors ); // Variation 2 - Supported CodePageCtr = 0; rc = EnumSystemCodePagesA( MyFuncCPA, CP_SUPPORTED ); CheckReturnValidEnum( rc, TRUE, CodePageCtr, NUM_SUPPORTED_CPS, "A version Flag supported", &NumErrors ); // // Return total number of errors found. // return (NumErrors); }
void InitGlobals() { g_dat = (struct GlobalMessageData *)malloc(sizeof(struct GlobalMessageData)); g_dat->hMessageWindowList = (HANDLE) CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0); g_dat->hParentWindowList = (HANDLE) CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0); g_dat->hMenuANSIEncoding = CreatePopupMenu(); AppendMenuA(g_dat->hMenuANSIEncoding, MF_STRING, 500, Translate("Default codepage")); AppendMenuA(g_dat->hMenuANSIEncoding, MF_SEPARATOR, 0, 0); EnumSystemCodePagesA(LangAddCallback, CP_INSTALLED); g_hAck = HookEvent(ME_PROTO_ACK, ackevent); ReloadGlobals(); g_dat->hParent = NULL; g_dat->protoNum = 0; g_dat->protoNames = NULL; g_dat->hIconList = NULL; }
void InitGlobals() { g_dat = (struct GlobalMessageData *)mir_alloc(sizeof(struct GlobalMessageData)); g_dat->hMessageWindowList = (HANDLE) CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0); g_dat->hParentWindowList = (HANDLE) CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0); g_dat->hMenuANSIEncoding = CreatePopupMenu(); AppendMenu(g_dat->hMenuANSIEncoding, MF_STRING, 500, TranslateT("Default codepage")); AppendMenuA(g_dat->hMenuANSIEncoding, MF_SEPARATOR, 0, 0); EnumSystemCodePagesA(LangAddCallback, CP_INSTALLED); g_hAck = HookEvent(ME_PROTO_ACK, ackevent); ReloadGlobals(); g_dat->lastParent = NULL; g_dat->lastChatParent = NULL; g_dat->protoNum = 0; g_dat->protoNames = NULL; g_dat->hTabIconList = NULL; g_dat->hButtonIconList = ImageList_Create(16, 16, IsWinVerXPPlus() ? ILC_COLOR32 | ILC_MASK : ILC_COLOR8 | ILC_MASK, (g_dat->protoNum + 1) * 12 + 8, 0); g_dat->draftList = NULL; }
static INT_PTR CALLBACK DlgProcIcqFeaturesOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { CIcqProto* ppro = (CIcqProto*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); switch (msg) { case WM_INITDIALOG: TranslateDialogDefault(hwndDlg); ppro = (CIcqProto*)lParam; SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam); { LoadDBCheckState(ppro, hwndDlg, IDC_TEMPVISIBLE, "TempVisListEnabled", DEFAULT_TEMPVIS_ENABLED); LoadDBCheckState(ppro, hwndDlg, IDC_SLOWSEND, "SlowSend", DEFAULT_SLOWSEND); BOOL byData = ppro->getByte("DirectMessaging", DEFAULT_DCMSG_ENABLED); CheckDlgButton(hwndDlg, IDC_DCENABLE, byData ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwndDlg, IDC_DCPASSIVE, byData == 1 ? BST_CHECKED : BST_UNCHECKED); icq_EnableMultipleControls(hwndDlg, icqDCMsgControls, _countof(icqDCMsgControls), byData ? TRUE : FALSE); BYTE byXStatusEnabled = ppro->getByte("XStatusEnabled", DEFAULT_XSTATUS_ENABLED); CheckDlgButton(hwndDlg, IDC_XSTATUSENABLE, byXStatusEnabled ? BST_CHECKED : BST_UNCHECKED); BYTE byMoodsEnabled = ppro->getByte("MoodsEnabled", DEFAULT_MOODS_ENABLED); CheckDlgButton(hwndDlg, IDC_MOODSENABLE, byMoodsEnabled ? BST_CHECKED : BST_UNCHECKED); icq_EnableMultipleControls(hwndDlg, icqXStatusControls, _countof(icqXStatusControls), byXStatusEnabled); icq_EnableMultipleControls(hwndDlg, icqCustomStatusControls, _countof(icqCustomStatusControls), byXStatusEnabled || byMoodsEnabled); LoadDBCheckState(ppro, hwndDlg, IDC_XSTATUSAUTO, "XStatusAuto", DEFAULT_XSTATUS_AUTO); LoadDBCheckState(ppro, hwndDlg, IDC_XSTATUSRESET, "XStatusReset", DEFAULT_XSTATUS_RESET); LoadDBCheckState(ppro, hwndDlg, IDC_KILLSPAMBOTS, "KillSpambots", DEFAULT_KILLSPAM_ENABLED); LoadDBCheckState(ppro, hwndDlg, IDC_AIMENABLE, "AimEnabled", DEFAULT_AIM_ENABLED); icq_EnableMultipleControls(hwndDlg, icqAimControls, _countof(icqAimControls), ppro->icqOnline() ? FALSE : TRUE); hCpCombo = GetDlgItem(hwndDlg, IDC_UTFCODEPAGE); int sCodePage = ppro->getWord("AnsiCodePage", CP_ACP); ComboBoxAddStringUtf(GetDlgItem(hwndDlg, IDC_UTFCODEPAGE), LPGEN("System default codepage"), 0); EnumSystemCodePagesA(FillCpCombo, CP_INSTALLED); if (sCodePage == 0) SendDlgItemMessage(hwndDlg, IDC_UTFCODEPAGE, CB_SETCURSEL, 0, 0); else { for (int i = 0; i < SendDlgItemMessage(hwndDlg, IDC_UTFCODEPAGE, CB_GETCOUNT, 0, 0); i++) { if (SendDlgItemMessage(hwndDlg, IDC_UTFCODEPAGE, CB_GETITEMDATA, (WPARAM)i, 0) == sCodePage) { SendDlgItemMessage(hwndDlg, IDC_UTFCODEPAGE, CB_SETCURSEL, (WPARAM)i, 0); break; } } } } return TRUE; case WM_COMMAND: switch (LOWORD(wParam)) { case IDC_UTFCODEPAGE: if (HIWORD(wParam) == CBN_SELCHANGE) OptDlgChanged(hwndDlg); break; case IDC_DCENABLE: icq_EnableMultipleControls(hwndDlg, icqDCMsgControls, _countof(icqDCMsgControls), IsDlgButtonChecked(hwndDlg, IDC_DCENABLE)); OptDlgChanged(hwndDlg); break; case IDC_XSTATUSENABLE: icq_EnableMultipleControls(hwndDlg, icqXStatusControls, _countof(icqXStatusControls), IsDlgButtonChecked(hwndDlg, IDC_XSTATUSENABLE)); case IDC_MOODSENABLE: icq_EnableMultipleControls(hwndDlg, icqCustomStatusControls, _countof(icqCustomStatusControls), IsDlgButtonChecked(hwndDlg, IDC_XSTATUSENABLE) || IsDlgButtonChecked(hwndDlg, IDC_MOODSENABLE)); default: OptDlgChanged(hwndDlg); break; } break; case WM_NOTIFY: switch (((LPNMHDR)lParam)->code) { case PSN_APPLY: int i = SendDlgItemMessage(hwndDlg, IDC_UTFCODEPAGE, CB_GETCURSEL, 0, 0); ppro->m_wAnsiCodepage = (WORD)SendDlgItemMessage(hwndDlg, IDC_UTFCODEPAGE, CB_GETITEMDATA, (WPARAM)i, 0); ppro->setWord("AnsiCodePage", ppro->m_wAnsiCodepage); ppro->m_bTempVisListEnabled = (BYTE)IsDlgButtonChecked(hwndDlg, IDC_TEMPVISIBLE); ppro->setByte("TempVisListEnabled", ppro->m_bTempVisListEnabled); StoreDBCheckState(ppro, hwndDlg, IDC_SLOWSEND, "SlowSend"); if (IsDlgButtonChecked(hwndDlg, IDC_DCENABLE)) ppro->m_bDCMsgEnabled = IsDlgButtonChecked(hwndDlg, IDC_DCPASSIVE) ? 1 : 2; else ppro->m_bDCMsgEnabled = 0; ppro->setByte("DirectMessaging", ppro->m_bDCMsgEnabled); ppro->m_bXStatusEnabled = (BYTE)IsDlgButtonChecked(hwndDlg, IDC_XSTATUSENABLE); ppro->setByte("XStatusEnabled", ppro->m_bXStatusEnabled); ppro->m_bMoodsEnabled = (BYTE)IsDlgButtonChecked(hwndDlg, IDC_MOODSENABLE); ppro->setByte("MoodsEnabled", ppro->m_bMoodsEnabled); StoreDBCheckState(ppro, hwndDlg, IDC_XSTATUSAUTO, "XStatusAuto"); StoreDBCheckState(ppro, hwndDlg, IDC_XSTATUSRESET, "XStatusReset"); StoreDBCheckState(ppro, hwndDlg, IDC_KILLSPAMBOTS, "KillSpambots"); StoreDBCheckState(ppro, hwndDlg, IDC_AIMENABLE, "AimEnabled"); return TRUE; } break; } return FALSE; }