Ronin7 Posted yesterday at 01:55 PM Report Posted yesterday at 01:55 PM (edited) Good morning I am trying to find a mechanism to determine which monitor a mouse is on (to determine which monitor to display a pop up). I can probably get calling VIs monitor but that is not exactly what I need..... Any help is appreciated! Edited yesterday at 02:07 PM by Ronin7 Quote
crossrulz Posted 8 hours ago Report Posted 8 hours ago There is an Application property called Display->All Monitors. It will give you the pixel ranges of the monitors in your system. What I've done is to use the calling VI's position to figure out which monitor it was on and then place the new VI window as needed. You could use a win32 dll call to get the mouse position as well if that better meets your requirements. 1 Quote
hooovahh Posted 6 hours ago Report Posted 6 hours ago I posted a demo set of VIs here which can pop up a window, centered on whatever monitor the mouse is on. There's also settings to have the window center on the mouse wherever it is, but saying on the same monitor. And yes this uses the All Screens, Working Area properties. 1 Quote
Ronin7 Posted 6 hours ago Author Report Posted 6 hours ago @crossrulz@hooovahh Thank you very much for the assistance- the VIs Hooovahh put together will be perfect for what I am trying to do. Hooovahh- It looks like the center on mouse took a fair amount of fussing to get working so I appreciate you posting the code as it will save a lot of time. I can tell you this much- NI should be paying you guys for figuring this stuff out which should be basic functionality for UI interaction...... Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.