Parsi Coders
سورس کد تغییر پس زمینه دسکتاپ(ویژوال بیسیک 6) - نسخه قابل چاپ

+- Parsi Coders (http://parsicoders.com)
+-- انجمن: Software Development Programming (http://parsicoders.com/forumdisplay.php?fid=37)
+--- انجمن: Visual Basic Programming (http://parsicoders.com/forumdisplay.php?fid=39)
+---- انجمن: Visual Basic 6 (http://parsicoders.com/forumdisplay.php?fid=44)
+---- موضوع: سورس کد تغییر پس زمینه دسکتاپ(ویژوال بیسیک 6) (/showthread.php?tid=2795)



سورس کد تغییر پس زمینه دسکتاپ(ویژوال بیسیک 6) - Amin_Mansouri - 09-29-2012

درود

با سورس زیر میتونید پس زمینه دسکتاپ رو عوض کنید.

کد:
''Description: A example of how to easily change the
'desktops wallpaper to your selected image using code.
'This example uses the "SystemParametersInfo" api call to
'do the work. By calling this function with a couple
'constants and specifying the image, it will quickly
'change the wallpaper on your windows desktop to the
'image you specified.
''
'
'api to set the parameters for changing the wallpaper
Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByVal lpvParam As String, ByVal fuWinIni As Long) As Long
'constants to be used with the above api
Private Const SPI_SETDESKWALLPAPER = 20
Private Const SPIF_UPDATEINIFILE = &H1
    
'will hold the path to the image
Private imagePath As String
    
Private Sub cmdBrowse_Click()
    'just your basic code to get a dialog box open to
    'select a image and get the path
    '
    'the picture must be a BITMAP Image File
    '
    dlg........ = "Image Files (*.bmp)|*.bmp"
        
    'set a custom title to the dialog
    dlg.DialogTitle = "Select the image to load."
    'show the dialog
    dlg.ShowOpen
    'the path to get the image from
    imagePath = dlg.FileName
    'view the selected picture into the picturebox
    'control
    pic.Picture = LoadPicture(imagePath)
        
End Sub
Private Sub cmdSetWallPaper_Click()
    'set the parameters to change the wallpaper to
    'the image you selected
    SystemParametersInfo SPI_SETDESKWALLPAPER, 0, imagePath, SPIF_UPDATEINIFILE
End Sub



RE: سورس کد تغییر پس زمینه دسکتاپ(ویژوال بیسیک 6) - alakimalaki - 09-29-2012

امین جان این اشتباهه ؟ http://parsicoders.com/showthread.php?tid=2668


RE: سورس کد تغییر پس زمینه دسکتاپ(ویژوال بیسیک 6) - Amin_Mansouri - 09-29-2012

نه یه خرده با هم فرق دارن