I have found it very useful to set up multiple virtual desktops in Windows 10. I can set up lots of charts and data displays on different desktops, and quickly switch between them with a few mouse clicks or hotkey presses. Very helpful while keeping an eye on data as it is being acquired. In my labview program, it can save and recall window setups (how many strip chart windows, data boxes, and data tables, etc were on the screen, and where were they located?), which saves a lot of time configuring data displays when we set up the data system for a test. Problem is, labview doesn't have any built in way of detecting virtual desktops, so all the windows my program launches end up piling on top of the current active desktop, rather than the desktop they were on when the layout configuration was saved.
I found that there is a COM interface in Windows that can be used to identify what virtual desktop the window is placed on, and move the window to a desired virtual desktop.
Some Stack overflow messages about using it in C#:
I'm trying to understand how to use this with Labview, if it is possible. Seems like using the ActiveX VIs would be needed, but I can't figure out how to set up the automation refnum to get access to the methods exposed by the IVirtualDesktopManager interface...
Any ideas? I'm sure this would be useful information to people, and I didn't see anything on the forum. If we can find a solution I'll post it back here in detail.
Solved! Go to Solution.
To clarify, do the VIs on different virtual machines need to communicate with each other, or are you just using the virtual machines as an organization tool to keep track of different charts, data tables, etc.?
If you are just looking for an organizational tool, I would look into using a tab control on your front panel, which can give you a similar result but all in one VI.
Also, what exactly do you mean by "all the windows my program launches end up piling on top of the current active desktop, rather than the desktop they were on" ?
While COM is the binary invocation interface on which ActiveX was build, it is not the same as ActiveX. LabVIEW ActiveX functionality can only access ActiveX interfaces. COM in itself does not provide any interface description that LabVIEW could query to discover the different methods that can be invoked, nor any property enumeration (COM objects don't have a standard property interface at all).
If you can not find an ActiveX or .Net interface to this functionality you will have to bite in the sour apple and create one yourself. This can be done as a standard DLL with function interface that you can integrate with the Call Library Node, as an ActiveX component, or a .Net assembly.
Thanks. I think it looks like you are right about the DLL.
Yes, I was referring to multiple virtual desktops on one machine.
After defining our requirements a little better, we will probably go a different route and manage data window positioning internally with LabView. It might still be worth it to add multiple desktop functionality, in the long run. If so, I'll build a dll and report back on the challenge.