Results 1 to 8 of 8

Thread: Display to the Locally Logged On user's screen

  1. #1

    Thread Starter
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032

    Question

    How would I write a program that displays its output to the screen of the user who is logged on locally and physically seated at the computer? I have a utility downloaded from www.sysinternals.com that allows me to execute programs remotely on a NT network, and it works great for command-prompt type programs as it seems to redirect standard input and output to and from my command-prompt. However, I can launch graphical apps, and they run, but they don't display to the user's screen - they just show up under the task lists. I'm assuming they display to a "screen" created for me as a remote log-in - can I force them to the context of the local user?
    Last edited by JoshT; Apr 10th, 2001 at 10:55 AM.
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

  2. #2
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    Code:
    Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" _
    (ByVal lpBuffer As String, nSize As Long) As Long
    
    Private Sub Form_Load()
        Dim strUserName As String
        strUserName = String(100, Chr$(0))
        GetUserName strUserName, 100
        strUserName = Left$(strUserName, InStr(strUserName, Chr$(0)) - 1)
    
        MsgBox "Hello " & strUserName & " !"
        End
    End Sub
    Will find the user name, use the getwindowsdirectory API call to return the windows path & you can search for a folder named this strusername under %windir%\Profiles\ folder
    Last edited by alex_read; Apr 10th, 2001 at 10:50 AM.

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  3. #3

    Thread Starter
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032

    Question Huh?

    ?????

    I'm not sure how your reply answers my question, alex.

    GetUserName would return my username, or whatever I used to log onto the other computer, probably. The code you gave would never show to a screen because I don't seem to have a screen to display graphics to. I want to "hijack" the local user's screen (benevolently). What I think I would need is an API call so that no matter what user started the thread, its graphical output would go to the "interactive session" or something.
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

  4. #4
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    I've looked onto the site to see if I can make more sense of this, could you post a link to the actual program you downloaded from this site please ?

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  5. #5

    Thread Starter
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    http://www.sysinternals.com/ntw2k/fr.../pstools.shtml, or more specifically, the psexec program. When I was looking through MSDN, it seems I'd have to look into winstation or the behavior of services to find what I'd want to do.
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

  6. #6
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    Oh God, you want to do a PCAnywhere type app. Gotcha now, you want to run it from their system. Sorry, but this is slightly out of my leaque!

    Have you looked at the Winsock add in component with vb ?

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  7. #7

    Thread Starter
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    Yeah, I'm thinking it's more trouble than I need. I wanted to do something where I wouldn't need to install anything.

    I've used the Winsock control, and even a little with the Winsock API.
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

  8. #8
    Member
    Join Date
    Feb 2001
    Posts
    52

    Smile display to locally logged on user's screen



    hi..if all u want is to capture screen of remote pc?
    well i am doing it on alan..
    use winsock client-server..
    let say monitor wants to capture screen..i did was to..
    monitor sends message to client .."screen"
    on getting "screen"
    the client side program
    capture screen ...send it to the monitor..
    monitor..gets it and displays!!

    he he he..
    want to capture o/p..
    redirect it to a txt file..open it on monitor..use shell..
    bye..
    lxs
    lxs

Posting Permissions

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



Click Here to Expand Forum to Full Width