473,402 Members | 2,050 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

Detecting If User Is In Remote Desktop Mode

SqUiMbO
I have been searching and searching for a way to detect whether or not the user who launched my application is a local user or someone that is "remoted" in. This sounds like a very simple thing to check, but I cannot find any articles about it anywhere, nor could I find it in the Microsoft language reference. I know that is it possible, as, for example, Windows will not a "remote" user run a Direct3D app. It pops up a message saying something like "You cannot run Direct3D while in Remote Desktop" (I found this catchable error while playing around with XNA). However, this question is not about XNA! I am building a screensaver with VB 2005 (non-D3D) and I need to do this check, because on certain machines (servers) there will be several users logged in at one time and they do not want 10 screensaver instances to peg out the CPU needle. If the user is "remote", I am going to tell the screensaver to show a "dumbed-down" version (blank screen) to save precious CPU usage. I just need to know how to check for this!!! If you have any suggestions, work-arounds, or can just point me in the right direction, I would be greatful! THANKS!
Feb 21 '07 #1
8 5946
I guess I did not look "deep" enough or for the right thing. I found this post buried in thescripts discussions...

http://www.thescripts.com/forum/thread442528.html

It only works on Windows Server though (which I luckily have). Now I just have to figure out how to get Flash installed on my Windows server, without the stupid info bar blocking my every move! LOL But that's not relevant to this topic...

If you have any other suggestions about detecting RDP (especially on a Windows XP machine), I would still love to hear them.
Feb 21 '07 #2
RedSon
5,000 Expert 4TB
Have you looked through the System.Security Namespace?
Feb 21 '07 #3
SUCCESS!!! I think. Yes, I had previously looked through the System.Security namespace (mainly system.security.principal). It seems like there should have been an "isLocal" or "isRemote" property, but of course there is not. I got to looking deeper in the Object Browser and discovered this buried DEEP within the Windows.Forms ns.

Public Shared ReadOnly Property TerminalServerSession() As Boolean
Member of: System.Windows.Forms.SystemInformation
Summary:
Gets a value indicating whether the calling process is associated with a Terminal Services client session.

Return Values:
true if the calling process is associated with a Terminal Services client session; otherwise, false.


It at least worked the first time I tried it. Returned "false" when ran locally (on XP) and returned "true" when I tried to run it remotely (also Windows XP). It needs a little more testing, but I think it is the correct thing to use for my purposes. I will post again after I give it a "good" testing!
Feb 21 '07 #4
RedSon
5,000 Expert 4TB
Great I'm interested to see how it turns out!
Feb 21 '07 #5
It seems to be working great for both XP and Windows Server 2003! At least with Remote Desktop Connection. I do not know how it will react with certain 3rd party terminal connection software, because I have none to try. I suppose a terminal connection is a terminal connection though.
Feb 22 '07 #6
RedSon
5,000 Expert 4TB
If the use is authenticated through the windows operating system it will have a unified security context for you to query based on that users GUID/SECUID, so no worries there :)
Feb 22 '07 #7
I only know vb6, could someone perhaps send me a copy of a working compiled version of this code that I could some how integrate into a vb6 app?

deleted

Thanks.
Jan 11 '08 #8
RedSon
5,000 Expert 4TB
I only know vb6, could someone perhaps send me a copy of a working compiled version of this code that I could some how integrate into a vb6 app?

deleted

Thanks.
No .
Jan 11 '08 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Erik Bethke | last post by:
Hello All, I am trying to clean up some polish bugs with the Shanghai game I am working on and I am currently stuck on trying to get the right event for detecting when the user has changed the...
1
by: Erik Bethke | last post by:
Hello All, I am trying to clean up some polish bugs with the Shanghai game I am working on and I am currently stuck on trying to get the right event for detecting when the user has changed the...
3
by: James Yang | last post by:
Hi, I am using Sockets to connect to a remote computer and send data using Socket.Send() and receive using Socket.Receive() (block mode) . for somereason tho, when the client disconnects the...
5
by: premmehrotra | last post by:
I currently have a multi-user access database which is put on a shared drive L: on a Windows Servers. Entire database is one file premdb.mdb. Users access this database from their laptops....
6
by: Ian Frawley | last post by:
Hello everyone I have written a Windows Service to monitor local and remote Processes/Applications. However I am stuck because if it is installed as a user account I cannot get it to interact...
3
by: Elp | last post by:
Hi, I have developped a Windows applcation (in C#) that allows, among other things, users to view and control the desktop of a remote Windows XP Pro machine. I have actually simply embedded the...
1
by: anonieko | last post by:
Problem When Remote Desktop to my main office machine, and when trying to connect to SQL Express, I was becoming increasingly frustrated with the following error: Error: 'Failed to generate a...
0
by: =?Utf-8?B?U2VudGhpbCBTdWJyYW1hbmlhbg==?= | last post by:
Our requirement is to run the vb dot net application in minimize mode with system tray icon in the remote machine (remote desktop). When we running in the remote desktop window is showing in...
2
by: =?Utf-8?B?RGFubnk=?= | last post by:
Will remote Desktop work through two routers? I have a new client that has a wired D-link connected to the dsl modem and a Belkin wireless connected to the D-link. I can't get remote desktop to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.