Form Load will be background
Guy's :wave:
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
Re: Form Load will be background
This sample will give you path to current user's documents folder.
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
Re: Form Load will be background
I'm not sure I understand you... :confused: What do you mean?
Re: Form Load will be background
If that is too complicated for you then try this instead:
Code:
Debug.Print Environ("userprofile") & "\My Documents\"
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