fixed some resizing bugs Modified: trunk/reactos/lib/devmgr/hwpage.c _____
Modified: trunk/reactos/lib/devmgr/hwpage.c --- trunk/reactos/lib/devmgr/hwpage.c 2005-11-25 16:13:58 UTC (rev 19559) +++ trunk/reactos/lib/devmgr/hwpage.c 2005-11-25 16:30:41 UTC (rev 19560) @@ -58,6 +58,7 @@
HWND hWnd; HWND hWndDevList; HINSTANCE hComCtl32; /* only save this to keep track of the references */ + INT DevListViewHeight; SP_CLASSIMAGELIST_DATA ClassImageListData; HWPAGE_DISPLAYMODE DisplayMode;
@@ -188,8 +189,6 @@ if (HwNewDevInfo != NULL) { DevInfo->HwDevInfo = HwNewDevInfo; - DevInfo->HwDevInfo[DevInfo->ItemCount].ClassDevInfo = DevInfo; - DevInfo->HwDevInfo[DevInfo->ItemCount++].DevInfoData = DevInfoData; } else { @@ -203,18 +202,16 @@ DevInfo->HwDevInfo = HeapAlloc(GetProcessHeap(), 0, sizeof(HWDEVINFO)); - if (DevInfo->HwDevInfo != NULL) + if (DevInfo->HwDevInfo == NULL) { - DevInfo->HwDevInfo[DevInfo->ItemCount].ClassDevInfo = DevInfo; - DevInfo->HwDevInfo[DevInfo->ItemCount++].DevInfoData = DevInfoData; - } - else - { DPRINT1("Unable to allocate memory for a SP_DEVINFO_DATA structures!\n"); break; } }
+ DevInfo->HwDevInfo[DevInfo->ItemCount].ClassDevInfo = DevInfo; + DevInfo->HwDevInfo[DevInfo->ItemCount++].DevInfoData = DevInfoData; + if ((SetupDiGetDeviceRegistryProperty(DevInfo->hDevInfo, &DevInfoData,
SPDRP_FRIENDLYNAME, @@ -327,7 +324,7 @@ { HDWP dwp; HWND hControl, hButton; - INT Width, x, y, TopBias = 0; + INT Width, x, y; RECT rc, rcButton; POINT pt = {0}; POINT ptMargin = {0}; @@ -368,19 +365,14 @@ hpd->hWnd, &pt, 1); - if (hpd->DisplayMode == HWPD_LARGELIST) - { - /* increase the size of the list view control by 2/3 */ - TopBias = ((rc.bottom - rc.top) * 2) / 3; - } - y = pt.y + TopBias + rc.bottom - rc.top + ptMargin.y; + y = pt.y + hpd->DevListViewHeight + ptMargin.y; if (!(dwp = DeferWindowPos(dwp, hpd->hWndDevList, NULL, 0, 0, Width, - rc.bottom - rc.top + TopBias, + hpd->DevListViewHeight, SWP_NOMOVE | SWP_NOZORDER))) { return; @@ -572,9 +564,22 @@
SetupDiGetClassImageList(&hpd->ClassImageListData);
+ /* calculate the size of the devices list view control */ hpd->hWndDevList = GetDlgItem(hwndDlg, IDC_LV_DEVICES); + if (hpd->hWndDevList != NULL) + { + RECT rcClient; + GetClientRect(hpd->hWndDevList, + &rcClient); + hpd->DevListViewHeight = rcClient.bottom;
+ if (hpd->DisplayMode == HWPD_LARGELIST) + { + hpd->DevListViewHeight = (hpd->DevListViewHeight * 3) / 2; + } + } + /* subclass the parent window */ hWndParent = GetAncestor(hwndDlg, GA_PARENT); @@ -790,7 +795,6 @@ * NOTE * */ - HWND WINAPI DeviceCreateHardwarePage(IN HWND hWndParent,