monitor

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

时光总嘲笑我的痴心妄想 提交于 2019-11-28 06:22:45
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. franc0is You need to set the following registry key to completely disable the Windows locking feature: [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System]

Find Number and resolution to all monitors

烈酒焚心 提交于 2019-11-28 05:21:00
How would one poll windows to see what monitors are attached and what resolution they are running at? 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.GetType().ToString()); listBox1.Items.Add("Working Area: " + screen.WorkingArea.ToString()); listBox1.Items.Add(

Monitor battery charge with Win32 API

廉价感情. 提交于 2019-11-28 03:49:47
问题 I'm trying to write a small app that monitors how much power is left in a notebook battery and I'd like to know which Win32 function I could use to accomplish that. 回答1: For Vista and up you can use RegisterPowerSettingNotification For earlier functions see the Power Management Functions in this section of the MSDN page "Power Management Functions: Windows Server 2003 and Earlier" You can see example code of the Vista method on codeproject. 回答2: I recommend the use of the Win32

Semaphore vs. Monitors - what's the difference?

我的未来我决定 提交于 2019-11-28 02:31:11
What are the major differences between a Monitor and a Semaphore ? 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 Semaphore is a lower-level object. You might well use a semaphore to implement a monitor. A semaphore

How to analyze stack trace info of a thread?

有些话、适合烂在心里 提交于 2019-11-28 02:27:01
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? Ohkay ! I somewhat got your problem. What is your app about,? I mean is it a Game or something.? With this very info, I'll give you few

How to turn on monitor after wake-up from suspend mode? [closed]

∥☆過路亽.° 提交于 2019-11-28 02:03:08
问题 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 2 years ago . I need to wake up a PC from sleep to perform some actions using C#. I've used CreateWaitableTimer functions, everything goes fine. At given time the PC wakes up but the monitor stays in power save mode (turned off)! So I want to know, how to turn the monitor ON after wake up? PS I

How do I wake up my Windows monitors once turned off by power settings?

只愿长相守 提交于 2019-11-28 01:48:46
问题 So my Vista machine is set to turn off it's monitors after 10 minutes. (Note : machine is not suspended, or hibernated) I have a .Net application running, that needs to "wake" the system at a specified time. As a human, you just move the mouse or press a key. How do I do this programatically? I've tried : programatically setting the cursor; using "SendKeys"; and even pinvoking CreateWaitableTimer to unsuspend (even though it's not suspended) in the hope that that would trigger something.

Why await of Condition releases the lock but signal does not?

落爺英雄遲暮 提交于 2019-11-28 01:26:18
问题 I write the below code to test when will the thread is awake when it is waiting for a Condition object. But I find I have to unlock after I call signal() . Lock is not release by this method, while await() will release this lock . This is from Condition#await The lock associated with this Condition is atomically released and the current thread becomes disabled for thread scheduling purposes and lies dormant until one of four things happens: And this is from Conditon#signal Wakes up one

Win32 code to get EDID in Windows XP/7

▼魔方 西西 提交于 2019-11-28 00:33:39
I found this page and was unable to get any useful information out of it (it searches the registry for something but never finds it and goes into an infinite loop). As this question regarding getting the monitor serial UID ("EDID information") asks I would like the same information but from the point of view of Win32 C code (or C/C++ DDK code, or whatever) instead of Linux. WMI didn't support monitor classes in Windows XP. The documented way of getting the EDID was - and still is - with the Setup API. Longer survey and a VC++ code sample are available here . First I got a C# version working

Android Emulator: How can I get a list of services that are running

只谈情不闲聊 提交于 2019-11-27 20:22:52
问题 I have the Android Emulator running in my Ubuntu VM and just installed an apk file trough the console. The emulator and adb have many options to view what is going on on the device. But how can I get a list of services that are currently running? I'm trying to find out if a specific app installes a notify service to view (unwanted) ads. I even know the services' name. PS.: I'm an advanced beginner - but not advanced enough. So thanks for your help. 回答1: You can get the list with the following