Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 16

Thread: Screen Capture

  1. #1
    mex
    mex is offline
    Regular Coder
    Join Date
    Jul 2003
    Location
    somewhere
    Posts
    134
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Screen Capture

    Below is a script which captures the screen and sends it to the C:\1.bmp. As i'm not a VB programmer, i would like to get help from u. that is, to add some few functions to it!
    1. Not to over-write the file but to add automcatically like 001,002..
    2. To enable the user to select the location using brose and not to send the file to C:\1.bmp automatically.
    3. To have a shortcut key like Ctrl+Alt+P though this is not really important.

    thanx for any help

    ---------------------
    Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, _
    ByVal dwFlags As Long, ByVal dwExtraInfo As Long)

    Public Function fSaveGuiToFile(ByVal theFile As String) As Boolean

    Dim lString As String
    On Error GoTo Trap

    If Dir(theFile) <> "" Then Exit Function

    Call keybd_event(vbKeySnapshot, 1, 0, 0)


    SavePicture Clipboard.GetData(vbCFBitmap), theFile
    fSaveGuiToFile = True
    Exit Function
    Trap:

    MsgBox "Error Occured in fSaveGuiToFile. Error #: " & Err.Number & ", " & Err.Description
    End Function


    Private Sub Command1_Click()
    fSaveGuiToFile ("C:\1.bmp")
    End Sub
    Wonder

  • #2
    Regular Coder
    Join Date
    Dec 2003
    Posts
    367
    Thanks
    0
    Thanked 0 Times in 0 Posts
    2. http://www.garybeene.com/vb/tut-dlg.htm http://freespace.virgin.net/s.cowan/...on_dialog.html

    Use the filename you get from the common dialog and save to that instead and that also takes care of 1. and 3.

    shmoove

  • #3
    mex
    mex is offline
    Regular Coder
    Join Date
    Jul 2003
    Location
    somewhere
    Posts
    134
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i may not a VB expert but i sure knows what i'm asking!!! or did u misunderstood!! i dont need those 2 sites. they r of no use to the script i posted! do u went through my code!
    Wonder

  • #4
    Regular Coder
    Join Date
    Dec 2003
    Posts
    367
    Thanks
    0
    Thanked 0 Times in 0 Posts
    2. To enable the user to select the location using brose
    Using a Common Dialog control you get exactly that: a nice dialog that looks exactly like the ones used in every other Windows application, that let's the user choose a location and a filename.
    So you would first open the dialog with it's ShowSave method, and then use it's Filename property as the parameter passed to your fSaveGuiToFile function:
    Code:
    Private Sub Command1_Click()
    MyCommonDialog.ShowSave
    fSaveGuiToFile (MyCommonDialog.Filename)
    End Sub
    Since the user is choosing a file of his liking you don't need to make up those automatic filenames (point 1).
    About point 3 I was wrong when I sayed it solved it, but for that you would need to use the Form's KeyUp event (or KeyDown) which has an extra argument to allow for special keys like Ctrl and Alt ( http://msdn.microsoft.com/library/de...vtKeyPress.asp ).

    shmoove

    shmoove

  • #5
    mex
    mex is offline
    Regular Coder
    Join Date
    Jul 2003
    Location
    somewhere
    Posts
    134
    Thanks
    0
    Thanked 0 Times in 0 Posts
    what exactly the code does is send to the location without having to open the dialog. i mean to choose the location from an option before u press the capture button! so that while pressing it, it will send to the location specified without having to go through that process of opening the dialog and saving it which takes time but to send directly (hidden) to the location which was soecified before, through the options.... thanx
    Wonder

  • #6
    Regular Coder
    Join Date
    Dec 2003
    Posts
    367
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Then put a textbox and another button, open the dialog from the new button, and save the filename in the textbox (making it uneditable so it can only change with the dialog might be a good idea). Then get the value for the filename from there when the screen capture button is pressed.

  • #7
    mex
    mex is offline
    Regular Coder
    Join Date
    Jul 2003
    Location
    somewhere
    Posts
    134
    Thanks
    0
    Thanked 0 Times in 0 Posts
    this is strange.... thats what exactly i have been asking and now i got the reply which is suppose to be my QUESTION!..

    can u get me the script for that. thanx anyway.
    Wonder

  • #8
    Regular Coder
    Join Date
    Dec 2003
    Posts
    367
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I didn't understand that last post.

    shmoove

  • #9
    mex
    mex is offline
    Regular Coder
    Join Date
    Jul 2003
    Location
    somewhere
    Posts
    134
    Thanks
    0
    Thanked 0 Times in 0 Posts
    well... atleast u understand the question now... which is your solution:

    Then put a textbox and another button, open the dialog from the new button, and save the filename in the textbox (making it uneditable so it can only change with the dialog might be a good idea). Then get the value for the filename from there when the screen capture button is pressed.
    Wonder

  • #10
    Regular Coder
    Join Date
    Dec 2003
    Posts
    367
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You're saying you don't know how to put the button on a form?

    shmoove

  • #11
    Super Moderator sage45's Avatar
    Join Date
    May 2002
    Posts
    1,064
    Thanks
    0
    Thanked 15 Times in 15 Posts
    mex,

    You are looking for someone to give you a script/form that solves all of your problems.

    In schmooves defense, he did at least answer some of your questions by pointing you in the direction of a resource that you can use by reading and expirementing with it in oder to find the best results for your purpose.

    Here at coding forums we try to keep an atmosphere of learning whereas people are given resources that can be used to learn new things. The way I look at it, with the right amount of effort, you could take the resources provided and have this program of yours do everything you wish. On the other hand, if you would like to continue getting snippy with people for not directly giving the answers then I am sure someone can program this for you for the right price.

    -sage-
    Last edited by sage45; 11-18-2004 at 04:12 PM.
    HTML & CSS Forum Moderator

    "If you don't know what you think you know, then what do you know."
    R.I.P. Derrick Thomas #58
    1/1/1967 - 2/8/2000

  • #12
    mex
    mex is offline
    Regular Coder
    Join Date
    Jul 2003
    Location
    somewhere
    Posts
    134
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i should have gone to google.com instead... lol! i'm willing to pay if anyone could help me out with this.
    Wonder

  • #13
    Regular Coder
    Join Date
    Oct 2004
    Location
    In front of this computer. (Where else?)
    Posts
    442
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Mex, If you're willing to pay, let's talk. Send me a PM.
    Tomorrow is the first day of the rest of your life... What have you done today?
    Tutorials
    Web: w3schools, htmldog General tips: Hardware, Networking

  • #14
    Super Moderator sage45's Avatar
    Join Date
    May 2002
    Posts
    1,064
    Thanks
    0
    Thanked 15 Times in 15 Posts
    Quote Originally Posted by mex
    i should have gone to google.com instead... lol! i'm willing to pay if anyone could help me out with this.
    lol!!!
    HTML & CSS Forum Moderator

    "If you don't know what you think you know, then what do you know."
    R.I.P. Derrick Thomas #58
    1/1/1967 - 2/8/2000

  • #15
    mex
    mex is offline
    Regular Coder
    Join Date
    Jul 2003
    Location
    somewhere
    Posts
    134
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hey but what does this mean:

    I was hired to keep off intruders ... they never knew i was the intruder
    Wonder


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

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