fix displaying of current resolution

svn path=/trunk/; revision=30180
This commit is contained in:
Ged Murphy 2007-11-05 15:31:22 +00:00
parent 3df6ea56d3
commit a6cd1d84e7
3 changed files with 21 additions and 13 deletions

View file

@ -387,17 +387,9 @@ ByeBye:
static VOID static VOID
UpdateDisplay(IN HWND hwndDlg, PINFO pGlobalData, IN BOOL bUpdateThumb) UpdateDisplay(IN HWND hwndDlg, PINFO pGlobalData, IN BOOL bUpdateThumb)
{ {
TCHAR Buffer[64];
TCHAR Pixel[64];
DWORD index;
LoadString(hInst, IDS_PIXEL, Pixel, sizeof(Pixel) / sizeof(TCHAR));
_stprintf(Buffer, Pixel, pGlobalData->CurrentDisplayDevice->CurrentSettings->dmPelsWidth, pGlobalData->CurrentDisplayDevice->CurrentSettings->dmPelsHeight, Pixel);
//SendDlgItemMessage(pGlobalData->hDisplayPage, IDC_SETTINGS_RESOLUTION_TEXT, WM_SETTEXT, 0, (LPARAM)Buffer);
SetDlgItemText(pGlobalData->hDisplayPage, pGlobalData->hDisplayPage, Buffer);
if (LoadString(hInst, (2900 + pGlobalData->CurrentDisplayDevice->CurrentSettings->dmBitsPerPel), Buffer, sizeof(Buffer) / sizeof(TCHAR)))
SendDlgItemMessage(hwndDlg, IDC_GEOSLIDER, CB_SELECTSTRING, (WPARAM)-1, (LPARAM)Buffer);
} }
@ -405,6 +397,8 @@ static VOID
FillResolutionsAndColors(PINFO pInfo) FillResolutionsAndColors(PINFO pInfo)
{ {
PSETTINGS_ENTRY Current; PSETTINGS_ENTRY Current;
TCHAR Buffer[64];
TCHAR Pixel[64];
DWORD index, i, num; DWORD index, i, num;
DWORD MaxBpp = 0; DWORD MaxBpp = 0;
UINT HighBpp; UINT HighBpp;
@ -481,7 +475,21 @@ FillResolutionsAndColors(PINFO pInfo)
TRUE, TRUE,
MAKELONG(0, pInfo->DisplayDeviceList->ResolutionsCount)); //extra 1 for full screen MAKELONG(0, pInfo->DisplayDeviceList->ResolutionsCount)); //extra 1 for full screen
UpdateDisplay(pInfo->hDisplayPage, pInfo, TRUE); LoadString(hInst, IDS_PIXEL, Pixel, sizeof(Pixel) / sizeof(TCHAR));
_stprintf(Buffer, Pixel, pInfo->CurrentDisplayDevice->CurrentSettings->dmPelsWidth, pInfo->CurrentDisplayDevice->CurrentSettings->dmPelsHeight, Pixel);
SendDlgItemMessage(pInfo->hDisplayPage, IDC_SETTINGS_RESOLUTION_TEXT, WM_SETTEXT, 0, (LPARAM)Buffer);
for (index = 0; index < pInfo->CurrentDisplayDevice->ResolutionsCount; index++)
{
if (pInfo->CurrentDisplayDevice->Resolutions[index].dmPelsWidth == pInfo->CurrentDisplayDevice->CurrentSettings->dmPelsWidth &&
pInfo->CurrentDisplayDevice->Resolutions[index].dmPelsHeight == pInfo->CurrentDisplayDevice->CurrentSettings->dmPelsHeight)
{
SendDlgItemMessage(pInfo->hDisplayPage, IDC_GEOSLIDER, TBM_SETPOS, TRUE, index);
break;
}
}
//UpdateDisplay(pInfo->hDisplayPage, pInfo, TRUE);
} }

View file

@ -35,7 +35,7 @@ BEGIN
LTEXT "Note: Settings on the remote computer might override this setting.",IDC_STATIC,56,143,165,18 LTEXT "Note: Settings on the remote computer might override this setting.",IDC_STATIC,56,143,165,18
LTEXT "Less",IDC_STATIC,35,42,15,8 LTEXT "Less",IDC_STATIC,35,42,15,8
LTEXT "More",IDC_STATIC,189,42,17,8 LTEXT "More",IDC_STATIC,189,42,17,8
LTEXT "", IDC_SETTINGS_RESOLUTION_TEXT, 56, 62, 124, 10, SS_CENTER LTEXT "", IDC_SETTINGS_RESOLUTION_TEXT, 56, 62, 120, 10, SS_CENTER
END END
IDD_CONNECTDIALOG DIALOGEX 0, 0, 260, 267 IDD_CONNECTDIALOG DIALOGEX 0, 0, 260, 267

View file

@ -14,8 +14,8 @@
#define IDC_LOGONICON 1016 #define IDC_LOGONICON 1016
#define IDC_CONNICON 1017 #define IDC_CONNICON 1017
#define IDC_REMICON 1014 #define IDC_REMICON 1018
#define IDC_COLORSICON 1015 #define IDC_COLORSICON 1019
#define IDB_HEADER 1016 #define IDB_HEADER 1016
#define IDB_SPECT 1017 #define IDB_SPECT 1017