Results 1 to 23 of 23

Thread: Capturing Screen Display (Peer)

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2001
    Location
    Prosperidad, Agusan del Sur, Philippines
    Posts
    10

    Lightbulb Capturing Screen Display (Peer)

    Anybody has an idea on how to capture the screen display of
    Computer A to Computer B (vice versa) considering that these computers are connected through LAN?

    Thankx...
    Last edited by rmsrelay; Jul 7th, 2001 at 09:18 AM.

  2. #2
    chenko
    Guest
    Code:
    Declare Function BitBlt Lib "gdi32" _
    (ByVal hDestDC As Integer, ByVal x As Integer, _
    ByVal y As Integer, ByVal nWidth As Integer, _
    ByVal nHeight As Integer, ByVal _
    hSrcDC As Integer, ByVal xSrc As Integer, _
    ByVal ySrc As Integer, ByVal dwRop As _
    Long) As Integer
    
    Declare Function GetDesktopWindow Lib "user32" () As Long
    
    Declare Function GetDC Lib "user32" _
    (ByVal hwnd As Long) As Long
    
    Sub Grabscreen(Dest As PictureBox)
        Dim DeskhWnd As Long, DeskDC As Long
    
        'Get the hWnd of the desktop
        DeskhWnd = GetDesktopWindow()
    
        'BitBlt needs the DC to copy the image. So, we
        'need the GetDC API.
        DeskDC = GetDC(DeskhWnd)
    
        Dest.AutoRedraw = True
        BitBlt Dest.hDC, 0, 0, _
        Screen.Width / Screen.TwipsPerPixelX, Screen.Height / Screen.TwipsPerPixelY, DeskDC, _
        0, 0, vbSrcCopy
        Dest.Refresh
    End Sub
    Use that to get the screen shot, then send the file via winsock...

  3. #3

    Thread Starter
    New Member
    Join Date
    Jun 2001
    Location
    Prosperidad, Agusan del Sur, Philippines
    Posts
    10
    How will i send the file to another computer?
    What file format will I used?
    Does this work fast?

  4. #4
    chenko
    Guest
    If you are on a LAN it wont take long, you will have to use winsock to transfer the file, do a search on it. You can always put the file to a shared location and pick it up from there.

  5. #5

    Thread Starter
    New Member
    Join Date
    Jun 2001
    Location
    Prosperidad, Agusan del Sur, Philippines
    Posts
    10
    the reason why im so excited with this simply because, there was a time that i was invited by my friend at STI college. There, I really appreciate their computer facilities which they call it MBS.

    They have 1 computer to be used by the Instructor and a lot of computers used by the students. They used the system for instruction. As the instructor click the general broadcast, all the display of student's computer will have to display what is on the Instructor's computer. Including mouse movement, clicking start menu etc. It is so very identical.

    I was so inspired that i can do the same with VB by using the same as what what you've been given to me. but the problem is mouse pointer could not be captured.

    But actually when i first saw their system, my concept is this, the video memory of student's computers was disabled and it gets from the Instructor's computer video memory.

    Am i right with my idea?

    Thank you very much for understanding me, im not so good in english, just try to understand my grammar, because im a filipino wanting to discover more about visual basic.

    Is there a way to access the data of the physical memory?

  6. #6
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    You dont need to mess with memory or whatever.
    You could just make a picturebox the exact same size of the screen, and make sure its always on top.

    Then when you receive the filedata via winsock, you would just stick the file into the picturebox.
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  7. #7

    Thread Starter
    New Member
    Join Date
    Jun 2001
    Location
    Prosperidad, Agusan del Sur, Philippines
    Posts
    10
    Is it possible to display one's computer's screen to another unnoticeable by the observer that it is actually loading a received file? (i mean no delay capturing including mouse pointer)

    for example; when i have to make a demo, when i click start button, the observers on other computer would also see what i've done with my computer, etc. as in very indentical.

    do i have to save it first to a bmp file in order to send it to another computer via winsock?

    please give light to my confusions and doubts.

    thankx for your help...

  8. #8
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Well saving it first would be the easiest way of doing it.
    But you dont have to do it that way.
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  9. #9

    Thread Starter
    New Member
    Join Date
    Jun 2001
    Location
    Prosperidad, Agusan del Sur, Philippines
    Posts
    10
    then how will i do it...

    oh... please, please help . . .

    source code is more advantageous. . .

    hello.... to somebody out there who is generous...

    please naman ohhh. tabangi ko ninyo.....
    Last edited by rmsrelay; Jul 29th, 2001 at 07:26 AM.

  10. #10

    Thread Starter
    New Member
    Join Date
    Jun 2001
    Location
    Prosperidad, Agusan del Sur, Philippines
    Posts
    10
    then how will i do it...

    oh... please, please help . . .

    source code is more advantageous. . .

    hello.... to somebody out there who is generous...

    please naman ohhh. tabangi ko ninyo.....

  11. #11
    Hyperactive Member Radames's Avatar
    Join Date
    Feb 2001
    Location
    Tech Tropics
    Posts
    360
    Well, that sounds like a hell of an application. I doubt someone's just gonna code it for you. Get a good book on Visual Basic and good luck!
    Top Tip: You can make friends and impress the opposite sex at geeky cocktail parties by saying "DB" instead of database. - Karl Moore

  12. #12

    Thread Starter
    New Member
    Join Date
    Jun 2001
    Location
    Prosperidad, Agusan del Sur, Philippines
    Posts
    10
    do you have some to best recommend to me.

    but if you have some friends out there who is very good in vb, can you solicit source code for me?

    thanks....

  13. #13
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    The source code for taking a screengrab is available on the net.
    All you have to do is look for it.
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  14. #14
    Lively Member
    Join Date
    Nov 2000
    Posts
    100

    Camtasia

    Try using this SDK. from Techsmith.

    www.techsmith.com/products/camtasia/camtasia.asp

    It claims to be able to do what you want but I haven't tried it so good luck.

  15. #15
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Might I mention that the code chenko posted works for taking a screenshot ...
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  16. #16
    New Member
    Join Date
    Aug 2001
    Location
    India
    Posts
    6

    Code? I can!

    Hi,

    If you want code for captuing the desktop of any machine in a network and transfer that image to some other machine, contact me.

    [email protected]

    :-)

    bye

    Mohan

  17. #17
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Yeah well I want booze, drugs, strippers and pizza.

    E-Mail me at [email protected]
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  18. #18
    Hyperactive Member Radames's Avatar
    Join Date
    Feb 2001
    Location
    Tech Tropics
    Posts
    360
    oohhh oohh
    naman ohhh. tabangi ko ninyo
    thank you mister for code!
    ohh ohh thank you
    someone please give me napkin I wet my pants
    oh oh naman ohhh. tabangi ko ninyo

    LOL
    Top Tip: You can make friends and impress the opposite sex at geeky cocktail parties by saying "DB" instead of database. - Karl Moore

  19. #19
    Hyperactive Member Radames's Avatar
    Join Date
    Feb 2001
    Location
    Tech Tropics
    Posts
    360
    what does naman ohhh. tabangi ko ninyo mean anyway?
    Top Tip: You can make friends and impress the opposite sex at geeky cocktail parties by saying "DB" instead of database. - Karl Moore

  20. #20
    Member
    Join Date
    Aug 2001
    Posts
    46
    Originally posted by chenko
    Code:
    Declare Function BitBlt Lib "gdi32" _
    (ByVal hDestDC As Integer, ByVal x As Integer, _
    ByVal y As Integer, ByVal nWidth As Integer, _
    ByVal nHeight As Integer, ByVal _
    hSrcDC As Integer, ByVal xSrc As Integer, _
    ByVal ySrc As Integer, ByVal dwRop As _
    Long) As Integer
    
    Declare Function GetDesktopWindow Lib "user32" () As Long
    
    Declare Function GetDC Lib "user32" _
    (ByVal hwnd As Long) As Long
    
    Sub Grabscreen(Dest As PictureBox)
        Dim DeskhWnd As Long, DeskDC As Long
    
        'Get the hWnd of the desktop
        DeskhWnd = GetDesktopWindow()
    
        'BitBlt needs the DC to copy the image. So, we
        'need the GetDC API.
        DeskDC = GetDC(DeskhWnd)
    
        Dest.AutoRedraw = True
        BitBlt Dest.hDC, 0, 0, _
        Screen.Width / Screen.TwipsPerPixelX, Screen.Height / Screen.TwipsPerPixelY, DeskDC, _
        0, 0, vbSrcCopy
        Dest.Refresh
    End Sub
    Chenko - as you see from my thread on this I'm trying to block capture through GetDC (which we think clevercontent.com does to stop screen capture). The best that I can think of is to have GetDC fired by a timer to keep it full but there must be a better way - can you help here?

  21. #21
    Member
    Join Date
    Aug 2001
    Posts
    46
    OK I've just tried GetDC in a timer and it doesn't stop PSP grabbing an individual window so we need someone who know what they are doing to help here

  22. #22
    Fanatic Member Kzin's Avatar
    Join Date
    Dec 2000
    Posts
    611
    Originally posted by chenko
    Code:
    Declare Function BitBlt Lib "gdi32" _
    (ByVal hDestDC As Integer, ByVal x As Integer, _
    ByVal y As Integer, ByVal nWidth As Integer, _
    ByVal nHeight As Integer, ByVal _
    hSrcDC As Integer, ByVal xSrc As Integer, _
    ByVal ySrc As Integer, ByVal dwRop As _
    Long) As Integer
    
    Declare Function GetDesktopWindow Lib "user32" () As Long
    
    Declare Function GetDC Lib "user32" _
    (ByVal hwnd As Long) As Long
    
    Sub Grabscreen(Dest As PictureBox)
        Dim DeskhWnd As Long, DeskDC As Long
    
        'Get the hWnd of the desktop
        DeskhWnd = GetDesktopWindow()
    
        'BitBlt needs the DC to copy the image. So, we
        'need the GetDC API.
        DeskDC = GetDC(DeskhWnd)
    
        Dest.AutoRedraw = True
        BitBlt Dest.hDC, 0, 0, _
        Screen.Width / Screen.TwipsPerPixelX, Screen.Height / Screen.TwipsPerPixelY, DeskDC, _
        0, 0, vbSrcCopy
        Dest.Refresh
    End Sub
    Use that to get the screen shot, then send the file via winsock...
    Wha is the correct way to call this?
    Call Grabscreen(Picture1.Picture) and Call Grabscreen(Picture1.hDC) are wrong
    Looking for a friendly intelligent chat forum? Visit the white-hart.net

  23. #23
    chenko
    Guest
    Originally posted by Kzin


    Wha is the correct way to call this?
    Call Grabscreen(Picture1.Picture) and Call Grabscreen(Picture1.hDC) are wrong
    Call Grabscreen(Picture1)

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