Author: ekohl
Date: Tue Mar 20 22:11:51 2012
New Revision: 56197
URL:
http://svn.reactos.org/svn/reactos?rev=56197&view=rev
Log:
[DEVMGMT]
Implement the 'View/Devices by Connection' feature. It runs very well on windows
XP but fails on ReactOS. Needs to be investigated.
Modified:
trunk/reactos/base/applications/mscutils/devmgmt/enumdevices.c
trunk/reactos/base/applications/mscutils/devmgmt/lang/bg-BG.rc
trunk/reactos/base/applications/mscutils/devmgmt/lang/cs-CZ.rc
trunk/reactos/base/applications/mscutils/devmgmt/lang/de-DE.rc
trunk/reactos/base/applications/mscutils/devmgmt/lang/el-GR.rc
trunk/reactos/base/applications/mscutils/devmgmt/lang/en-US.rc
trunk/reactos/base/applications/mscutils/devmgmt/lang/es-ES.rc
trunk/reactos/base/applications/mscutils/devmgmt/lang/fr-FR.rc
trunk/reactos/base/applications/mscutils/devmgmt/lang/id-ID.rc
trunk/reactos/base/applications/mscutils/devmgmt/lang/it-IT.rc
trunk/reactos/base/applications/mscutils/devmgmt/lang/ja-JP.rc
trunk/reactos/base/applications/mscutils/devmgmt/lang/ko-KR.rc
trunk/reactos/base/applications/mscutils/devmgmt/lang/no-NO.rc
trunk/reactos/base/applications/mscutils/devmgmt/lang/pl-PL.rc
trunk/reactos/base/applications/mscutils/devmgmt/lang/ro-RO.rc
trunk/reactos/base/applications/mscutils/devmgmt/lang/ru-RU.rc
trunk/reactos/base/applications/mscutils/devmgmt/lang/sk-SK.rc
trunk/reactos/base/applications/mscutils/devmgmt/lang/sv-SE.rc
trunk/reactos/base/applications/mscutils/devmgmt/lang/th-TH.rc
trunk/reactos/base/applications/mscutils/devmgmt/lang/uk-UA.rc
trunk/reactos/base/applications/mscutils/devmgmt/lang/zh-CN.rc
trunk/reactos/base/applications/mscutils/devmgmt/mainwnd.c
trunk/reactos/base/applications/mscutils/devmgmt/precomp.h
trunk/reactos/base/applications/mscutils/devmgmt/resource.h
Modified: trunk/reactos/base/applications/mscutils/devmgmt/enumdevices.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/devmgmt/enumdevices.c [iso-8859-1]
(original)
+++ trunk/reactos/base/applications/mscutils/devmgmt/enumdevices.c [iso-8859-1] Tue Mar 20
22:11:51 2012
@@ -421,6 +421,165 @@
}
+static HTREEITEM
+AddDeviceToTree(HWND hTreeView,
+ HTREEITEM hRoot,
+ DEVINST dnDevInst)
+{
+ TCHAR DevName[MAX_DEV_LEN];
+ TCHAR FriendlyName[MAX_DEV_LEN];
+ TCHAR ClassGuidString[MAX_GUID_STRING_LEN];
+ GUID ClassGuid;
+ ULONG ulLength;
+ LPTSTR DeviceID;
+ INT ClassImage = 24;
+ CONFIGRET cr;
+
+ cr = CM_Get_Device_ID(dnDevInst,
+ DevName,
+ MAX_DEV_LEN,
+ 0);
+ if (cr != CR_SUCCESS)
+ return NULL;
+
+ ulLength = MAX_DEV_LEN * sizeof(TCHAR);
+ cr = CM_Get_DevNode_Registry_Property(dnDevInst,
+ CM_DRP_FRIENDLYNAME,
+ NULL,
+ FriendlyName,
+ &ulLength,
+ 0);
+ if (cr != CR_SUCCESS)
+ {
+ ulLength = MAX_DEV_LEN * sizeof(TCHAR);
+ cr = CM_Get_DevNode_Registry_Property(dnDevInst,
+ CM_DRP_DEVICEDESC,
+ NULL,
+ FriendlyName,
+ &ulLength,
+ 0);
+ if (cr != CR_SUCCESS)
+ return NULL;
+ }
+
+ ulLength = MAX_GUID_STRING_LEN * sizeof(TCHAR);
+ cr = CM_Get_DevNode_Registry_Property(dnDevInst,
+ CM_DRP_CLASSGUID,
+ NULL,
+ ClassGuidString,
+ &ulLength,
+ 0);
+ if (cr == CR_SUCCESS)
+ {
+ pSetupGuidFromString(ClassGuidString, &ClassGuid);
+
+ if (!SetupDiGetClassImageIndex(&ImageListData,
+ &ClassGuid,
+ &ClassImage))
+ {
+ /* FIXME: can we do this?
+ * Set the blank icon: IDI_SETUPAPI_BLANK = 41
+ * it'll be image 24 in the imagelist */
+ ClassImage = 24;
+ }
+ }
+
+ if (DevName != NULL)
+ {
+ DeviceID = HeapAlloc(GetProcessHeap(),
+ 0,
+ (lstrlen(DevName) + 1) * sizeof(TCHAR));
+ if (DeviceID == NULL)
+ {
+ return NULL;
+ }
+
+ lstrcpy(DeviceID, DevName);
+ }
+
+ return InsertIntoTreeView(hTreeView,
+ hRoot,
+ FriendlyName,
+ DeviceID,
+ ClassImage,
+ 0);
+}
+
+
+static VOID
+EnumChildDevices(HWND hTreeView,
+ HTREEITEM hRoot,
+ DEVINST dnParentDevInst)
+{
+ HTREEITEM hDevItem;
+ DEVINST dnDevInst;
+ CONFIGRET cr;
+
+ cr = CM_Get_Child(&dnDevInst,
+ dnParentDevInst,
+ 0);
+ if (cr != CR_SUCCESS)
+ return;
+
+ hDevItem = AddDeviceToTree(hTreeView,
+ hRoot,
+ dnDevInst);
+ if (hDevItem == NULL)
+ return;
+
+ EnumChildDevices(hTreeView,
+ hDevItem,
+ dnDevInst);
+
+ while (cr == CR_SUCCESS)
+ {
+ cr = CM_Get_Sibling(&dnDevInst,
+ dnDevInst,
+ 0);
+ if (cr != CR_SUCCESS)
+ break;
+
+ hDevItem = AddDeviceToTree(hTreeView,
+ hRoot,
+ dnDevInst);
+ if (hDevItem == NULL)
+ break;
+
+ EnumChildDevices(hTreeView,
+ hDevItem,
+ dnDevInst);
+ }
+
+ (void)TreeView_SortChildren(hTreeView,
+ hRoot,
+ 0);
+}
+
+
+VOID
+ListDevicesByConnection(HWND hTreeView,
+ HTREEITEM hRoot)
+{
+ DEVINST devInst;
+ CONFIGRET cr;
+
+ cr = CM_Locate_DevNode(&devInst,
+ NULL,
+ CM_LOCATE_DEVNODE_NORMAL);
+ if (cr == CR_SUCCESS)
+ EnumChildDevices(hTreeView,
+ hRoot,
+ devInst);
+
+ (void)TreeView_Expand(hTreeView,
+ hRoot,
+ TVE_EXPAND);
+
+ (void)TreeView_SelectItem(hTreeView,
+ hRoot);
+}
+
+
HTREEITEM
InitTreeView(HWND hTreeView)
{
Modified: trunk/reactos/base/applications/mscutils/devmgmt/lang/bg-BG.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/devmgmt/lang/bg-BG.rc [iso-8859-1]
(original)
+++ trunk/reactos/base/applications/mscutils/devmgmt/lang/bg-BG.rc [iso-8859-1] Tue Mar 20
22:11:51 2012
@@ -1,4 +1,4 @@
-LANGUAGE LANG_BULGARIAN, SUBLANG_DEFAULT
+LANGUAGE LANG_BULGARIAN, SUBLANG_DEFAULT
IDR_MAINMENU MENU
BEGIN
@@ -16,10 +16,10 @@
END
POPUP "Ðзглед"
BEGIN
- MENUITEM "УÑÑÑойÑÑваÑа ÑпоÑед вид",
IDC_DEVBYTYPE, CHECKED
- MENUITEM "УÑÑÑойÑÑваÑа ÑпоÑед ÑвÑÑзванеÑо",
IDC_STATIC, GRAYED
- MENUITEM "СÑедÑÑваÑа ÑпоÑед вида", IDC_STATIC,
GRAYED
- MENUITEM "СÑедÑÑваÑа ÑпоÑед ÑвÑÑзванеÑо",
IDC_STATIC, GRAYED
+ MENUITEM "УÑÑÑойÑÑваÑа ÑпоÑед вид",
IDC_DEVBYTYPE
+ MENUITEM "УÑÑÑойÑÑваÑа ÑпоÑед ÑвÑÑзванеÑо",
IDC_DEVBYCONN
+ MENUITEM "СÑедÑÑваÑа ÑпоÑед вида", IDC_RESBYTYPE,
GRAYED
+ MENUITEM "СÑедÑÑваÑа ÑпоÑед ÑвÑÑзванеÑо",
IDC_RESBYCONN, GRAYED
END
POPUP "ÐомоÑ"
BEGIN
Modified: trunk/reactos/base/applications/mscutils/devmgmt/lang/cs-CZ.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/devmgmt/lang/cs-CZ.rc [iso-8859-1]
(original)
+++ trunk/reactos/base/applications/mscutils/devmgmt/lang/cs-CZ.rc [iso-8859-1] Tue Mar 20
22:11:51 2012
@@ -16,10 +16,10 @@
END
POPUP "&ZobrazenÃ"
BEGIN
- MENUITEM "ZaÅÃzenà podle typu", IDC_DEVBYTYPE, CHECKED
- MENUITEM "ZaÅÃzenà podle pÅipojenÃ", IDC_STATIC, GRAYED
- MENUITEM "ProstÅedky podle typu", IDC_STATIC, GRAYED
- MENUITEM "ProstÅedky podle pÅipojenÃ", IDC_STATIC, GRAYED
+ MENUITEM "ZaÅÃzenà podle typu", IDC_DEVBYTYPE
+ MENUITEM "ZaÅÃzenà podle pÅipojenÃ", IDC_DEVBYCONN
+ MENUITEM "ProstÅedky podle typu", IDC_RESBYTYPE, GRAYED
+ MENUITEM "ProstÅedky podle pÅipojenÃ", IDC_RESBYCONN, GRAYED
END
POPUP "NápovÄda"
BEGIN
Modified: trunk/reactos/base/applications/mscutils/devmgmt/lang/de-DE.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/devmgmt/lang/de-DE.rc [iso-8859-1]
(original)
+++ trunk/reactos/base/applications/mscutils/devmgmt/lang/de-DE.rc [iso-8859-1] Tue Mar 20
22:11:51 2012
@@ -4,27 +4,27 @@
BEGIN
POPUP "&Datei"
BEGIN
- MENUITEM "&Beenden", IDC_EXIT
+ MENUITEM "&Beenden", IDC_EXIT
END
POPUP "Aktion"
BEGIN
MENUITEM "Drucken", IDC_PRINT, GRAYED
MENUITEM SEPARATOR
- MENUITEM "Eigenschaften", IDC_PROP, GRAYED
+ MENUITEM "Eigenschaften", IDC_PROP, GRAYED
MENUITEM SEPARATOR
- MENUITEM "Hilfe", IDC_PROGHELP, GRAYED
+ MENUITEM "Hilfe", IDC_PROGHELP, GRAYED
END
POPUP "Ansicht"
BEGIN
- MENUITEM "Geräte nach Typ", IDC_DEVBYTYPE, CHECKED
- MENUITEM "Geräte nach Verbindung", IDC_STATIC, GRAYED
- MENUITEM "Resourcen nach Typ", IDC_STATIC, GRAYED
- MENUITEM "Resourcen nach Verbindung", IDC_STATIC, GRAYED
+ MENUITEM "Geräte nach Typ", IDC_DEVBYTYPE
+ MENUITEM "Geräte nach Verbindung", IDC_DEVBYCONN
+ MENUITEM "Resourcen nach Typ", IDC_RESBYTYPE, GRAYED
+ MENUITEM "Resourcen nach Verbindung", IDC_RESBYCONN, GRAYED
END
POPUP "&?"
BEGIN
- MENUITEM "Hilfe", IDC_PROGHELP
- MENUITEM "Info", IDC_ABOUT
+ MENUITEM "Hilfe", IDC_PROGHELP
+ MENUITEM "Info", IDC_ABOUT
END
END
@@ -32,9 +32,9 @@
BEGIN
POPUP "popup"
BEGIN
- MENUITEM "Eigenschaften", IDC_PROP, GRAYED
+ MENUITEM "Eigenschaften", IDC_PROP, GRAYED
MENUITEM SEPARATOR
- MENUITEM "Hilfe", IDC_PROGHELP
+ MENUITEM "Hilfe", IDC_PROGHELP
END
END
Modified: trunk/reactos/base/applications/mscutils/devmgmt/lang/el-GR.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/devmgmt/lang/el-GR.rc [iso-8859-1]
(original)
+++ trunk/reactos/base/applications/mscutils/devmgmt/lang/el-GR.rc [iso-8859-1] Tue Mar 20
22:11:51 2012
@@ -1,4 +1,4 @@
-LANGUAGE LANG_GREEK, SUBLANG_DEFAULT
+LANGUAGE LANG_GREEK, SUBLANG_DEFAULT
IDR_MAINMENU MENU
BEGIN
@@ -16,10 +16,10 @@
END
POPUP "ÎμÏάνιÏη"
BEGIN
- MENUITEM "ΣÏ
ÏκεÏ
ÎÏ Î±Î½Î¬ ÏÏÏο", IDC_DEVBYTYPE, CHECKED
- MENUITEM "ΣÏ
ÏκεÏ
ÎÏ Î±Î½Î¬ ÏÏνδεÏη", IDC_STATIC, GRAYED
- MENUITEM "ΠηγÎÏ Î±Î½Î¬ ÏÏÏο", IDC_STATIC, GRAYED
- MENUITEM "ΠηγÎÏ Î±Î½Î¬ ÏÏνδεÏη", IDC_STATIC, GRAYED
+ MENUITEM "ΣÏ
ÏκεÏ
ÎÏ Î±Î½Î¬ ÏÏÏο", IDC_DEVBYTYPE
+ MENUITEM "ΣÏ
ÏκεÏ
ÎÏ Î±Î½Î¬ ÏÏνδεÏη", IDC_DEVBYCONN
+ MENUITEM "ΠηγÎÏ Î±Î½Î¬ ÏÏÏο", IDC_RESBYTYPE, GRAYED
+ MENUITEM "ΠηγÎÏ Î±Î½Î¬ ÏÏνδεÏη", IDC_RESBYCONN, GRAYED
END
POPUP "Îοήθεια"
BEGIN
Modified: trunk/reactos/base/applications/mscutils/devmgmt/lang/en-US.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/devmgmt/lang/en-US.rc [iso-8859-1]
(original)
+++ trunk/reactos/base/applications/mscutils/devmgmt/lang/en-US.rc [iso-8859-1] Tue Mar 20
22:11:51 2012
@@ -16,10 +16,10 @@
END
POPUP "View"
BEGIN
- MENUITEM "Devices by type", IDC_DEVBYTYPE, CHECKED
- MENUITEM "Devices by connection", IDC_STATIC, GRAYED
- MENUITEM "Resources by type", IDC_STATIC, GRAYED
- MENUITEM "Resources by connection", IDC_STATIC, GRAYED
+ MENUITEM "Devices by type", IDC_DEVBYTYPE
+ MENUITEM "Devices by connection", IDC_DEVBYCONN
+ MENUITEM "Resources by type", IDC_RESBYTYPE, GRAYED
+ MENUITEM "Resources by connection", IDC_RESBYCONN, GRAYED
END
POPUP "Help"
BEGIN
Modified: trunk/reactos/base/applications/mscutils/devmgmt/lang/es-ES.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/devmgmt/lang/es-ES.rc [iso-8859-1]
(original)
+++ trunk/reactos/base/applications/mscutils/devmgmt/lang/es-ES.rc [iso-8859-1] Tue Mar 20
22:11:51 2012
@@ -1,4 +1,4 @@
-/*
+/*
* Spanish Language resource file
* Traducido por: Javier Remacha 2007-12-21
*/
@@ -21,10 +21,10 @@
END
POPUP "Ver"
BEGIN
- MENUITEM "Dispositivos por tipo", IDC_DEVBYTYPE, CHECKED
- MENUITEM "Dispositivos por conexión", IDC_STATIC, GRAYED
- MENUITEM "Recursos por tipo", IDC_STATIC, GRAYED
- MENUITEM "Recursos por conexión", IDC_STATIC, GRAYED
+ MENUITEM "Dispositivos por tipo", IDC_DEVBYTYPE
+ MENUITEM "Dispositivos por conexión", IDC_DEVBYCONN
+ MENUITEM "Recursos por tipo", IDC_RESBYTYPE, GRAYED
+ MENUITEM "Recursos por conexión", IDC_RESBYCONN, GRAYED
END
POPUP "Ayuda"
BEGIN
Modified: trunk/reactos/base/applications/mscutils/devmgmt/lang/fr-FR.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/devmgmt/lang/fr-FR.rc [iso-8859-1]
(original)
+++ trunk/reactos/base/applications/mscutils/devmgmt/lang/fr-FR.rc [iso-8859-1] Tue Mar 20
22:11:51 2012
@@ -1,4 +1,4 @@
-LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL
+LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL
IDR_MAINMENU MENU
BEGIN
@@ -16,10 +16,10 @@
END
POPUP "Affichage"
BEGIN
- MENUITEM "Périphériques par type", IDC_DEVBYTYPE, CHECKED
- MENUITEM "Périphériques par connexion", IDC_STATIC, GRAYED
- MENUITEM "Ressources par type", IDC_STATIC, GRAYED
- MENUITEM "Ressources par connexion", IDC_STATIC, GRAYED
+ MENUITEM "Périphériques par type", IDC_DEVBYTYPE
+ MENUITEM "Périphériques par connexion", IDC_DEVBYCONN
+ MENUITEM "Ressources par type", IDC_RESBYTYPE, GRAYED
+ MENUITEM "Ressources par connexion", IDC_RESBYCONN, GRAYED
END
POPUP "Aide"
BEGIN
Modified: trunk/reactos/base/applications/mscutils/devmgmt/lang/id-ID.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/devmgmt/lang/id-ID.rc [iso-8859-1]
(original)
+++ trunk/reactos/base/applications/mscutils/devmgmt/lang/id-ID.rc [iso-8859-1] Tue Mar 20
22:11:51 2012
@@ -16,10 +16,10 @@
END
POPUP "Lihat"
BEGIN
- MENUITEM "Device dengan tipe", IDC_DEVBYTYPE, CHECKED
- MENUITEM "Device dengan koneksi", IDC_STATIC, GRAYED
- MENUITEM "Resource dengan tipe", IDC_STATIC, GRAYED
- MENUITEM "Resource dengan koneksi", IDC_STATIC, GRAYED
+ MENUITEM "Device dengan tipe", IDC_DEVBYTYPE
+ MENUITEM "Device dengan koneksi", IDC_DEVBYCONN
+ MENUITEM "Resource dengan tipe", IDC_RESBYTYPE, GRAYED
+ MENUITEM "Resource dengan koneksi", IDC_RESBYCONN, GRAYED
END
POPUP "Bantuan"
BEGIN
Modified: trunk/reactos/base/applications/mscutils/devmgmt/lang/it-IT.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/devmgmt/lang/it-IT.rc [iso-8859-1]
(original)
+++ trunk/reactos/base/applications/mscutils/devmgmt/lang/it-IT.rc [iso-8859-1] Tue Mar 20
22:11:51 2012
@@ -1,4 +1,4 @@
-LANGUAGE LANG_ITALIAN, SUBLANG_NEUTRAL
+LANGUAGE LANG_ITALIAN, SUBLANG_NEUTRAL
IDR_MAINMENU MENU
BEGIN
@@ -16,10 +16,10 @@
END
POPUP "Visualizza"
BEGIN
- MENUITEM "Dispositivi per tipo", IDC_DEVBYTYPE, CHECKED
- MENUITEM "Dispositivi per connessione", IDC_STATIC, GRAYED
- MENUITEM "Risorse per tipo", IDC_STATIC, GRAYED
- MENUITEM "Risorse per connessione", IDC_STATIC, GRAYED
+ MENUITEM "Dispositivi per tipo", IDC_DEVBYTYPE
+ MENUITEM "Dispositivi per connessione", IDC_DEVBYCONN
+ MENUITEM "Risorse per tipo", IDC_RESBYTYPE, GRAYED
+ MENUITEM "Risorse per connessione", IDC_RESBYCONN, GRAYED
END
POPUP "Aiuto"
BEGIN
Modified: trunk/reactos/base/applications/mscutils/devmgmt/lang/ja-JP.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/devmgmt/lang/ja-JP.rc [iso-8859-1]
(original)
+++ trunk/reactos/base/applications/mscutils/devmgmt/lang/ja-JP.rc [iso-8859-1] Tue Mar 20
22:11:51 2012
@@ -1,4 +1,4 @@
-LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT
+LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT
IDR_MAINMENU MENU
BEGIN
@@ -16,10 +16,10 @@
END
POPUP "表 示"
BEGIN
- MENUITEM "ããã¤ã¹ (種é¡å¥)", IDC_DEVBYTYPE, CHECKED
- MENUITEM "ããã¤ã¹ (æ¥ç¶å¥)", IDC_STATIC, GRAYED
- MENUITEM "ãªã½ ã¼ã¹ (種é¡å¥)", IDC_STATIC, GRAYED
- MENUITEM "ãªã½ ã¼ã¹ (æ¥ç¶å¥)", IDC_STATIC, GRAYED
+ MENUITEM "ããã¤ã¹ (種é¡å¥)", IDC_DEVBYTYPE
+ MENUITEM "ããã¤ã¹ (æ¥ç¶å¥)", IDC_DEVBYCONN
+ MENUITEM "ãªã½ ã¼ã¹ (種é¡å¥)", IDC_RESBYTYPE, GRAYED
+ MENUITEM "ãªã½ ã¼ã¹ (æ¥ç¶å¥)", IDC_RESBYCONN, GRAYED
END
POPUP "ãã«ã"
BEGIN
Modified: trunk/reactos/base/applications/mscutils/devmgmt/lang/ko-KR.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/devmgmt/lang/ko-KR.rc [iso-8859-1]
(original)
+++ trunk/reactos/base/applications/mscutils/devmgmt/lang/ko-KR.rc [iso-8859-1] Tue Mar 20
22:11:51 2012
@@ -1,4 +1,4 @@
-/*
+/*
* Korean translation by manatails007(www.manatails007.org)
*/
@@ -20,10 +20,10 @@
END
POPUP "보기"
BEGIN
- MENUITEM "Devices by type", IDC_DEVBYTYPE, CHECKED
- MENUITEM "Devices by connection", IDC_STATIC, GRAYED
- MENUITEM "Resources by type", IDC_STATIC, GRAYED
- MENUITEM "Resources by connection", IDC_STATIC, GRAYED
+ MENUITEM "Devices by type", IDC_DEVBYTYPE
+ MENUITEM "Devices by connection", IDC_DEVBYCONN
+ MENUITEM "Resources by type", IDC_RESBYTYPE, GRAYED
+ MENUITEM "Resources by connection", IDC_RESBYCONN, GRAYED
END
POPUP "ëìë§"
BEGIN
Modified: trunk/reactos/base/applications/mscutils/devmgmt/lang/no-NO.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/devmgmt/lang/no-NO.rc [iso-8859-1]
(original)
+++ trunk/reactos/base/applications/mscutils/devmgmt/lang/no-NO.rc [iso-8859-1] Tue Mar 20
22:11:51 2012
@@ -1,4 +1,4 @@
-LANGUAGE LANG_NORWEGIAN, SUBLANG_NEUTRAL
+LANGUAGE LANG_NORWEGIAN, SUBLANG_NEUTRAL
IDR_MAINMENU MENU
BEGIN
@@ -16,10 +16,10 @@
END
POPUP "Vis"
BEGIN
- MENUITEM "Enheter etter type", IDC_DEVBYTYPE, CHECKED
- MENUITEM "Enheter etter tilkobling", IDC_STATIC, GRAYED
- MENUITEM "Ressurser etter type", IDC_STATIC, GRAYED
- MENUITEM "Ressurser etter tilkobling", IDC_STATIC, GRAYED
+ MENUITEM "Enheter etter type", IDC_DEVBYTYPE
+ MENUITEM "Enheter etter tilkobling", IDC_DEVBYCONN
+ MENUITEM "Ressurser etter type", IDC_RESBYTYPE, GRAYED
+ MENUITEM "Ressurser etter tilkobling", IDC_RESBYCONN, GRAYED
END
POPUP "Hjelp"
BEGIN
Modified: trunk/reactos/base/applications/mscutils/devmgmt/lang/pl-PL.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/devmgmt/lang/pl-PL.rc [iso-8859-1]
(original)
+++ trunk/reactos/base/applications/mscutils/devmgmt/lang/pl-PL.rc [iso-8859-1] Tue Mar 20
22:11:51 2012
@@ -1,4 +1,4 @@
-/*
+/*
* translated by xrogers
* xxrogers(a)users.sourceforge.net
*
https://sourceforge.net/projects/reactospl
@@ -23,10 +23,10 @@
END
POPUP "&Widok"
BEGIN
- MENUITEM "UrzÄ
dzenia w&edÅug typu", IDC_DEVBYTYPE, CHECKED
- MENUITEM "Ur&zÄ
dzenia wedÅug poÅÄ
czenia", IDC_STATIC, GRAYED
- MENUITEM "Zaso&by wedÅug typu", IDC_STATIC, GRAYED
- MENUITEM "Za&soby wedÅug poÅÄ
czenia", IDC_STATIC, GRAYED
+ MENUITEM "UrzÄ
dzenia w&edÅug typu", IDC_DEVBYTYPE
+ MENUITEM "Ur&zÄ
dzenia wedÅug poÅÄ
czenia", IDC_DEVBYCONN
+ MENUITEM "Zaso&by wedÅug typu", IDC_RESBYTYPE, GRAYED
+ MENUITEM "Za&soby wedÅug poÅÄ
czenia", IDC_RESBYCONN, GRAYED
END
POPUP "Pomo&c"
BEGIN
Modified: trunk/reactos/base/applications/mscutils/devmgmt/lang/ro-RO.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/devmgmt/lang/ro-RO.rc [iso-8859-1]
(original)
+++ trunk/reactos/base/applications/mscutils/devmgmt/lang/ro-RO.rc [iso-8859-1] Tue Mar 20
22:11:51 2012
@@ -1,4 +1,4 @@
-//2011.10.19 - Fulea Ètefan: minor changes
+//2011.10.19 - Fulea Ètefan: minor changes
LANGUAGE LANG_ROMANIAN, SUBLANG_NEUTRAL
IDR_MAINMENU MENU
@@ -17,10 +17,10 @@
END
POPUP "&AfiÈare"
BEGIN
- MENUITEM "Dispozitive dupÄ &tip", IDC_DEVBYTYPE, CHECKED
- MENUITEM "Dispozitive dupÄ &conexiune", IDC_STATIC, GRAYED
- MENUITEM "Resurse dupÄ t&ip", IDC_STATIC, GRAYED
- MENUITEM "Resurse dupÄ c&onexiune", IDC_STATIC, GRAYED
+ MENUITEM "Dispozitive dupÄ &tip", IDC_DEVBYTYPE
+ MENUITEM "Dispozitive dupÄ &conexiune", IDC_DEVBYCONN
+ MENUITEM "Resurse dupÄ t&ip", IDC_RESBYTYPE, GRAYED
+ MENUITEM "Resurse dupÄ c&onexiune", IDC_RESBYCONN, GRAYED
END
POPUP "&?"
BEGIN
Modified: trunk/reactos/base/applications/mscutils/devmgmt/lang/ru-RU.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/devmgmt/lang/ru-RU.rc [iso-8859-1]
(original)
+++ trunk/reactos/base/applications/mscutils/devmgmt/lang/ru-RU.rc [iso-8859-1] Tue Mar 20
22:11:51 2012
@@ -1,4 +1,4 @@
-// Russian language resource file (Dmitry Chapyshev, 2007-06-10)
+// Russian language resource file (Dmitry Chapyshev, 2007-06-10)
LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
@@ -18,10 +18,10 @@
END
POPUP "Ðид"
BEGIN
- MENUITEM "УÑÑÑойÑÑва по ÑипÑ", IDC_DEVBYTYPE,
CHECKED
- MENUITEM "УÑÑÑойÑÑва по подклÑÑениÑ", IDC_STATIC,
GRAYED
- MENUITEM "РеÑÑÑÑÑ Ð¿Ð¾ ÑипÑ", IDC_STATIC, GRAYED
- MENUITEM "РеÑÑÑÑÑ Ð¿Ð¾ подклÑÑениÑ", IDC_STATIC, GRAYED
+ MENUITEM "УÑÑÑойÑÑва по ÑипÑ", IDC_DEVBYTYPE
+ MENUITEM "УÑÑÑойÑÑва по подклÑÑениÑ", IDC_DEVBYCONN
+ MENUITEM "РеÑÑÑÑÑ Ð¿Ð¾ ÑипÑ", IDC_RESBYTYPE, GRAYED
+ MENUITEM "РеÑÑÑÑÑ Ð¿Ð¾ подклÑÑениÑ", IDC_RESBYCONN,
GRAYED
END
POPUP "СпÑавка"
BEGIN
Modified: trunk/reactos/base/applications/mscutils/devmgmt/lang/sk-SK.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/devmgmt/lang/sk-SK.rc [iso-8859-1]
(original)
+++ trunk/reactos/base/applications/mscutils/devmgmt/lang/sk-SK.rc [iso-8859-1] Tue Mar 20
22:11:51 2012
@@ -1,4 +1,4 @@
-/* TRANSLATOR: Mário KaÄmár /Mario Kacmar/ aka Kario (kario(a)szm.sk)
+/* TRANSLATOR: Mário KaÄmár /Mario Kacmar/ aka Kario (kario(a)szm.sk)
* DATE OF TR.: 14-02-2008
* LAST CHANGE: 29-08-2008
*/
@@ -21,10 +21,10 @@
END
POPUP "Zobraziť"
BEGIN
- MENUITEM "Zariadenia podľa typu", IDC_DEVBYTYPE, CHECKED
- MENUITEM "Zariadenia podľa pripojenia", IDC_STATIC, GRAYED
- MENUITEM "Prostriedky podľa typu", IDC_STATIC, GRAYED
- MENUITEM "Prostriedky podľa pripojenia", IDC_STATIC, GRAYED
+ MENUITEM "Zariadenia podľa typu", IDC_DEVBYTYPE
+ MENUITEM "Zariadenia podľa pripojenia", IDC_DEVBYCONN
+ MENUITEM "Prostriedky podľa typu", IDC_RESBYTYPE, GRAYED
+ MENUITEM "Prostriedky podľa pripojenia", IDC_RESBYCONN, GRAYED
END
POPUP "PomocnÃk"
BEGIN
Modified: trunk/reactos/base/applications/mscutils/devmgmt/lang/sv-SE.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/devmgmt/lang/sv-SE.rc [iso-8859-1]
(original)
+++ trunk/reactos/base/applications/mscutils/devmgmt/lang/sv-SE.rc [iso-8859-1] Tue Mar 20
22:11:51 2012
@@ -1,4 +1,4 @@
-/*
+/*
* PROJECT: ReactOS MSCUTILS
* FILE: base\applications\mscutils\devmgmt\lang\sv-SE.rc
* PURPOSE: Swedish resource file
@@ -23,10 +23,10 @@
END
POPUP "Visa"
BEGIN
- MENUITEM "Enheter efter typ", IDC_DEVBYTYPE, CHECKED
- MENUITEM "Enheter efter koppling", IDC_STATIC, GRAYED
- MENUITEM "Resurcer efter typ", IDC_STATIC, GRAYED
- MENUITEM "Resurcer efter koppling", IDC_STATIC, GRAYED
+ MENUITEM "Enheter efter typ", IDC_DEVBYTYPE
+ MENUITEM "Enheter efter koppling", IDC_DEVBYCONN
+ MENUITEM "Resurcer efter typ", IDC_RESBYTYPE, GRAYED
+ MENUITEM "Resurcer efter koppling", IDC_RESBYCONN, GRAYED
END
POPUP "Hjälp"
BEGIN
Modified: trunk/reactos/base/applications/mscutils/devmgmt/lang/th-TH.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/devmgmt/lang/th-TH.rc [iso-8859-1]
(original)
+++ trunk/reactos/base/applications/mscutils/devmgmt/lang/th-TH.rc [iso-8859-1] Tue Mar 20
22:11:51 2012
@@ -1,4 +1,4 @@
-/*
+/*
* PROJECT: ReactOS Device Management
* LICENSE: GPL - See COPYING in the top level directory
* FILE: base/applications/devmgmt/lang/th-TH.rc
@@ -24,10 +24,10 @@
END
POPUP "มุมมà¸à¸"
BEGIN
- MENUITEM "à¸à¸¸à¸à¸à¸£à¸à¹à¹à¸à¹à¸à¸à¸²à¸¡à¸à¸£à¸°à¹à¸ à¸",
IDC_DEVBYTYPE, CHECKED
- MENUITEM
"à¸à¸¸à¸à¸à¸£à¸à¹à¹à¸à¹à¸à¸à¸²à¸¡à¸à¸²à¸£à¹à¸à¸·à¹à¸à¸¡à¸à¹à¸",
IDC_STATIC, GRAYED
- MENUITEM "à¹à¸«à¸¥à¹à¸à¸à¹à¸à¸¡à¸¹à¸¥à¸à¸²à¸¡à¸à¸£à¸°à¹à¸ à¸",
IDC_STATIC, GRAYED
- MENUITEM
"à¹à¸«à¸¥à¹à¸à¸à¹à¸à¸¡à¸¹à¸¥à¸à¸²à¸¡à¸à¸²à¸£à¹à¸à¸·à¹à¸à¸¡à¸à¹à¸",
IDC_STATIC, GRAYED
+ MENUITEM "à¸à¸¸à¸à¸à¸£à¸à¹à¹à¸à¹à¸à¸à¸²à¸¡à¸à¸£à¸°à¹à¸ à¸",
IDC_DEVBYTYPE
+ MENUITEM
"à¸à¸¸à¸à¸à¸£à¸à¹à¹à¸à¹à¸à¸à¸²à¸¡à¸à¸²à¸£à¹à¸à¸·à¹à¸à¸¡à¸à¹à¸",
IDC_DEVBYCONN
+ MENUITEM "à¹à¸«à¸¥à¹à¸à¸à¹à¸à¸¡à¸¹à¸¥à¸à¸²à¸¡à¸à¸£à¸°à¹à¸ à¸",
IDC_RESBYTYPE, GRAYED
+ MENUITEM
"à¹à¸«à¸¥à¹à¸à¸à¹à¸à¸¡à¸¹à¸¥à¸à¸²à¸¡à¸à¸²à¸£à¹à¸à¸·à¹à¸à¸¡à¸à¹à¸",
IDC_RESBYCONN, GRAYED
END
POPUP "à¸à¹à¸§à¸¢à¹à¸«à¸¥à¸·à¸"
BEGIN
Modified: trunk/reactos/base/applications/mscutils/devmgmt/lang/uk-UA.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/devmgmt/lang/uk-UA.rc [iso-8859-1]
(original)
+++ trunk/reactos/base/applications/mscutils/devmgmt/lang/uk-UA.rc [iso-8859-1] Tue Mar 20
22:11:51 2012
@@ -1,4 +1,4 @@
-/*
+/*
* PROJECT: ReactOS Device Management
* LICENSE: GPL - See COPYING in the top level directory
* FILE: base/applications/devmgmt/lang/uk-UA.rc
@@ -24,10 +24,10 @@
END
POPUP "ÐиглÑд"
BEGIN
- MENUITEM "ÐÑиÑÑÑÐ¾Ñ Ð·Ð° Ñипом", IDC_DEVBYTYPE, CHECKED
- MENUITEM "ÐÑиÑÑÑÐ¾Ñ Ð·Ð° пÑдклÑÑеннÑм", IDC_STATIC,
GRAYED
- MENUITEM "РеÑÑÑÑи за Ñипом", IDC_STATIC, GRAYED
- MENUITEM "РеÑÑÑÑи за пÑдклÑÑеннÑм", IDC_STATIC,
GRAYED
+ MENUITEM "ÐÑиÑÑÑÐ¾Ñ Ð·Ð° Ñипом", IDC_DEVBYTYPE
+ MENUITEM "ÐÑиÑÑÑÐ¾Ñ Ð·Ð° пÑдклÑÑеннÑм", IDC_DEVBYCONN
+ MENUITEM "РеÑÑÑÑи за Ñипом", IDC_RESBYTYPE, GRAYED
+ MENUITEM "РеÑÑÑÑи за пÑдклÑÑеннÑм", IDC_RESBYCONN,
GRAYED
END
POPUP "ÐовÑдка"
BEGIN
Modified: trunk/reactos/base/applications/mscutils/devmgmt/lang/zh-CN.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/devmgmt/lang/zh-CN.rc [iso-8859-1]
(original)
+++ trunk/reactos/base/applications/mscutils/devmgmt/lang/zh-CN.rc [iso-8859-1] Tue Mar 20
22:11:51 2012
@@ -1,4 +1,4 @@
-/*
+/*
* Translated by Song Fuchang (0xfc) <sfc_0(a)yahoo.com.cn>
*/
@@ -20,10 +20,10 @@
END
POPUP "æ¥ç"
BEGIN
- MENUITEM "设å¤ï¼æç±»å", IDC_DEVBYTYPE, CHECKED
- MENUITEM "设å¤ï¼æè¿æ¥", IDC_STATIC, GRAYED
- MENUITEM "èµæºï¼æç±»å", IDC_STATIC, GRAYED
- MENUITEM "èµæºï¼æè¿æ¥", IDC_STATIC, GRAYED
+ MENUITEM "设å¤ï¼æç±»å", IDC_DEVBYTYPE
+ MENUITEM "设å¤ï¼æè¿æ¥", IDC_DEVBYCONN
+ MENUITEM "èµæºï¼æç±»å", IDC_RESBYTYPE, GRAYED
+ MENUITEM "èµæºï¼æè¿æ¥", IDC_RESBYCONN, GRAYED
END
POPUP "帮å©"
BEGIN
Modified: trunk/reactos/base/applications/mscutils/devmgmt/mainwnd.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/devmgmt/mainwnd.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mscutils/devmgmt/mainwnd.c [iso-8859-1] Tue Mar 20
22:11:51 2012
@@ -203,22 +203,63 @@
static DWORD WINAPI
DeviceEnumThread(LPVOID lpParameter)
{
+ PMAIN_WND_INFO Info;
HTREEITEM hRoot;
- HWND *hTreeView;
-
- hTreeView = (HWND *)lpParameter;
-
- if (*hTreeView)
- FreeDeviceStrings(*hTreeView);
-
- hRoot = InitTreeView(*hTreeView);
+
+ Info = (PMAIN_WND_INFO)lpParameter;
+
+ if (Info->hTreeView)
+ FreeDeviceStrings(Info->hTreeView);
+
+ hRoot = InitTreeView(Info->hTreeView);
if (hRoot)
{
- ListDevicesByType(*hTreeView, hRoot);
+ switch (Info->Display)
+ {
+ case DevicesByType:
+ ListDevicesByType(Info->hTreeView, hRoot);
+ break;
+
+ case DevicesByConnection:
+ ListDevicesByConnection(Info->hTreeView, hRoot);
+ break;
+
+ default:
+ break;
+ }
return 0;
}
return -1;
+}
+
+
+static VOID
+UpdateViewMenu(PMAIN_WND_INFO Info)
+{
+ UINT id = IDC_DEVBYTYPE;
+
+ switch (Info->Display)
+ {
+ case DevicesByType:
+ id = IDC_DEVBYTYPE;
+ break;
+ case DevicesByConnection:
+ id = IDC_DEVBYCONN;
+ break;
+ case RessourcesByType:
+ id = IDC_RESBYTYPE;
+ break;
+ case RessourcesByConnection:
+ id = IDC_RESBYCONN;
+ break;
+ }
+
+ CheckMenuRadioItem(GetMenu(Info->hMainWnd),
+ IDC_DEVBYTYPE,
+ IDC_RESBYCONN,
+ id,
+ MF_BYCOMMAND);
}
@@ -239,6 +280,8 @@
if (!CreateStatusBar(Info))
DisplayString(_T("error creating status bar"));
+
+ UpdateViewMenu(Info);
/* make 'properties' bold */
hMenu = GetMenu(Info->hMainWnd);
@@ -256,7 +299,7 @@
DevEnumThread = CreateThread(NULL,
0,
DeviceEnumThread,
- &Info->hTreeView,
+ Info,
0,
NULL);
if (!DevEnumThread)
@@ -303,11 +346,12 @@
}
-static VOID
+static LRESULT
OnNotify(PMAIN_WND_INFO Info,
LPARAM lParam)
{
LPNMHDR pnmhdr = (LPNMHDR)lParam;
+ LRESULT ret = 0;
switch (pnmhdr->code)
{
@@ -315,26 +359,52 @@
{
LPNM_TREEVIEW pnmtv = (LPNM_TREEVIEW)lParam;
- if (!TreeView_GetChild(Info->hTreeView,
- pnmtv->itemNew.hItem))
+ if (Info->Display == DevicesByType)
{
- SendMessage(Info->hTool,
- TB_SETSTATE,
- IDC_PROP,
- (LPARAM)MAKELONG(TBSTATE_ENABLED, 0));
-
- EnableMenuItem(GetMenu(Info->hMainWnd), IDC_PROP, MF_ENABLED);
- EnableMenuItem(Info->hShortcutMenu, IDC_PROP, MF_ENABLED);
+ if (!TreeView_GetChild(Info->hTreeView,
+ pnmtv->itemNew.hItem))
+ {
+ SendMessage(Info->hTool,
+ TB_SETSTATE,
+ IDC_PROP,
+ (LPARAM)MAKELONG(TBSTATE_ENABLED, 0));
+
+ EnableMenuItem(GetMenu(Info->hMainWnd), IDC_PROP, MF_ENABLED);
+ EnableMenuItem(Info->hShortcutMenu, IDC_PROP, MF_ENABLED);
+ }
+ else
+ {
+ SendMessage(Info->hTool,
+ TB_SETSTATE,
+ IDC_PROP,
+ (LPARAM)MAKELONG(TBSTATE_INDETERMINATE, 0));
+
+ EnableMenuItem(GetMenu(Info->hMainWnd), IDC_PROP, MF_GRAYED);
+ EnableMenuItem(Info->hShortcutMenu, IDC_PROP, MF_GRAYED);
+ }
}
- else
+ else if (Info->Display == DevicesByConnection)
{
- SendMessage(Info->hTool,
- TB_SETSTATE,
- IDC_PROP,
- (LPARAM)MAKELONG(TBSTATE_INDETERMINATE, 0));
-
- EnableMenuItem(GetMenu(Info->hMainWnd), IDC_PROP, MF_GRAYED);
- EnableMenuItem(Info->hShortcutMenu, IDC_PROP, MF_GRAYED);
+ if (pnmtv->itemNew.hItem == TreeView_GetRoot(Info->hTreeView))
+ {
+ SendMessage(Info->hTool,
+ TB_SETSTATE,
+ IDC_PROP,
+ (LPARAM)MAKELONG(TBSTATE_INDETERMINATE, 0));
+
+ EnableMenuItem(GetMenu(Info->hMainWnd), IDC_PROP, MF_GRAYED);
+ EnableMenuItem(Info->hShortcutMenu, IDC_PROP, MF_GRAYED);
+ }
+ else
+ {
+ SendMessage(Info->hTool,
+ TB_SETSTATE,
+ IDC_PROP,
+ (LPARAM)MAKELONG(TBSTATE_ENABLED, 0));
+
+ EnableMenuItem(GetMenu(Info->hMainWnd), IDC_PROP, MF_ENABLED);
+ EnableMenuItem(Info->hShortcutMenu, IDC_PROP, MF_ENABLED);
+ }
}
}
break;
@@ -344,17 +414,42 @@
HTREEITEM hSelected = TreeView_GetSelection(Info->hTreeView);
TV_HITTESTINFO HitTest;
- if (!TreeView_GetChild(Info->hTreeView,
- hSelected))
+ if (Info->Display == DevicesByType)
{
- if (GetCursorPos(&HitTest.pt) &&
- ScreenToClient(Info->hTreeView, &HitTest.pt))
+ if (!TreeView_GetChild(Info->hTreeView,
+ hSelected))
{
- if (TreeView_HitTest(Info->hTreeView, &HitTest))
+ if (GetCursorPos(&HitTest.pt) &&
+ ScreenToClient(Info->hTreeView, &HitTest.pt))
{
- if (HitTest.hItem == hSelected)
- OpenPropSheet(Info->hTreeView,
- hSelected);
+ if (TreeView_HitTest(Info->hTreeView, &HitTest))
+ {
+ if (HitTest.hItem == hSelected)
+ {
+ OpenPropSheet(Info->hTreeView,
+ hSelected);
+ ret = TRUE;
+ }
+ }
+ }
+ }
+ }
+ else if (Info->Display == DevicesByConnection)
+ {
+ if (hSelected != TreeView_GetRoot(Info->hTreeView))
+ {
+ if (GetCursorPos(&HitTest.pt) &&
+ ScreenToClient(Info->hTreeView, &HitTest.pt))
+ {
+ if (TreeView_HitTest(Info->hTreeView, &HitTest))
+ {
+ if (HitTest.hItem == hSelected)
+ {
+ OpenPropSheet(Info->hTreeView,
+ hSelected);
+ ret = TRUE;
+ }
+ }
}
}
}
@@ -403,6 +498,38 @@
}
break;
}
+
+ return ret;
+}
+
+
+static VOID
+OnRefresh(PMAIN_WND_INFO Info)
+{
+ HANDLE DevEnumThread;
+
+ SendMessage(Info->hTool,
+ TB_SETSTATE,
+ IDC_PROP,
+ (LPARAM)MAKELONG(TBSTATE_INDETERMINATE, 0));
+
+ EnableMenuItem(GetMenu(Info->hMainWnd), IDC_PROP, MF_GRAYED);
+ EnableMenuItem(Info->hShortcutMenu, IDC_PROP, MF_GRAYED);
+
+ /* create seperate thread to emum devices */
+ DevEnumThread = CreateThread(NULL,
+ 0,
+ DeviceEnumThread,
+ Info,
+ 0,
+ NULL);
+ if (!DevEnumThread)
+ {
+ DisplayString(_T("Failed to enumerate devices"));
+ return;
+ }
+
+ CloseHandle(DevEnumThread);
}
@@ -425,30 +552,7 @@
case IDC_REFRESH:
{
- HANDLE DevEnumThread;
-
- SendMessage(Info->hTool,
- TB_SETSTATE,
- IDC_PROP,
- (LPARAM)MAKELONG(TBSTATE_INDETERMINATE, 0));
-
- EnableMenuItem(GetMenu(Info->hMainWnd), IDC_PROP, MF_GRAYED);
- EnableMenuItem(Info->hShortcutMenu, IDC_PROP, MF_GRAYED);
-
- /* create seperate thread to emum devices */
- DevEnumThread = CreateThread(NULL,
- 0,
- DeviceEnumThread,
- &Info->hTreeView,
- 0,
- NULL);
- if (!DevEnumThread)
- {
- DisplayString(_T("Failed to enumerate devices"));
- break;
- }
-
- CloseHandle(DevEnumThread);
+ OnRefresh(Info);
}
break;
@@ -479,6 +583,21 @@
}
break;
+ case IDC_DEVBYTYPE:
+ {
+ Info->Display = DevicesByType;
+ UpdateViewMenu(Info);
+ OnRefresh(Info);
+ }
+ break;
+
+ case IDC_DEVBYCONN:
+ {
+ Info->Display = DevicesByConnection;
+ UpdateViewMenu(Info);
+ OnRefresh(Info);
+ }
+ break;
}
}
@@ -570,7 +689,7 @@
case WM_NOTIFY:
{
- OnNotify(Info, lParam);
+ Ret = OnNotify(Info, lParam);
}
break;
@@ -674,6 +793,7 @@
if (Info != NULL)
{
Info->nCmdShow = nCmdShow;
+ Info->Display = DevicesByType;
hMainWnd = CreateWindowEx(WS_EX_WINDOWEDGE,
szMainWndClass,
Modified: trunk/reactos/base/applications/mscutils/devmgmt/precomp.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/devmgmt/precomp.h [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mscutils/devmgmt/precomp.h [iso-8859-1] Tue Mar 20
22:11:51 2012
@@ -18,6 +18,14 @@
#define MAX_DEV_LEN 256
+typedef enum
+{
+ DevicesByType,
+ DevicesByConnection,
+ RessourcesByType,
+ RessourcesByConnection
+} DISPLAY_TYPE;
+
typedef struct _MAIN_WND_INFO
{
HWND hMainWnd;
@@ -27,6 +35,8 @@
HWND hProgDlg;
HMENU hShortcutMenu;
int nCmdShow;
+
+ DISPLAY_TYPE Display;
/* status flags */
UINT InMenuLoop : 1;
@@ -59,6 +69,7 @@
VOID OpenPropSheet(HWND hTreeView, HTREEITEM hItem);
HTREEITEM InitTreeView(HWND hTreeView);
VOID ListDevicesByType(HWND hTreeView, HTREEITEM hRoot);
+VOID ListDevicesByConnection(HWND hTreeView, HTREEITEM hRoot);
/* misc.c */
Modified: trunk/reactos/base/applications/mscutils/devmgmt/resource.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/devmgmt/resource.h [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mscutils/devmgmt/resource.h [iso-8859-1] Tue Mar 20
22:11:51 2012
@@ -20,6 +20,9 @@
#define IDR_MAINMENU 102
#define IDR_POPUP 103
#define IDC_DEVBYTYPE 104
+#define IDC_DEVBYCONN 105
+#define IDC_RESBYTYPE 106
+#define IDC_RESBYCONN 107
/* tooltips */
#define IDS_TOOLTIP_PROP 6000