Uniquely identify external storage [closed] - c++

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
Using C++ and the Win32 API, I have to uniquely identify an external HDD. That is, I have to retrieve some sort of ID number, which I can later use to see if the same HDD is connected to the computer.

Your best option would be to retrieve the HDD serial number. You could use WMI to retrieve this, here's a PowerShell command to do this:
Get-WmiObject Win32_PhysicalMedia | select SerialNumber
Note that the returned serial number may be returned in a mangled or encoded form.
A sample how to code this in C++ can be seen here. Basically you need to connect to the IWbemServices COM root\cimv2 namespace, study the documentation for details.

Related

how to know how many device connectd to sqlserver remotly [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
hello i have a program linked with mysql server remotly
i want to know devices connected number ?
It's unlikely you can count devices, however there is a system table information_schema.processlist which shows MySQL server process list, you can count hosts there. See details here on required privileges and fields.

How to create an installer with InnoSetup running in only one computer to prevent unauthorized copy [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
I am using Innosetup to create an installer for my application (test.exe using Qt creator). I need that my application should be running on only one machine (unauthorized copies in other computer). I don't know how to make a function in Innosetup to identify if the address IP corresponds to the authorized machine or not. Else it should not run my application.
If you are looking for an solution for anti-copy the application, you can read the SID of the PC installed, store the SID in your application. Every time your application launches, the first step is to read the SID, then compare to the initial SID, if not match, exit your application.

How to get computer device manager information as text result in cpp code? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
How to get computer device manager information (in Windows (especially win 10)) as text result in cpp code?. In addition I don't want to use registry i my code.
You can get information of device manager using Windows Management Instrumentation(WMI) or by using Setup APIs. One example of Setup APIs for getting device manager information can be found in code project.

Programmatically get active connections in windows [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I would like to get all active connections (similar to TCPView from sysinternals) on a windows machine, using WinAPI.
How can I do this using Winsock ?
Winsock does not provide any functionality to get a list of active connections.
The GetTcpTable(), GetTcpTable2(), GetTcp6Table, and GetTcp6Table2() functions of the IP Helper API provide the information that you are looking for.

Listening for wave out in windows [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
So I want to "listen" to the output to sound devices in windows. Preferably in C/C++. I have no idea what a proper starting point would be for this on windows and was wondering if I could get pointed in the right direction to capture sound. I would like to do this so that I can change different settings based on the sound that is playing. I am not looking to listen through a microphone
You need to work with Windows audio related COM-based interfaces. Starting point is to obtain a reference to the IMMDevice interface of an endpoint object in a device collection by calling the IMMDeviceCollection::Item method. Afterwards, it is possible to get a reference to the IMMEndpoint interface of an endpoint object by calling the IMMDevice::QueryInterface` method. After retrieving a collection of endpoint devices, it is possible to query the properties of the individual devices in the collection to determine their suitability for use.
This is one example and this is another