LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

detect remote desktop connection

Hey,

 

I want to detect if the current user-session is a remote or local session. I have only LabVIEW 2012 at hand, so I think I need it to switch between absolute and relative mouse scrolling detection dependent on the session type.

 

My approach is to check this by executing 'qwinsta' via the System Exec.vi:

 

Unbenannt_1d.png

 

however this doesn't work at all 😞 While standard commands like 'cd' render no problem, this one throws just an error 'command not found'. If I start this command manually on a command line it just works without any problem.

 

So I hope you can give me hint on the problem - or to an way more easy solution to the whole problem.

 

Thanks in advance, Erik

0 Kudos
Message 1 of 6
(3,819 Views)

While I can't answer your actual question I think it won't help with your problem. I've seen machines with relative and absolute scroll wheel behavior also without using remote desktop. I don't know a way to find out how the scroll wheel behaves without actually testing it on each machine.

 

0 Kudos
Message 2 of 6
(3,800 Views)

Ah, another dimension to the problem, yeah^^

 

But at least in the system I tested, the behaviour seems consistent. So separating remote/local users may be something to start with.

Or is there a more low-level approach to check the scrolling behavior?

 

 

0 Kudos
Message 3 of 6
(3,790 Views)

There is a more low-level approach to check the scrolling, see this thread: http://forums.ni.com/t5/LabVIEW/Mouse-wheel-scroll-event-ON-CHANGE/td-p/860112/page/2

Using the method from that thread might require some architectural changes, but you'll end up with an event based scroll detection instead of unreliable polling and assumption of absolute/relative scroll behavior.

 

 

0 Kudos
Message 4 of 6
(3,765 Views)

thank you very much dan_u.

way more complex than my polling version, but surely more sophisticated - i will give it a try

 

in the meantime, 5 hrs of google searches also led to the answer of my initial question:

 

i've running 32 Bit Labview on a 64 Bit Windows...thats all. As this is the case, all commands I send to cmd are executed in the 32 Bit Version of cmd.exe, as this version is automatically called from my 32 Bit LabVIEW.

 

There is no qwinsta in 32 Bit cmd.exe.

 

Calling "c:\windows\sysnative\cmd.exe" instead of "cmd" let you escape the 32-Bit Sandbox of SysWoW64 (but not without complaining of my antivirus) and qwinsta returns the expected result.

 

Reference:

https://social.technet.microsoft.com/Forums/scriptcenter/en-US/5bfc1d5b-1162-495a-bc89-252de06e4baa/...

 

Thanks,

Erik

Message 5 of 6
(3,757 Views)

That's interesting, thanks for sharing. Never would have thought about this.

 

0 Kudos
Message 6 of 6
(3,752 Views)