/*++ Copyright (c) 1996 Microsoft Corporation Module Name: dialogs.c Abstract: This file implements the dialog proc for the server platforms page. Environment: WIN32 User Mode Author: Wesley Witt (wesw) 17-Feb-1996 --*/ #include "wizard.h" #pragma hdrstop LRESULT PlatformsDlgProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ) { static HWND hwndList; static DWORD RequireThisPlatform ; SYSTEM_INFO SystemInfo; switch( msg ) { case WM_INITDIALOG: { HIMAGELIST himlState; int iItem = 0; DWORD i; LV_ITEM lvi; LV_COLUMN lvc = {0}; GetSystemInfo( &SystemInfo ); if ( (SystemInfo.wProcessorArchitecture > 3) || (EnumPlatforms[SystemInfo.wProcessorArchitecture] == WRONG_PLATFORM ) ) { return FALSE; } RequireThisPlatform = EnumPlatforms[SystemInfo.wProcessorArchitecture]; if (InstallMode != INSTALL_NEW) { DWORD i, Mask; for (i=0,Mask=InstalledPlatforms; i> 1; } } if( RequireThisPlatform < 4 ) { Platforms[RequireThisPlatform].Selected = TRUE; } hwndList = GetDlgItem( hwnd, IDC_PLATFORM_LIST ); // // set/initialize the image list(s) // himlState = ImageList_Create( 16, 16, TRUE, 2, 0 ); ImageList_AddMasked( himlState, LoadBitmap( FaxWizModuleHandle, MAKEINTRESOURCE(IDB_CHECKSTATES) ), RGB (255,0,0) ); ListView_SetImageList( hwndList, himlState, LVSIL_STATE ); // // set/initialize the columns // lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM; lvc.fmt = LVCFMT_LEFT; lvc.cx = 274; lvc.pszText = TEXT("Platform"); lvc.iSubItem = 0; ListView_InsertColumn( hwndList, lvc.iSubItem, &lvc ); // // add the data to the list // for (i=0,lvi.iItem=0; icode ) { case PSN_SETACTIVE: if (Unattended) { WCHAR buf[128]; LPWSTR p = buf; DWORD i; UnAttendGetAnswer( UAA_PLATFORM_LIST, (LPBYTE) buf, sizeof(buf)/sizeof(WCHAR) ); p = wcstok( buf, L"," ); do { for (i=0; iwVKey == VK_SPACE) { INT index ; UINT state ; index = ListView_GetNextItem(hwndList, -1, LVNI_ALL|LVNI_SELECTED); if (index == -1) { return FALSE ; } // // Toggle. // state = ListView_GetItemState( hwndList, index, LVIS_STATEIMAGEMASK, ); if ((InstallMode & INSTALL_DRIVERS && ( 1 << index ) & InstalledPlatforms && state == LVIS_GCCHECK) || ( (DWORD)index == RequireThisPlatform)){ MessageBeep( MB_ICONEXCLAMATION ); } else { state = ( state == LVIS_GCNOCHECK )? LVIS_GCCHECK : LVIS_GCNOCHECK ; ListView_SetItemState( hwndList, index, state, LVIS_STATEIMAGEMASK ); Platforms[index].Selected = ( state == LVIS_GCCHECK ); } return TRUE; } break; } break; } return FALSE; }