locked
Desktop Wallpaper RRS feed

  • Question

  • Hi,

    I'm not sure if I should be posting this here as this question isn't directly related to SmallBasic although it is a feature of SmallBasic.

    How does the command: Desktop.SetWallPaper actually work? Where on the windows os is the file that tells the computer what wallpaper to load up? And I guess it's located in the same place for all windows versions as it wouldn't work otherwise?

    Sorry if this is unrelated.

    Kirk.

    Wednesday, February 16, 2011 1:50 AM

Answers

  • Easy way to set wallpaper with C# or VB is this pinvoke function:

    'VB
    <DllImport("user32")>
    Public Shared Function SystemParametersInfo(ByVal uAction As Integer, ByVal uParam As Integer, ByVal lpvParam As String, ByVal fuWinIni As Integer) As Integer

    //C#
    [DllImport("uprobebly ser32.dll", CharSet=CharSet.Auto)]
    public static extern int SystemParametersInfo(int uAction, int uParam, string lpvParam, int fuWinIni);

     

    If you want set picture position of wallpaper you must edit registry


    Sorry My Bad English
    • Proposed as answer by litdev Saturday, February 19, 2011 8:00 PM
    • Marked as answer by litdev Wednesday, February 23, 2011 8:46 PM
    Wednesday, February 16, 2011 1:08 PM

All replies

  • I've never really checked, but possibly it is in system32 or my pictures.
    ~~AirWaves!!~~
    Wednesday, February 16, 2011 3:04 AM
  • I have checked system32 files can't find anything that seems to relate to desktop wallpaper. It's not my pictures i'm certain of that. I thought the most obvious place would be where the wallpapers are stored: C:\WINDOWS\Web\Wallpaper but no luck there.

    Kirk.

    Wednesday, February 16, 2011 3:34 AM
  • Easy way to set wallpaper with C# or VB is this pinvoke function:

    'VB
    <DllImport("user32")>
    Public Shared Function SystemParametersInfo(ByVal uAction As Integer, ByVal uParam As Integer, ByVal lpvParam As String, ByVal fuWinIni As Integer) As Integer

    //C#
    [DllImport("uprobebly ser32.dll", CharSet=CharSet.Auto)]
    public static extern int SystemParametersInfo(int uAction, int uParam, string lpvParam, int fuWinIni);

     

    If you want set picture position of wallpaper you must edit registry


    Sorry My Bad English
    • Proposed as answer by litdev Saturday, February 19, 2011 8:00 PM
    • Marked as answer by litdev Wednesday, February 23, 2011 8:46 PM
    Wednesday, February 16, 2011 1:08 PM