LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Windows 10 Virtual Desktops and LabView

Solved!
Go to solution
Highlighted

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.

https://msdn.microsoft.com/en-us/library/windows/desktop/mt186440(v=vs.85).aspx

 

Some Stack overflow messages about using it in C#:

https://stackoverflow.com/questions/31801402/api-for-windows-10-virtual-desktops

https://stackoverflow.com/questions/32416843/altering-win10-virtual-desktop-behavior

 

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.

0 Kudos
Message 1 of 5
(668 Views)

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" ?

Francine P.
Applications Engineering
National Instruments
0 Kudos
Message 2 of 5
(617 Views)

https://www.cnet.com/how-to/how-to-use-multiple-desktops-in-windows-10/

 

I think they mean this rather than virtual machines.

0 Kudos
Message 3 of 5
(613 Views)
Solution
Accepted by topic author Nathan_W10
02-07-2018 08:01 PM

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.  

Rolf Kalbermatter
Averna BV
LabVIEW ArchitectLabVIEW ChampionLabVIEW Instructor
0 Kudos
Message 4 of 5
(590 Views)

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.

0 Kudos
Message 5 of 5
(546 Views)