void DSN_Set_Database(SQLHANDLE Connection) { MADB_Stmt *Stmt= NULL; SQLRETURN ret= SQL_ERROR; char Database[65]; MADB_Dsn *Dsn= (MADB_Dsn *)GetWindowLongPtr(GetParent(hwndTab[0]), DWLP_USER); if (DBFilled) return; GetDialogFields(); if (SQLAllocHandle(SQL_HANDLE_STMT, Connection, (SQLHANDLE *)&Stmt) != SQL_SUCCESS) goto end; if (SQLExecDirect((SQLHSTMT)Stmt, (SQLCHAR *)"SHOW DATABASES", SQL_NTS) != SQL_SUCCESS) goto end; SQLBindCol(Stmt, 1, SQL_C_CHAR, Database, 65, 0); ComboBox_ResetContent(GetDlgItem(hwndTab[1], cbDatabase)); while (SQLFetch(Stmt) == SQL_SUCCESS) ComboBox_InsertString(GetDlgItem(hwndTab[1], cbDatabase), -1, Database); if (Dsn->Catalog) { int Idx= ComboBox_FindString(GetDlgItem(hwndTab[2], cbDatabase), 0, Dsn->Catalog); ComboBox_SetCurSel(GetDlgItem(hwndTab[2], cbDatabase), Idx); } ComboBox_SetMinVisible(GetDlgItem(hwndTab[1], cbDatabase),5); DBFilled= TRUE; end: if (Stmt) SQLFreeHandle(SQL_HANDLE_STMT, (SQLHANDLE)Stmt); }
void DSN_Set_CharacterSets(SQLHANDLE Connection) { MADB_Stmt *Stmt= NULL; SQLRETURN ret= SQL_ERROR; char Charset[65]; MADB_Dsn *Dsn= (MADB_Dsn *)GetWindowLongPtr(GetParent(hwndTab[0]), DWLP_USER); if (CSFilled) return; GetDialogFields(); if (SQLAllocHandle(SQL_HANDLE_STMT, Connection, (SQLHANDLE *)&Stmt) != SQL_SUCCESS) goto end; if (SQLExecDirect((SQLHSTMT)Stmt, (SQLCHAR *)"select character_set_name from information_schema.collations " "WHERE character_set_name NOT LIKE 'utf16%' AND " "character_set_name NOT LIKE 'utf32%' AND " "character_set_name NOT LIKE 'ucs2' " "group by character_set_name order by character_set_name" , SQL_NTS) != SQL_SUCCESS) goto end; SQLBindCol(Stmt, 1, SQL_C_CHAR, Charset, 65, 0); ComboBox_ResetContent(GetDlgItem(hwndTab[2], cbCharset)); while (SQLFetch(Stmt) == SQL_SUCCESS) ComboBox_InsertString(GetDlgItem(hwndTab[2], cbCharset), -1, Charset); if (Dsn->CharacterSet) { int Idx= ComboBox_FindString(GetDlgItem(hwndTab[2], cbCharset), 0, Dsn->CharacterSet); ComboBox_SetCurSel(GetDlgItem(hwndTab[2], cbCharset), Idx); } ComboBox_SetMinVisible(GetDlgItem(hwndTab[2], cbCharset),5); CSFilled= TRUE; end: if (Stmt) SQLFreeHandle(SQL_HANDLE_STMT, (SQLHANDLE)Stmt); }
DWORD Init8021xControls(HWND hDlg, WLAN_CFG_PROPS *pWCP) { DWORD dwError; BOOL fEnabled; BOOL bCurSelSet = FALSE; HWND hwndCbEAPType = GetDlgItem(hDlg, IDC_WZC_COMBO_EAP_TYPE); int i; fEnabled = BOOLIFY(SHWZCF_NET_8021X & pWCP->wzcnet.dwFlags); SendMessage(GetDlgItem(hDlg, IDC_WZC_CHECK_ENABLE8021X), BM_SETCHECK, fEnabled ? BST_CHECKED : BST_UNCHECKED, 0); if (pWCP->pEapExtInfo == NULL) { // Load EAP extension info dwError = WZCEnumEapExtensions(&pWCP->dwNumEapExt,&pWCP->pEapExtInfo); if (dwError != ERROR_SUCCESS) { DEBUGMSG(ZONE_ERROR,(TEXT("!WZCUI:Error 0x%X loading EAP extensions\r\n"),dwError)); return dwError; } if (pWCP->dwNumEapExt > 0 && pWCP->pEapExtInfo) { PEAP_EXTENSION_INFO pCurExt; PWCHAR wszDefaultFriendlyName=NULL; for ( i = 0, pCurExt = pWCP->pEapExtInfo; i < (int)pWCP->dwNumEapExt; i++, pCurExt++) { // Add EAP types to combo box WZC_EAP_CB_ITEMDATA *pEapCbItemData = (WZC_EAP_CB_ITEMDATA *)LocalAlloc(LPTR,sizeof(WZC_EAP_CB_ITEMDATA)); int iListIndex; if (pEapCbItemData) { iListIndex = ComboBox_AddString(hwndCbEAPType, pCurExt->wszFriendlyName); pEapCbItemData->pEapExtInfo = pCurExt; ComboBox_SetItemData(hwndCbEAPType, iListIndex,pEapCbItemData); // For currently selected EAP type, store provider specific data if (fEnabled && pWCP->wzcnet.dwEAPType == pCurExt->dwExtensionType) { // Get the current EAP data pEapCbItemData->pbAuthData = (LPBYTE)pWCP->pvEapData; pEapCbItemData->dwAuthDataLen = pWCP->cbEapData; pWCP->pvEapData = NULL; // so we don't free it twice // Select this entry in the list ComboBox_SetCurSel(hwndCbEAPType, iListIndex); bCurSelSet = TRUE; } else if (pCurExt->dwExtensionType == DEFAULT_EAP_TYPE) { wszDefaultFriendlyName = pCurExt->wszFriendlyName; } } } // No matching providers, set to default if (pWCP->dwNumEapExt && !bCurSelSet) { UINT uResult=0; DEBUGMSG(ZONE_NETWORK,(TEXT("WZCUI: No matching providers for EAP type %d\r\n"), pWCP->wzcnet.dwEAPType)); if (wszDefaultFriendlyName) { uResult = ComboBox_FindString(hwndCbEAPType, -1, wszDefaultFriendlyName); if (uResult == CB_ERR) uResult = 0; } ComboBox_SetCurSel(hwndCbEAPType, uResult); } } } return ERROR_SUCCESS; }
void ComboBoxAddRes(HWND hWC,char * cs) { int i=ComboBox_FindString(hWC,-1,cs); if(i!=CB_ERR) return; ComboBox_AddString(hWC,cs); }
BOOL OnInitSoftDialog(HWND hW) { HWND hWC;char cs[256];int i;DEVMODE dv; ReadConfig(); // read registry stuff if(szDevName[0]) SetDlgItemText(hW,IDC_DEVICETXT,szDevName); hWC=GetDlgItem(hW,IDC_RESOLUTION); memset(&dv,0,sizeof(DEVMODE)); dv.dmSize=sizeof(DEVMODE); i=0; while(EnumDisplaySettings(NULL,i,&dv)) { wsprintf(cs,"%4d x %4d - default",dv.dmPelsWidth,dv.dmPelsHeight); ComboBoxAddRes(hWC,cs); if(dv.dmDisplayFrequency > 40 && dv.dmDisplayFrequency < 200 ) { wsprintf(cs,"%4d x %4d , %4d Hz",dv.dmPelsWidth,dv.dmPelsHeight,dv.dmDisplayFrequency); ComboBoxAddRes(hWC,cs); } i++; } ComboBoxAddRes(hWC," 320 x 200 - default"); ComboBoxAddRes(hWC," 320 x 240 - default"); ComboBoxAddRes(hWC," 400 x 300 - default"); ComboBoxAddRes(hWC," 512 x 384 - default"); ComboBoxAddRes(hWC," 640 x 480 - default"); ComboBoxAddRes(hWC," 800 x 600 - default"); ComboBoxAddRes(hWC,"1024 x 768 - default"); ComboBoxAddRes(hWC,"1152 x 864 - default"); ComboBoxAddRes(hWC,"1280 x 1024 - default"); ComboBoxAddRes(hWC,"1600 x 1200 - default"); if(iRefreshRate) wsprintf(cs,"%4d x %4d , %4d Hz",iResX,iResY,iRefreshRate); else wsprintf(cs,"%4d x %4d - default",iResX,iResY); i=ComboBox_FindString(hWC,-1,cs); if(i==CB_ERR) i=0; ComboBox_SetCurSel(hWC,i); hWC=GetDlgItem(hW,IDC_COLDEPTH); ComboBox_AddString(hWC,"16 Bit"); ComboBox_AddString(hWC,"32 Bit"); wsprintf(cs,"%d Bit",iColDepth); // resolution i=ComboBox_FindString(hWC,-1,cs); if(i==CB_ERR) i=0; ComboBox_SetCurSel(hWC,i); hWC=GetDlgItem(hW,IDC_SCANLINES); ComboBox_AddString(hWC,"Scanlines disabled"); ComboBox_AddString(hWC,"Scanlines enabled (standard)"); ComboBox_AddString(hWC,"Scanlines enabled (double blitting - nVidia fix)"); ComboBox_SetCurSel(hWC,iUseScanLines); SetDlgItemInt(hW,IDC_WINX,LOWORD(iWinSize),FALSE); // window size SetDlgItemInt(hW,IDC_WINY,HIWORD(iWinSize),FALSE); if(UseFrameLimit) CheckDlgButton(hW,IDC_USELIMIT,TRUE); if(UseFrameSkip) CheckDlgButton(hW,IDC_USESKIPPING,TRUE); if(iWindowMode) CheckRadioButton(hW,IDC_DISPMODE1,IDC_DISPMODE2,IDC_DISPMODE2); else CheckRadioButton(hW,IDC_DISPMODE1,IDC_DISPMODE2,IDC_DISPMODE1); if(iSysMemory) CheckDlgButton(hW,IDC_SYSMEMORY,TRUE); if(iStopSaver) CheckDlgButton(hW,IDC_STOPSAVER,TRUE); if(iUseFixes) CheckDlgButton(hW,IDC_GAMEFIX,TRUE); if(iShowFPS) CheckDlgButton(hW,IDC_SHOWFPS,TRUE); if(bVsync) CheckDlgButton(hW,IDC_VSYNC,TRUE); if(bTransparent) CheckDlgButton(hW,IDC_TRANSPARENT,TRUE); if(iDebugMode) CheckDlgButton(hW,IDC_DEBUGMODE,TRUE); hWC=GetDlgItem(hW,IDC_NOSTRETCH); // streching ComboBox_AddString(hWC,"Stretch to full window size"); ComboBox_AddString(hWC,"1:1 (faster with some cards)"); ComboBox_AddString(hWC,"Scale to window size, keep aspect ratio"); ComboBox_AddString(hWC,"2xSaI stretching (needs a fast cpu)"); ComboBox_AddString(hWC,"2xSaI unstretched (needs a fast cpu)"); ComboBox_AddString(hWC,"Super2xSaI stretching (needs a very fast cpu)"); ComboBox_AddString(hWC,"Super2xSaI unstretched (needs a very fast cpu)"); ComboBox_AddString(hWC,"SuperEagle stretching (needs a fast cpu)"); ComboBox_AddString(hWC,"SuperEagle unstretched (needs a fast cpu)"); ComboBox_AddString(hWC,"Scale2x stretching (needs a fast cpu)"); ComboBox_AddString(hWC,"Scale2x unstretched (needs a fast cpu)"); ComboBox_AddString(hWC,"HQ2X unstretched (needs a fast cpu)"); ComboBox_AddString(hWC,"HQ2X streched (needs a fast cpu)"); ComboBox_AddString(hWC,"Scale3x stretching (needs a fast cpu)"); ComboBox_AddString(hWC,"Scale3x unstretched (needs a fast cpu)"); ComboBox_AddString(hWC,"HQ3X unstretched (needs a fast cpu)"); ComboBox_SetCurSel(hWC,iUseNoStretchBlt); hWC=GetDlgItem(hW,IDC_DITHER); // dithering ComboBox_AddString(hWC,"No dithering (fastest)"); ComboBox_AddString(hWC,"Game dependend dithering (slow)"); ComboBox_AddString(hWC,"Always dither g-shaded polygons (slowest)"); ComboBox_SetCurSel(hWC,iUseDither); if(iFrameLimit==2) // frame limit wrapper CheckDlgButton(hW,IDC_FRAMEAUTO,TRUE); else CheckDlgButton(hW,IDC_FRAMEMANUELL,TRUE); sprintf(cs,"%.1f",fFrameRate); SetDlgItemText(hW,IDC_FRAMELIM,cs); // set frame rate return TRUE; }