Windows enumerates device information

Enumeration of device information is mainly implemented through the interface in the SetupAPI module, in conjunction with the corresponding device class GUID. Here we take enumerating USB device information as an example, including device instance addresses, etc.: #include <stdio.h> #include <Windows.h> #include <SetupAPI.h> #pragma comment(lib, “SetupAPI.lib”) #include <devguid.h> // The specific device GUID requires initguid, […]

VSCode: Enumerate USB devices

Historically, reading and writing devices to a USB port has been a level more complicated than using a serial port or parallel port. To open a USB port (host side), first enumerate the visible devices connected to the port, and specify the relevant port (the port to which the device needs to be operated is […]

Java Chapter Thirteen: Enumerated Types and Generics

Enumeration type Use enumeration types to set constants When setting constants, we usually place them in the interface so that they can be used directly in the program. This constant cannot be modified because when the constant is defined in the interface, the modifiers of the constant are changed to final and static. The general […]

Two ways for R3 to enumerate processes and modules under 64-bit operating systems

Two ways to enumerate processes and modules in the application layer 1. Snapshot enumeration process BOOL EnumProcesses(HWND hProcessList) {<!– –> ListView_DeleteAllItems(hProcessList); PROCESSENTRY32 pe = {<!– –> 0 }; pe.dwSize = sizeof(pe); HANDLE hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); int i = 0; TCHAR buff[256] = {<!– –> 0 }; while (Process32Next(hSnap, & amp;pe)) {<!– –> ListInsertItem(hProcessList, i, […]

C# enumerate audio devices through winmm

Article directory Preface 1. How to achieve it? 1. Add dependencies (1). Nuget installs the winmm package library (2) Supplementary interface 2. Define entities 3. Implement enumeration 2. Complete code 3. Usage examples Summarize Foreword When using C# to record audio, you need to obtain the audio device information. For example, when using ffmpeg to […]

CheckMenuItem() function, EnumPrinters() enumerate printers AppendMenu(), add menu printerPropertites() GetMenuString()CreateIC()

/********************************************** ******* 078.C Example 78: Obtain monitor and printer device information WM_SETTINGCHANG Message: System setting change CheckMenuItem function EnumPrinters(): Enumerate printers AppendMenu(): Add menu Openprinter (): Open the printer printerPropertites(): Printer properties GetMenuString(): Get menu string CreateIC(): Obtaining information about the current device environment is different from CreateDC This program can only run on 32-bit, […]

What do detach(), permute(), and enumerate() mean in the code?

Article directory Question based on the above code: Q: Could you please explain what the above code means? Question: grid_im = grid.detach().cpu().permute(1, 2, 0).clip(0, 1) * 255 Explain this code in detail Question: grid_im = Image.fromarray(np.array(grid_im).astype(np.uint8)) Explain this code in detail Question: output_im = Image.new(“RGB”, (size * len(images), size)) Explain this code Question: What does […]

[MFC] tab control imitates task manager and enumerates windows and processes

Interface and associated variable settings Create an MFC project based on a dialog box, add a tab control to the main dialog box (set the associated variable type: CTabCtrl name: m_tab), add two sub-dialog boxes (IDC_PAGE1 and IDC_PAGE2), and add a list control control to the sub-dialog box ( Set the associated variable type: CListCtrl […]