Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Process Detected on Two different Desktop Sessions

Posted on 2013-10-29
6
Medium Priority
?
282 Views
Last Modified: 2013-11-22
Hi,
Application is running on another remote desktop session on the same PC (using remote desktop connection) and the following code is detecting both instances on the two different desktops.
What is the easiest way to  return only the number of processes  on this one remote desktop ?
0
Comment
Question by:KBanner
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 35

Expert Comment

by:sarabande
ID: 39610929
you should add the code.

Sara
0
 

Author Comment

by:KBanner
ID: 39611194
Public Shared Function bCheck4Running(ByVal sApp As String) As Boolean

        Dim ps() As Process
        ps = System.Diagnostics.Process.GetProcessesByName(sApp) 
        'if more than one Tracker Pro open
        If ps.Length > 1 Then

            Call KillProcess("TrackerProSplashScreen") 
            MsgBox(sApp & " is already running!", MsgBoxStyle.Critical, sApp & " Failure") 

            Return True
        End If

        Return False
    End Function

Open in new window

0
 
LVL 35

Accepted Solution

by:
sarabande earned 2000 total points
ID: 39611225
you may check whether the "MachineName" property of the processes in the returned array would be different for the processes running at the remote desktop. if so, you could use an overload of GetProcessesByName which takes two arguments, one for the name and one for the machine.

if the machine name is not different you may check other properties for filtering. see

http://msdn.microsoft.com/en-us/library/System.Diagnostics.Process_properties(v=vs.110).aspx


Sara
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:KBanner
ID: 39611283
Sara, Thanks so much. Let us give it a try, and get back to you.
0
 

Author Comment

by:KBanner
ID: 39668853
Thks Sara, forgot to give you the points! My apologies
0
 

Author Closing Comment

by:KBanner
ID: 39668854
Top notch answer
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question