Solved

Process Detected on Two different Desktop Sessions

Posted on 2013-10-29
6
280 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 34

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 34

Accepted Solution

by:
sarabande earned 500 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
Industry Leaders: 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

Is Your Team Achieving Their Full Potential?

74% of employees feel they are not achieving their full potential. With Linux Academy, not only will you strengthen your team's core competencies but also their knowledge of of the newest IT topics.

With new material every week, we'll make sure that you stay ahead of the game.

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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

687 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