Results 1 to 6 of 6

Thread: Form Load will be background

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2007
    Posts
    140

    Form Load will be background

    Guy's

    I made this code

    Code:
    Private Sub Form_Click()
    ' // Example: Capture Text area and save to BMP file //
        
        Dim TxtArea As RECT
        Dim MyDC As Long
            
        MyDC = GetDC(0)
        
        If MyDC Then
            Picture1.AutoRedraw = True
            Picture1.BorderStyle = 0
            Picture1.Height = frmGetMACadr.Height
            Picture1.Width = frmGetMACadr.Width
    
            GetWindowRect frmGetMACadr.hWnd, TxtArea
            
            ' copy text box area to pic box.
            BitBlt Picture1.hdc, 0, 0, TxtArea.Right - TxtArea.Left, _
            TxtArea.Bottom - TxtArea.Top, MyDC, TxtArea.Left, TxtArea.Top, vbSrcCopy
        
            ' Save as BMP file.
            SavePicture Picture1.Image, "D:\TEST.BMP"
                    
            ReleaseDC 0, MyDC
        End If
        Dim ChangeWP
    Dim Source As String
    
    Source = "D:\TEST.BMP"
    
    ChangeWP = SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, Source, 0)
    
        Unload Me
    End Sub

    it'll get print screen from the FORM and will make it as background for the desktop

    my question is

    I want to save the image in my documents but I don't know what's the path name of the existing user I want to save the image to my documents path of the existing user

    I want from the code to save the image in my documents of the existing user and make it as desktop

  2. #2

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Aug 2007
    Posts
    140

    Re: Form Load will be background

    Actuality it's professional code but can you help me how to can I define it in my existing code to get my target

  4. #4

  5. #5

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Aug 2007
    Posts
    140

    Re: Form Load will be background

    In my code i don't like to save in my code I want to save in my Documents

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