https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8451230753d1941471ec2…
commit 8451230753d1941471ec2f41a522e70caae2e1a9
Author: Alexey Strukov <oplkill(a)gmail.com>
AuthorDate: Tue Oct 10 22:22:54 2023 +0300
Commit: GitHub <noreply(a)github.com>
CommitDate: Tue Oct 10 21:22:54 2023 +0200
[DEVMGR] Allow to copy text from Details page of device properties (#5775)
In driver properties, in details tab, add a "Copy" popup menu for
listview.
This will allow to copy driver's information to buffer.
---
dll/win32/devmgr/lang/bg-BG.rc | 1 +
dll/win32/devmgr/lang/cs-CZ.rc | 1 +
dll/win32/devmgr/lang/de-DE.rc | 1 +
dll/win32/devmgr/lang/el-GR.rc | 1 +
dll/win32/devmgr/lang/en-US.rc | 1 +
dll/win32/devmgr/lang/es-ES.rc | 1 +
dll/win32/devmgr/lang/et-EE.rc | 1 +
dll/win32/devmgr/lang/fr-FR.rc | 1 +
dll/win32/devmgr/lang/he-IL.rc | 1 +
dll/win32/devmgr/lang/hu-HU.rc | 1 +
dll/win32/devmgr/lang/id-ID.rc | 1 +
dll/win32/devmgr/lang/it-IT.rc | 1 +
dll/win32/devmgr/lang/ja-JP.rc | 1 +
dll/win32/devmgr/lang/no-NO.rc | 1 +
dll/win32/devmgr/lang/pl-PL.rc | 1 +
dll/win32/devmgr/lang/pt-BR.rc | 1 +
dll/win32/devmgr/lang/pt-PT.rc | 1 +
dll/win32/devmgr/lang/ro-RO.rc | 1 +
dll/win32/devmgr/lang/ru-RU.rc | 1 +
dll/win32/devmgr/lang/sk-SK.rc | 1 +
dll/win32/devmgr/lang/sq-AL.rc | 1 +
dll/win32/devmgr/lang/tr-TR.rc | 1 +
dll/win32/devmgr/lang/uk-UA.rc | 1 +
dll/win32/devmgr/lang/zh-CN.rc | 1 +
dll/win32/devmgr/lang/zh-HK.rc | 1 +
dll/win32/devmgr/lang/zh-TW.rc | 1 +
dll/win32/devmgr/properties/advprop.cpp | 71 +++++++++++++++++++++++++++++++++
dll/win32/devmgr/resource.h | 2 +
28 files changed, 99 insertions(+)
diff --git a/dll/win32/devmgr/lang/bg-BG.rc b/dll/win32/devmgr/lang/bg-BG.rc
index 608e9e7651d..269a7844700 100644
--- a/dll/win32/devmgr/lang/bg-BG.rc
+++ b/dll/win32/devmgr/lang/bg-BG.rc
@@ -31,6 +31,7 @@ BEGIN
IDS_RESOURCE_INTERRUPT "IRQ"
IDS_RESOURCE_DMA "DMA"
IDS_RESOURCE_PORT "I/O range"
+ IDS_COPY "За&помняне"
END
/* error messages, source:
http://www.z123.org/techsupport/medm.htm */
diff --git a/dll/win32/devmgr/lang/cs-CZ.rc b/dll/win32/devmgr/lang/cs-CZ.rc
index ec0b3b73cdf..7ea12cccda2 100644
--- a/dll/win32/devmgr/lang/cs-CZ.rc
+++ b/dll/win32/devmgr/lang/cs-CZ.rc
@@ -36,6 +36,7 @@ BEGIN
IDS_RESOURCE_INTERRUPT "IRQ"
IDS_RESOURCE_DMA "DMA"
IDS_RESOURCE_PORT "Rozsah I/O"
+ IDS_COPY "&Kopírovat"
END
/* puvodni anglicke error messages prevzaty z:
http://www.z123.org/techsupport/medm.htm
*/
diff --git a/dll/win32/devmgr/lang/de-DE.rc b/dll/win32/devmgr/lang/de-DE.rc
index 2ee2bf7bf55..79b8da95d40 100644
--- a/dll/win32/devmgr/lang/de-DE.rc
+++ b/dll/win32/devmgr/lang/de-DE.rc
@@ -33,6 +33,7 @@ BEGIN
IDS_RESOURCE_INTERRUPT "IRQ"
IDS_RESOURCE_DMA "DMA"
IDS_RESOURCE_PORT "E/A-Bereich"
+ IDS_COPY "&Kopieren"
END
/* error messages, source:
http://www.z123.org/techsupport/medm.htm */
diff --git a/dll/win32/devmgr/lang/el-GR.rc b/dll/win32/devmgr/lang/el-GR.rc
index d340a974d12..99e5d1d9c3a 100644
--- a/dll/win32/devmgr/lang/el-GR.rc
+++ b/dll/win32/devmgr/lang/el-GR.rc
@@ -33,6 +33,7 @@ BEGIN
IDS_RESOURCE_INTERRUPT "IRQ"
IDS_RESOURCE_DMA "DMA"
IDS_RESOURCE_PORT "I/O range"
+ IDS_COPY "&Αντιγραφή"
END
/* error messages, source:
http://www.z123.org/techsupport/medm.htm */
diff --git a/dll/win32/devmgr/lang/en-US.rc b/dll/win32/devmgr/lang/en-US.rc
index 73800ecd181..5d5686bbadc 100644
--- a/dll/win32/devmgr/lang/en-US.rc
+++ b/dll/win32/devmgr/lang/en-US.rc
@@ -31,6 +31,7 @@ BEGIN
IDS_RESOURCE_INTERRUPT "IRQ"
IDS_RESOURCE_DMA "DMA"
IDS_RESOURCE_PORT "I/O range"
+ IDS_COPY "&Copy"
END
/* error messages, source:
http://www.z123.org/techsupport/medm.htm */
diff --git a/dll/win32/devmgr/lang/es-ES.rc b/dll/win32/devmgr/lang/es-ES.rc
index 73f747e5cb5..adace42dd18 100644
--- a/dll/win32/devmgr/lang/es-ES.rc
+++ b/dll/win32/devmgr/lang/es-ES.rc
@@ -40,6 +40,7 @@ BEGIN
IDS_RESOURCE_INTERRUPT "IRQ"
IDS_RESOURCE_DMA "DMA"
IDS_RESOURCE_PORT "Intervalo de E/S"
+ IDS_COPY "&Copiar"
END
/* error messages, source:
http://www.z123.org/techsupport/medm.htm */
diff --git a/dll/win32/devmgr/lang/et-EE.rc b/dll/win32/devmgr/lang/et-EE.rc
index 24b2e1079e0..61d47b5c0b4 100644
--- a/dll/win32/devmgr/lang/et-EE.rc
+++ b/dll/win32/devmgr/lang/et-EE.rc
@@ -38,6 +38,7 @@ BEGIN
IDS_RESOURCE_INTERRUPT "IRQ"
IDS_RESOURCE_DMA "DMA"
IDS_RESOURCE_PORT "I/O ulatus"
+ IDS_COPY "&Kopeeri"
END
/* error messages, source:
http://www.z123.org/techsupport/medm.htm */
diff --git a/dll/win32/devmgr/lang/fr-FR.rc b/dll/win32/devmgr/lang/fr-FR.rc
index daa0cd14706..183c09623c9 100644
--- a/dll/win32/devmgr/lang/fr-FR.rc
+++ b/dll/win32/devmgr/lang/fr-FR.rc
@@ -33,6 +33,7 @@ BEGIN
IDS_RESOURCE_INTERRUPT "IRQ"
IDS_RESOURCE_DMA "DMA"
IDS_RESOURCE_PORT "Rang I/O"
+ IDS_COPY "&Copier"
END
STRINGTABLE
diff --git a/dll/win32/devmgr/lang/he-IL.rc b/dll/win32/devmgr/lang/he-IL.rc
index 7b782c4a024..6d2723856e6 100644
--- a/dll/win32/devmgr/lang/he-IL.rc
+++ b/dll/win32/devmgr/lang/he-IL.rc
@@ -33,6 +33,7 @@ BEGIN
IDS_RESOURCE_INTERRUPT "IRQ"
IDS_RESOURCE_DMA "DMA"
IDS_RESOURCE_PORT "I/O range"
+ IDS_COPY "הע&תק"
END
/* error messages, source:
http://www.z123.org/techsupport/medm.htm */
diff --git a/dll/win32/devmgr/lang/hu-HU.rc b/dll/win32/devmgr/lang/hu-HU.rc
index 41285a298e3..7fc86b5fc73 100644
--- a/dll/win32/devmgr/lang/hu-HU.rc
+++ b/dll/win32/devmgr/lang/hu-HU.rc
@@ -33,6 +33,7 @@ BEGIN
IDS_RESOURCE_INTERRUPT "IRQ"
IDS_RESOURCE_DMA "DMA"
IDS_RESOURCE_PORT "I/O tartomány"
+ IDS_COPY "&Másolás"
END
STRINGTABLE
diff --git a/dll/win32/devmgr/lang/id-ID.rc b/dll/win32/devmgr/lang/id-ID.rc
index 057db41bada..86d44ad468e 100644
--- a/dll/win32/devmgr/lang/id-ID.rc
+++ b/dll/win32/devmgr/lang/id-ID.rc
@@ -33,6 +33,7 @@ BEGIN
IDS_RESOURCE_INTERRUPT "IRQ"
IDS_RESOURCE_DMA "DMA"
IDS_RESOURCE_PORT "Rentang I/O"
+ IDS_COPY "&Salin"
END
/* error messages, source:
http://www.z123.org/techsupport/medm.htm */
diff --git a/dll/win32/devmgr/lang/it-IT.rc b/dll/win32/devmgr/lang/it-IT.rc
index a196f6f55aa..09b5d6a3b60 100644
--- a/dll/win32/devmgr/lang/it-IT.rc
+++ b/dll/win32/devmgr/lang/it-IT.rc
@@ -33,6 +33,7 @@ BEGIN
IDS_RESOURCE_INTERRUPT "IRQ"
IDS_RESOURCE_DMA "DMA"
IDS_RESOURCE_PORT "I/O range"
+ IDS_COPY "&Copia"
END
/* error messages, source:
http://www.z123.org/techsupport/medm.htm */
diff --git a/dll/win32/devmgr/lang/ja-JP.rc b/dll/win32/devmgr/lang/ja-JP.rc
index 6b8ccd29c2e..1fc049d01d4 100644
--- a/dll/win32/devmgr/lang/ja-JP.rc
+++ b/dll/win32/devmgr/lang/ja-JP.rc
@@ -31,6 +31,7 @@ BEGIN
IDS_RESOURCE_INTERRUPT "IRQ"
IDS_RESOURCE_DMA "DMA"
IDS_RESOURCE_PORT "I/O 範囲"
+ IDS_COPY "コピー(&C)"
END
/* error messages, source:
http://www.z123.org/techsupport/medm.htm */
diff --git a/dll/win32/devmgr/lang/no-NO.rc b/dll/win32/devmgr/lang/no-NO.rc
index ac18e97f48d..cb027cc7d2d 100644
--- a/dll/win32/devmgr/lang/no-NO.rc
+++ b/dll/win32/devmgr/lang/no-NO.rc
@@ -33,6 +33,7 @@ BEGIN
IDS_RESOURCE_INTERRUPT "IRQ"
IDS_RESOURCE_DMA "DMA"
IDS_RESOURCE_PORT "I/O range"
+ IDS_COPY "&Kopier"
END
/* error messages, source:
http://www.z123.org/techsupport/medm.htm */
diff --git a/dll/win32/devmgr/lang/pl-PL.rc b/dll/win32/devmgr/lang/pl-PL.rc
index 479997fa0ca..5f37465a4dc 100644
--- a/dll/win32/devmgr/lang/pl-PL.rc
+++ b/dll/win32/devmgr/lang/pl-PL.rc
@@ -42,6 +42,7 @@ BEGIN
IDS_RESOURCE_INTERRUPT "IRQ"
IDS_RESOURCE_DMA "DMA"
IDS_RESOURCE_PORT "Zakres I/O"
+ IDS_COPY "&Kopiuj"
END
/* error messages, source:
http://www.z123.org/techsupport/medm.htm */
diff --git a/dll/win32/devmgr/lang/pt-BR.rc b/dll/win32/devmgr/lang/pt-BR.rc
index 5111ca30069..e6ecb1f8f82 100644
--- a/dll/win32/devmgr/lang/pt-BR.rc
+++ b/dll/win32/devmgr/lang/pt-BR.rc
@@ -33,6 +33,7 @@ BEGIN
IDS_RESOURCE_INTERRUPT "IRQ"
IDS_RESOURCE_DMA "DMA"
IDS_RESOURCE_PORT "I/O range"
+ IDS_COPY "&Copiar"
END
/* error messages, source:
http://www.z123.org/techsupport/medm.htm */
diff --git a/dll/win32/devmgr/lang/pt-PT.rc b/dll/win32/devmgr/lang/pt-PT.rc
index 5870e00a93a..d58c67ab136 100644
--- a/dll/win32/devmgr/lang/pt-PT.rc
+++ b/dll/win32/devmgr/lang/pt-PT.rc
@@ -33,6 +33,7 @@ BEGIN
IDS_RESOURCE_INTERRUPT "IRQ"
IDS_RESOURCE_DMA "DMA"
IDS_RESOURCE_PORT "Faixa I/O"
+ IDS_COPY "&Copiar"
END
/* error messages, source:
http://www.z123.org/techsupport/medm.htm */
diff --git a/dll/win32/devmgr/lang/ro-RO.rc b/dll/win32/devmgr/lang/ro-RO.rc
index 22af2d2e240..aa6842b766c 100644
--- a/dll/win32/devmgr/lang/ro-RO.rc
+++ b/dll/win32/devmgr/lang/ro-RO.rc
@@ -40,6 +40,7 @@ BEGIN
IDS_RESOURCE_INTERRUPT "IRQ"
IDS_RESOURCE_DMA "DMA"
IDS_RESOURCE_PORT "Domeniu In/Ex"
+ IDS_COPY "&Copiază"
END
/* error messages, source:
http://www.z123.org/techsupport/medm.htm */
diff --git a/dll/win32/devmgr/lang/ru-RU.rc b/dll/win32/devmgr/lang/ru-RU.rc
index 2926b4953c6..32a798665fa 100644
--- a/dll/win32/devmgr/lang/ru-RU.rc
+++ b/dll/win32/devmgr/lang/ru-RU.rc
@@ -33,6 +33,7 @@ BEGIN
IDS_RESOURCE_INTERRUPT "IRQ"
IDS_RESOURCE_DMA "DMA"
IDS_RESOURCE_PORT "Диапазон I/O"
+ IDS_COPY "&Копировать"
END
/* error messages, source:
http://www.z123.org/techsupport/medm.htm */
diff --git a/dll/win32/devmgr/lang/sk-SK.rc b/dll/win32/devmgr/lang/sk-SK.rc
index 3974a5abbb9..74b95fa6590 100644
--- a/dll/win32/devmgr/lang/sk-SK.rc
+++ b/dll/win32/devmgr/lang/sk-SK.rc
@@ -36,6 +36,7 @@ BEGIN
IDS_RESOURCE_INTERRUPT "IRQ"
IDS_RESOURCE_DMA "DMA"
IDS_RESOURCE_PORT "I/O range"
+ IDS_COPY "&Kopírovať"
END
/* error messages, source:
http://www.z123.org/techsupport/medm.htm */
diff --git a/dll/win32/devmgr/lang/sq-AL.rc b/dll/win32/devmgr/lang/sq-AL.rc
index 5662c85ba95..a92819f36e1 100644
--- a/dll/win32/devmgr/lang/sq-AL.rc
+++ b/dll/win32/devmgr/lang/sq-AL.rc
@@ -35,6 +35,7 @@ BEGIN
IDS_RESOURCE_INTERRUPT "IRQ"
IDS_RESOURCE_DMA "DMA"
IDS_RESOURCE_PORT "I/O shtrirje"
+ IDS_COPY "&Kopjo"
END
/* error messages, source:
http://www.z123.org/techsupport/medm.htm */
diff --git a/dll/win32/devmgr/lang/tr-TR.rc b/dll/win32/devmgr/lang/tr-TR.rc
index 8e5bb542e2d..b3ba51800b9 100644
--- a/dll/win32/devmgr/lang/tr-TR.rc
+++ b/dll/win32/devmgr/lang/tr-TR.rc
@@ -33,6 +33,7 @@ BEGIN
IDS_RESOURCE_INTERRUPT "IRQ"
IDS_RESOURCE_DMA "DMA"
IDS_RESOURCE_PORT "G/Ç Aralığı"
+ IDS_COPY "K&opyala"
END
/* error messages, source:
http://www.z123.org/techsupport/medm.htm */
diff --git a/dll/win32/devmgr/lang/uk-UA.rc b/dll/win32/devmgr/lang/uk-UA.rc
index 35be22bf9f6..c84b01481ff 100644
--- a/dll/win32/devmgr/lang/uk-UA.rc
+++ b/dll/win32/devmgr/lang/uk-UA.rc
@@ -39,6 +39,7 @@ BEGIN
IDS_RESOURCE_INTERRUPT "IRQ"
IDS_RESOURCE_DMA "DMA"
IDS_RESOURCE_PORT "I/O range"
+ IDS_COPY "Копі&ювати"
END
/* error messages, source:
http://www.z123.org/techsupport/medm.htm */
diff --git a/dll/win32/devmgr/lang/zh-CN.rc b/dll/win32/devmgr/lang/zh-CN.rc
index ecd5e6344e9..ee8db668545 100644
--- a/dll/win32/devmgr/lang/zh-CN.rc
+++ b/dll/win32/devmgr/lang/zh-CN.rc
@@ -40,6 +40,7 @@ BEGIN
IDS_RESOURCE_INTERRUPT "IRQ"
IDS_RESOURCE_DMA "DMA"
IDS_RESOURCE_PORT "I/O 范围"
+ IDS_COPY "复制(&C)"
END
/* error messages, source:
http://www.z123.org/techsupport/medm.htm */
diff --git a/dll/win32/devmgr/lang/zh-HK.rc b/dll/win32/devmgr/lang/zh-HK.rc
index 4c5cbcc46f5..96bdc5655fa 100644
--- a/dll/win32/devmgr/lang/zh-HK.rc
+++ b/dll/win32/devmgr/lang/zh-HK.rc
@@ -39,6 +39,7 @@ BEGIN
IDS_RESOURCE_INTERRUPT "IRQ"
IDS_RESOURCE_DMA "DMA"
IDS_RESOURCE_PORT "I/O 範圍"
+ IDS_COPY "複製(&C)"
END
/* error messages, source:
http://www.z123.org/techsupport/medm.htm */
diff --git a/dll/win32/devmgr/lang/zh-TW.rc b/dll/win32/devmgr/lang/zh-TW.rc
index 94e4b65df6c..76f1ba1db40 100644
--- a/dll/win32/devmgr/lang/zh-TW.rc
+++ b/dll/win32/devmgr/lang/zh-TW.rc
@@ -39,6 +39,7 @@ BEGIN
IDS_RESOURCE_INTERRUPT "IRQ"
IDS_RESOURCE_DMA "DMA"
IDS_RESOURCE_PORT "I/O 範圍"
+ IDS_COPY "複製(&C)"
END
/* error messages, source:
http://www.z123.org/techsupport/medm.htm */
diff --git a/dll/win32/devmgr/properties/advprop.cpp
b/dll/win32/devmgr/properties/advprop.cpp
index aac24a749f7..c53fe65a46c 100644
--- a/dll/win32/devmgr/properties/advprop.cpp
+++ b/dll/win32/devmgr/properties/advprop.cpp
@@ -1897,6 +1897,31 @@ AdvProcDetailsDlgProc(IN HWND hwndDlg,
{
switch (uMsg)
{
+ case WM_CONTEXTMENU:
+ {
+ if ((HWND)wParam == GetDlgItem(hwndDlg, IDC_DETAILSPROPVALUE))
+ {
+ WCHAR szColName[255];
+
+ if (!LoadStringW(hDllInstance, IDS_COPY, szColName,
_countof(szColName)))
+ break;
+
+ INT nSelectedItems = ListView_GetSelectedCount((HWND)wParam);
+ POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
+ HMENU hPopup = CreatePopupMenu();
+
+ AppendMenuW(hPopup, MF_STRING, IDS_MENU_COPY, szColName);
+
+ if (nSelectedItems <= 0)
+ EnableMenuItem(hPopup, IDS_MENU_COPY, MF_BYCOMMAND |
MF_GRAYED);
+
+ TrackPopupMenu(hPopup, TPM_LEFTALIGN, pt.x, pt.y, 0, hwndDlg,
NULL);
+ DestroyMenu(hPopup);
+ Ret = TRUE;
+ }
+ break;
+ }
+
case WM_COMMAND:
{
switch (LOWORD(wParam))
@@ -1909,6 +1934,52 @@ AdvProcDetailsDlgProc(IN HWND hwndDlg,
GetDlgItem(hwndDlg,
IDC_DETAILSPROPVALUE));
}
break;
+
+ case IDS_MENU_COPY:
+ {
+ HWND hwndListView = GetDlgItem(hwndDlg, IDC_DETAILSPROPVALUE);
+ INT nSelectedItems = ListView_GetSelectedCount(hwndListView);
+ INT nSelectedId = ListView_GetSelectionMark(hwndListView);
+
+ if (nSelectedId < 0 || nSelectedItems <= 0)
+ break;
+
+ TCHAR szItemName[MAX_PATH];
+ HGLOBAL hGlobal;
+ LPWSTR pszBuffer;
+
+ ListView_GetItemText(hwndListView,
+ nSelectedId, 0,
+ szItemName,
+ _countof(szItemName));
+
+ hGlobal = GlobalAlloc(GHND, MAX_PATH);
+ if (!hGlobal)
+ break;
+ pszBuffer = (LPWSTR)GlobalLock(hGlobal);
+ if (!pszBuffer)
+ {
+ GlobalFree(hGlobal);
+ break;
+ }
+
+ wsprintf(pszBuffer, L"%s", szItemName);
+
+ GlobalUnlock(hGlobal);
+
+ if (OpenClipboard(NULL))
+ {
+ EmptyClipboard();
+ SetClipboardData(CF_UNICODETEXT, hGlobal);
+ CloseClipboard();
+ Ret = TRUE;
+ }
+ else
+ {
+ GlobalFree(hGlobal);
+ }
+ break;
+ }
}
break;
}
diff --git a/dll/win32/devmgr/resource.h b/dll/win32/devmgr/resource.h
index b99006e05ac..a515dfaba38 100644
--- a/dll/win32/devmgr/resource.h
+++ b/dll/win32/devmgr/resource.h
@@ -61,6 +61,7 @@
#define IDS_MENU_SCAN 94
#define IDS_MENU_ADD 95
#define IDS_MENU_PROPERTIES 96
+#define IDS_MENU_COPY 97
/* menu hints */
@@ -127,6 +128,7 @@
#define IDS_RESOURCE_INTERRUPT 0x11A
#define IDS_RESOURCE_DMA 0x11B
#define IDS_RESOURCE_PORT 0x11C
+#define IDS_COPY 0x11D
#define IDS_DEV_NO_PROBLEM 0x200
#define IDS_DEV_NOT_CONFIGURED 0x201