Detect when plugged into dock?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
Iomega0318
Posts: 83
Joined: 06 Apr 2015, 14:56
Location: Wolfforth, TX
Contact:

Detect when plugged into dock?

05 May 2015, 14:27

So I use a Lenovo Laptop and when at work I use a dock, is there a way to detect when I am using the dock so that I can start certain scripts and what not when I turn the computer on and then have other things run when it's not on the dock? Or perhaps does anyone know of a script or program that already does this?

I read a few posts regarding screen resolution and I suppose I "could" try and use that as a detection method but I don't know how reliable that will be or if there is a better way..

If not I suppose it's okay I'm just curious..

Thank you.
diaewad
Posts: 101
Joined: 17 Feb 2015, 10:55

Re: Detect when plugged into dock?

05 May 2015, 14:32

I use a script that does this with number of monitors, because I have 2 at work and only 1 at home. Obviously that wouldn't work, if you use the same amount on and off the dock.
guest3456
Posts: 3463
Joined: 09 Oct 2013, 10:31

Re: Detect when plugged into dock?

05 May 2015, 14:39

quick google results show that its tough, and that the drivers report the docking state to the OS, which makes it unreliable across different systems

if its just for your personal use, you can try some of these

http://lmgtfy.com/?q=winapi+detect+if+laptop+is+docked

User avatar
Iomega0318
Posts: 83
Joined: 06 Apr 2015, 14:56
Location: Wolfforth, TX
Contact:

Re: Detect when plugged into dock?

05 May 2015, 14:43

diaewad wrote:I use a script that does this with number of monitors, because I have 2 at work and only 1 at home. Obviously that wouldn't work, if you use the same amount on and off the dock.
This could work, I only use the laptop when I am at home, no dock and too lazy to hook up other monitors lol..
guest3456 wrote:quick google results show that its tough, and that the drivers report the docking state to the OS, which makes it unreliable across different systems

if its just for your personal use, you can try some of these

http://lmgtfy.com/?q=winapi+detect+if+laptop+is+docked
See this I did not know lol, I had no idea how the dock interacts with the computer..
toralf
Posts: 868
Joined: 27 Apr 2014, 21:08
Location: Germany

Re: Detect when plugged into dock?

05 May 2015, 15:27

Depending on the environment you have at work you could check also for network drives or maybe wifi
ciao
toralf
User avatar
Iomega0318
Posts: 83
Joined: 06 Apr 2015, 14:56
Location: Wolfforth, TX
Contact:

Re: Detect when plugged into dock?

05 May 2015, 15:41

I use Ethernet at work, WiFi at home and we use a VPN when we work from home to connect to all the same network drives.. Can you detect which network connection your using, I didn't know that was possible :) I am loving AHK more and more each day lol..

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: aitaixy, Anput, Nerafius, RandomBoy and 185 guests