I try get CPU statistics from Win32_Perf, but i cannot find it. In WMI Explorer and WMI Code Generator is simply not displayed.
Where find this WMI class?
Related
I'm making my own process monitor and I would like to inquiry processes which are using GPU(CUDA/OpenCL for monitoring unintended execution of CryptoCoin miners.
I tried with System.Management, but I couldn't find any querystring for it.
What should I do for it? I googled several time for it, but no useful informations were found.
According to the docs, OpenHardwareMonitor should publish 2 class (Hardware and Sensor) to the WMI but I cannot see any. I OpenHardwareMonitor has full read & write access to WMI so I'm not sure what's wrong. Am I even going about it the right way and should you be able to see those classes?
EDIT
Probably a cause of the same problem but when attempting to use the namespace OpenHardwareMonitor in my c# app
using OpenHardwareMonitor;
it does not recognise it
I forgot to add the .dll to my resources. Rookie error
For my project I need a way to get data regarding screens that are connected.
In specific, I need to identify whether a monitor is a laptop internal screen or an external screen, and get all the screen data.
I need to get this information both in c++ and C#.
I read about Win32_DesktopMonitor, about EnumDisplayDevices and about Screen Class.
I read also some related questions here:
Monitor ID and Serial Number
Find Number and resolution to all monitors
EnumDisplayDevices vs WMI Win32_DesktopMonitor, how to detect active monitors?
I havn't found an answer yet. Any Ideas?
To get the information whether monitor is internal you can use WMI class WmiMonitorConnectionParams from root\wmi namespace.
Code would need to create a CimSession by connecting to WMI either through DCOM or WinRM (with authentication as needed if enumerating remote computer monitors), then call EnumerateInstances(#"root\wmi", "WmiMonitorConnectionParams") on that session.
Resulting collection will contain InstanceName (string) and VideoOutputTechnology (UInt32).
You will need both for each monitor so you can match them with the other stuff you need.
If VideoOutputTechnology is 0xFFFFFFFF, then that's the Default Monitor entry and it can be ignored. If it is 0x80000000, then it is internal. Other types of connection are documented in d3dkmdt.h header file (online documentation at the moment of this writing does not provide correct values for the enum).
The most reliable way to get model, serial number, as well as year and week of manufacture is by reading and parsing the raw EDID block (by calling WmiGetMonitorRawEEdidV1Block).
I hope you can get by on your own from here.
What you can do is query the Windows WMI classes:
http://msdn.microsoft.com/en-us/library/aa394554(v=vs.85).aspx
Those classes allows the user to collect various information about the computer (hardware, os, ...)
I don't know if you'll find the properties you need, but it might be worth a look.
You're looking for this class:
http://msdn.microsoft.com/en-us/library/aa394122(v=vs.85).aspx
I have to make a program which monitor usb ports and when an usb device is plugged (joypad, flash drives, mouse, ecc...) I get a unique identifier (a deviceid or something else would be good).
At first I tried with C# using the system.management classes and querying the cim_logicaldevice class each second to get the new device plugged.
Some device returned more rows with DeviceID, but this isn't a problem. The problem is that the memory occupied by the program (in task manager) grows up constantly.
This is the source code:
http://pastebin.com/dQv3cMQC
Is there a way to avoid the growing of the memory usege?
I have to do this program in C++ or C# and it has to be the most efficient possible (because it has to be opened forever).
I would recommend looking at the USBView sample in the WDK. If you are unfamiliar with this, simply run it - this tool walks the entire USB tree on the system and prints out information and descriptor listings for each device.
In your case, I'd start at the RefreshTree() function in this sample, you can then follow the code to see how it enumerates the host controllers, hubs and finally devices. For each device that you find you can look at the bInterfaceClass in the interface descriptors to find out what types of interfaces it is advertising.
The easiest way to get the source to this sample is to install the 7.1.0 WDK which is currently available here: http://www.microsoft.com/en-us/download/details.aspx?id=11800
I am wondering if there is a tool which can trace a list of files (Text/any external file/s) my C# Program is using/Accessing ? =D
is there any sort of tool?
p.s. its to test Program Security .. ;)
ProcessMonitor monitors any filesystem, registry, thread, network and eventlog activity.
Process Explorer can be helpful.
Yes, there is an excellent program by SysInternals, now bought by MS. Take a look at http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx
I agree with VVS that Process Monitor is just the right tool for your needs. Just wanted to add that to get what you need you would have to set up some filters. Press Ctrl-L and create a filter based on the process name. You can also see registry and network activity. Process Explorer doesn't show the detailed log of all operations, rather you can see the current activity and open handles.
Thank you much..
Process monitor has great abilities and it tensed me .. :'(
Because i am storing Hdd serials informations for security in text files and this software has traced almost everything ...
Now i know why my last program was hacked :CRY: