![]() ![]() I found out that extra devices are present in Device Manager when laptop is docked. The above conditions ensure that laptop will not shutdown when I just undock. I needed a way for a background task to shutdown Windows properly when these conditions are met:ġ) Power supply to laptop has changed from AC to DCĢ) The laptop is docked to docking station The problem is when AC is cut, laptop will still be running on battery. For turning on laptop when AC power is back, you need to enable "Wake On AC" in BIOS. ![]() My ultimate goal is to connect laptop power supply from docking station to a smart plug and use Google Home Assistant to turn laptop on/off using voice commands. I faced similar problem trying to determine if my laptop is docked. Is there some Windows 7+ feature where the OS can tell that a laptop is on a docking station or not? I could pass a parameter to the program on startup with the name of the monitor to look for, but I'm trying to find out if there is a better way. The main problem is if I ever change the monitor, then the program will stop working. ![]() "Samsung U32D970Q") via EnumDisplayDevices calls whenever WM_DEVICECHANGE happens. So far, I have a working program that starts up with only a little icon in the system tray, and it will make the changes I want when it's docked versus undocked, BUT the way I'm determining the laptop is docked is by looking for the specific hardcoded monitor name I have connected to my docking station (e.g. I already have it set to do what I want when it's powered by the battery versus AC in the standard power Windows profiles, but I want a different power plan when the laptop is on the docking station than when it's just plugged into the AC adapter and not on the docking station. I would like to have my own utility that detects when the laptop is docked or undocked, then change the power profile settings. I have a laptop that runs Windows 7, but may eventually move to Windows 10. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |