Trax Posted August 2, 2017 Share Posted August 2, 2017 I have been racking my brains on this forever but am not in-depth enough with AutoIt to figure it out. I want to write a program that will automatically jump to a function if a serial port is added or removed from a computer. I am not sure how to explain it other then that. A simple example would be to write a program that will display "Comport Added" when a user adds a serial port to a computer (to be specific it will be a virtual serial port via a USB cable but will show up in device manager as a COM Port) and will display "Comport Removed" when a serial port is removed (pulling the USB cable). I would like it to be "event driven" so that no matter where the program is or what it is doing it will immediately jump to (and return from) a user defined function. Any ideas would be GREATLY appreciated...... Link to comment Share on other sites More sharing options...
genius257 Posted August 2, 2017 Share Posted August 2, 2017 Hi @Trax I think maybe WM_DEVICECHANGE is a solution? Here's an example that may help you get started [Solved] Check for a specific Hardware ID in WMI Object (#17) My highlighted topics: AutoIt Package Manager, AutoItObject Pure AutoIt, AutoIt extension for Visual Studio Code Github: AutoIt HTTP Server, AutoIt HTML Parser Link to comment Share on other sites More sharing options...
Trax Posted August 8, 2017 Author Share Posted August 8, 2017 A million thanks genius257. Exactly what I was looking for. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now