only display the troubleshoot button if necessary
Modified: trunk/reactos/lib/devmgr/En.rc
Modified: trunk/reactos/lib/devmgr/Pl.rc
Modified: trunk/reactos/lib/devmgr/hwpage.c

Modified: trunk/reactos/lib/devmgr/En.rc
--- trunk/reactos/lib/devmgr/En.rc	2005-11-25 21:38:37 UTC (rev 19573)
+++ trunk/reactos/lib/devmgr/En.rc	2005-11-25 22:01:19 UTC (rev 19574)
@@ -23,6 +23,7 @@
     LTEXT           "",IDC_MANUFACTURER,14,88,183,10,SS_ENDELLIPSIS
     LTEXT           "",IDC_LOCATION,14,100,183,10,SS_ENDELLIPSIS
     LTEXT           "",IDC_STATUS,14,112,183,30
-    PUSHBUTTON      "&Troubleshoot...",IDC_TROUBLESHOOT,85,140,54,14
+    PUSHBUTTON      "&Troubleshoot...",IDC_TROUBLESHOOT,85,140,54,14,
+                    BS_PUSHBUTTON | WS_CHILD | WS_DISABLED | WS_TABSTOP
     PUSHBUTTON      "P&roperties",IDC_PROPERTIES,146,140,50,14
 END

Modified: trunk/reactos/lib/devmgr/Pl.rc
--- trunk/reactos/lib/devmgr/Pl.rc	2005-11-25 21:38:37 UTC (rev 19573)
+++ trunk/reactos/lib/devmgr/Pl.rc	2005-11-25 22:01:19 UTC (rev 19574)
@@ -23,6 +23,7 @@
     LTEXT           "",IDC_MANUFACTURER,14,88,183,10,SS_ENDELLIPSIS
     LTEXT           "",IDC_LOCATION,14,100,183,10,SS_ENDELLIPSIS
     LTEXT           "",IDC_STATUS,14,112,183,30
-    PUSHBUTTON      "&Rozwi?zywanie problem¾w...",IDC_TROUBLESHOOT,85,140,54,14
+    PUSHBUTTON      "&Rozwi?zywanie problem¾w...",IDC_TROUBLESHOOT,85,140,54,14,
+                    BS_PUSHBUTTON | WS_CHILD | WS_DISABLED | WS_TABSTOP
     PUSHBUTTON      "&W?a£ciwo£ci",IDC_PROPERTIES,146,140,50,14
 END

Modified: trunk/reactos/lib/devmgr/hwpage.c
--- trunk/reactos/lib/devmgr/hwpage.c	2005-11-25 21:38:37 UTC (rev 19573)
+++ trunk/reactos/lib/devmgr/hwpage.c	2005-11-25 22:01:19 UTC (rev 19574)
@@ -502,6 +502,20 @@
 }
 
 
+static VOID
+EnableTroubleShoot(PHARDWARE_PAGE_DATA hpd,
+                   BOOL Enable)
+{
+    HWND hBtnTroubleShoot = GetDlgItem(hpd->hWnd,
+                                       IDC_TROUBLESHOOT);
+
+    EnableWindow(hBtnTroubleShoot,
+                 Enable);
+    ShowWindow(hBtnTroubleShoot,
+               Enable ? SW_SHOW : SW_HIDE);
+}
+
+
 static INT_PTR
 CALLBACK
 HardwareDlgProc(IN HWND hwndDlg,
@@ -548,6 +562,14 @@
                                   (INT)HIWORD(lParam));
                 break;            
 
+            case WM_SETTEXT:
+            {
+                LPCWSTR szWndText = (LPCWSTR)lParam;
+                EnableTroubleShoot(hpd,
+                                   (szWndText != NULL && szWndText[0] != L'\0'));
+                break;
+            }
+
             case WM_INITDIALOG:
             {
                 hpd = (PHARDWARE_PAGE_DATA)lParam;
@@ -618,6 +640,10 @@
 
                     /* fill the devices list view control */
                     FillDevicesList(hpd);
+
+                    /* decide whether to show or hide the troubleshoot button */
+                    EnableTroubleShoot(hpd,
+                                       GetWindowTextLength(hwndDlg) != 0);
                 }
                 break;
             }