Results 1 to 6 of 6

Thread: How can I get screen shot from an app?

  1. #1

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    How can I get screen shot from an app?

    well, I dont want a screenshot of my own app, I want to be able to take a screenshot of a Process. I believe that I have to make it on top first. But how can I make it on top and how can I get a screenshot? I have no clue
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  2. #2
    Fanatic Member
    Join Date
    Sep 2002
    Posts
    518
    Here's a sample cut/pasted from AllAPI that looks like it does what you want, but it's in VB6... not sure if it will work the same in .NET. Hope it helps.

    Code:
    Private Declare Function PrintWindow Lib "user32" (ByVal hWnd As Long, ByVal hdcBlt As Long, ByVal nFlags As Long) As Long
    Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    Private Sub Form_Load()
        'KPD-Team 2001
        'URL: http://www.allapi.net/
        'E-Mail: [email protected]
        Dim mWnd As Long
        'launch notepad
        Shell "notepad.exe", vbNormalNoFocus
        DoEvents
        'set the graphics mode to persistent
        Me.AutoRedraw = True
        'search the handle of the notepad window
        mWnd = FindWindow("Notepad", vbNullString)
        If mWnd = 0 Then
            Me.Print "NotePad window not found!"
        Else
            'draw the image of the notepad window on our form
            PrintWindow mWnd, Me.hDC, 0
        End If
    End Sub

  3. #3

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    tnx Slow_Learner

    for some reason I cant make it to work in VB.NET...it works fine in vb6

    I checked the return value of the function in VB.NET, it doesnt return any error codes, so I'm assuming that it should work, but it doesnt

    I have a picturebox and I'm passing the handle.toint64 of the form and the picturebox to the function, doenst work
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  4. #4
    Fanatic Member
    Join Date
    Sep 2002
    Posts
    518
    Dunno, I haven't messed with graphics at all except for your windowshade thingy (which I didn't get to work heh).

  5. #5
    Hyperactive Member
    Join Date
    Dec 2001
    Location
    Dublin, Ireland
    Posts
    262
    Make sure you have converted that api function correct for vb.net - i.e. a long in vb6 is an integer now in vb.net etc.

  6. #6

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    yeah I've done that already, aint working
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

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