Results 1 to 2 of 2

Thread: processidtosessionid api (terminal services)

  1. #1
    Junior Member
    Join Date
    May 04
    Location
    buffalo, ny
    Posts
    18

    processidtosessionid api (terminal services)

    hi everyone,
    i have an api call that gets the process id of an application (to get the path of the exe that is running) and in a terminal services environment i need to determine which Terminal Services session that process is using. I am trying to detect if the user is already in an application before logout, and the current procedure is returning the programs from different sessions, and i need to sort them out. I found documentation on msdn for a processidtosessionid api call, but they do not have a vb implementation example. has anyone used this? is this the right approach?

    thanks in advance for your help.

    m.

  2. #2
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 01
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    59,467
    I have a similar issue. I need to kill any previous instances of my
    app on a terminal server and not other users instances. I got
    about as far as just enumerating the processes looking for the
    module name matches. Maybe this will help you and if you get it
    let me know how. Look at Wokawidget's post.

    terminate+process
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (VBA, VB 6, VB.NET, C#)
    Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Star Wars Gangsta Rap Reps & Rating PostsVS.NET on Vista (New)Multiple .NET Framework Versions (New)Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel Core 2 Extreme Ed., 2 WD Raptor 10K RPM 150 GB HDs RAID 1, 2 GBs DDR2 667 MHz RAM, 3 Viewsonic 17" LCDs, Windows Vista RTM, IE 7, Office 2007

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •