monitor

How to obtain the correct physical size of the monitor?

丶灬走出姿态 提交于 2019-11-27 07:54:40
How can I get the size of the display in centimeters or inches? This code does not always works correctly: HDC hdc = CreateDC(_T("DISPLAY"),dd.DeviceName,NULL,NULL); int width = GetDeviceCaps(hdc, HORZSIZE); int height = GetDeviceCaps(hdc, VERTSIZE); ReleaseDC(0, hdc) Especially for multi-monitor configuration. Update: I need to get the size just for ordinary monitors, which have a constant physical size. I found another way. The physical size of the monitor are stored in the EDID, and Windows are almost always copies of its value in the registry. If you can parse EDID, you can read the width

CPU temperature monitoring

痞子三分冷 提交于 2019-11-27 07:27:30
For a programming project I would like to access the temperature readings from my CPU and GPUs. I will be using C#. From various forums I get the impression that there is specific information and developer resources you need in order to access that information for various boards. I have a MSI NF750-G55 board. MSI's website does not have any of the information I am looking for. I tried their tech support and the rep I spoke with stated they do not have any such information. There must be a way to obtain that info. Any thoughts? Justin Niessner For at least the CPU side of things, you could use

How can i monitor requests on WKWebview?

无人久伴 提交于 2019-11-27 06:21:19
How can i monitor requests on WKWebview? I'v tried using NSURLprotocol (canInitWithRequest) but it won't monitor ajax requests (XHR), only navigation requests(document requests) Benzi Heler Finally I solved it Since I don't have control over the web view content, I injected to the WKWebview a java script that include a jQuery AJAX request listener. When the listener catches a request it sends the native app the request body in the method: webkit.messageHandlers.callbackHandler.postMessage(data); The native app catches the message in a delegate called: (void)userContentController:

How to analyze stack trace info of a thread?

≯℡__Kan透↙ 提交于 2019-11-27 04:53:50
问题 I'm trying to monitor performance of my app; When cpu usage overloads, I dump the stack trace of the suspicious thread and main thread as string by two libs: https://github.com/bestswifter/BSBacktraceLogger https://github.com/plausiblelabs/plcrashreporter Following are the stack trace of one thread that I record, but it cannot help me analyze and locate where the performance issue is. Am I doing wrong or how can I analyze the stack trace of a thread? 回答1: Ohkay ! I somewhat got your problem.

How can I monitor the thread count of a process on linux?

本小妞迷上赌 提交于 2019-11-27 04:09:08
问题 I would like to monitor the number of threads used by a specific process on Linux. Is there an easy way to get this information without impacting the performance of the process? 回答1: try ps huH p <PID_OF_U_PROCESS> | wc -l or htop 回答2: To get the number of threads for a given pid: $ ps -o nlwp <pid> Where nlwp stands for Number of Light Weight Processes (threads) . Thus ps aliases nlwp to thcount , which means that $ ps -o thcount <pid> does also work. If you want to monitor the thread count,

How to detect hot plugging of monitor in a win32 application?

假装没事ソ 提交于 2019-11-27 03:35:11
问题 I need some kind of event from Windows whenever there is a monitor that's getting plugged into system. Is there any API in Windows to do that. BTW, it is an C++ application 回答1: Use RegisterDeviceNotification to register for getting WM_DEVICECHANGE notification. 回答2: You can do it via WMI, AFAIK. I've never tried it though so I can't give much help Read here for more info: MSDN - Receiving a WMI Event 来源: https://stackoverflow.com/questions/1440285/how-to-detect-hot-plugging-of-monitor-in-a

Re-assign/override hotkey (Win + L) to lock windows

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-27 01:17:37
问题 Is it possible to re-assign the Win + L hotkey to another executable/shortcut? Use-case - I would like to switch off the monitor of my laptop as soon as it is locked. I know of a executable which can lock and turn off the monitor but I do not want to change the way the system is locked (by running the program explicitly or by some other shortcut). It would be best if Win + L can be assigned to this executable. 回答1: You need to set the following registry key to completely disable the Windows

Find Number and resolution to all monitors

我与影子孤独终老i 提交于 2019-11-27 00:54:47
问题 How would one poll windows to see what monitors are attached and what resolution they are running at? 回答1: In C#: Screen Class Represents a display device or multiple display devices on a single system. You want the Bounds attribute. foreach(var screen in Screen.AllScreens) { // For each screen, add the screen properties to a list box. listBox1.Items.Add("Device Name: " + screen.DeviceName); listBox1.Items.Add("Bounds: " + screen.Bounds.ToString()); listBox1.Items.Add("Type: " + screen

Monitoring application calls to DLL

柔情痞子 提交于 2019-11-27 00:26:39
In short: I want to monitor selected calls from an application to a DLL. We have an old VB6 application for which we lost the source code (the company wasn't using source control back then..). This application uses a 3rd party DLL. I want to use this DLL in a new C++ application. Unfortunately the DLL API is only partially documented, so I don't know how to call some functions. I do have the functions signature. Since the VB6 application uses this DLL, I want to see how it calls several functions. So far I've tried or looked at - APIHijack - requires me to write C++ code for each function.

Semaphore vs. Monitors - what's the difference?

南楼画角 提交于 2019-11-26 23:44:42
问题 What are the major differences between a Monitor and a Semaphore ? 回答1: A Monitor is an object designed to be accessed from multiple threads. The member functions or methods of a monitor object will enforce mutual exclusion, so only one thread may be performing any action on the object at a given time. If one thread is currently executing a member function of the object then any other thread that tries to call a member function of that object will have to wait until the first has finished. A