[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.
This commit is contained in:
Alexey Strukov 2023-10-10 22:22:54 +03:00 committed by GitHub
parent 62eeb158a5
commit 8451230753
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
28 changed files with 99 additions and 0 deletions

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */

View File

@ -33,6 +33,7 @@ BEGIN
IDS_RESOURCE_INTERRUPT "IRQ"
IDS_RESOURCE_DMA "DMA"
IDS_RESOURCE_PORT "Rang I/O"
IDS_COPY "&Copier"
END
STRINGTABLE

View File

@ -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 */

View File

@ -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

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */

View File

@ -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;
}

View File

@ -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