Jump to content

Recommended Posts

This is an export of the HKEY_CURRENT_USER\Control Panel\Desktop registry on my W7 x64 Home Laptop

as you can see "TileWallpaper"="0" and "WallpaperStyle"="4"

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Control Panel\Desktop]
"ScreenSaveActive"="1"
"ActiveWndTrackTimeout"=dword:00000000
"BlockSendInputResets"="0"
"CaretWidth"=dword:00000001
"ClickLockTime"=dword:000004b0
"CoolSwitchColumns"="7"
"CoolSwitchRows"="3"
"CursorBlinkRate"="530"
"DockMoving"="1"
"DragFromMaximize"="1"
"DragFullWindows"="1"
"DragHeight"="4"
"DragWidth"="4"
"FocusBorderHeight"=dword:00000001
"FocusBorderWidth"=dword:00000001
"FontSmoothing"="2"
"FontSmoothingGamma"=dword:00000000
"FontSmoothingOrientation"=dword:00000001
"FontSmoothingType"=dword:00000002
"ForegroundFlashCount"=dword:00000007
"ForegroundLockTimeout"=dword:00030d40
"LeftOverlapChars"="3"
"MenuShowDelay"="400"
"PaintDesktopVersion"=dword:00000000
"Pattern"=dword:00000000
"RightOverlapChars"="3"
"SnapSizing"="1"
"TileWallpaper"="0"
"WallpaperOriginX"=dword:00000000
"WallpaperOriginY"=dword:00000000
"WallpaperStyle"="4"
"WheelScrollChars"="3"
"WheelScrollLines"="3"
"WindowArrangementActive"="1"
"UserPreferencesMask"=hex:9e,3e,07,80,12,00,00,00
"Wallpaper"="G:\\GreenCan's Documents\\programming\\AutoIt\\Programs\\gisttweak\\autoit gisttweak\\Desktop Background Changer\\images\\test.jpg"
"ScreenSaveTimeOut"="240"
"ScreenSaverIsSecure"="0"
"SCRNSAVE.EXE"="C:\\Windows\\system32\\Bubbles.scr"

With a theme I get this:

"TileWallpaper"="0" and "WallpaperStyle"="6"

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Control Panel\Desktop]
"ScreenSaveActive"="1"
"ActiveWndTrackTimeout"=dword:00000000
"BlockSendInputResets"="0"
"CaretWidth"=dword:00000001
"ClickLockTime"=dword:000004b0
"CoolSwitchColumns"="7"
"CoolSwitchRows"="3"
"CursorBlinkRate"="530"
"DockMoving"="1"
"DragFromMaximize"="1"
"DragFullWindows"="1"
"DragHeight"="4"
"DragWidth"="4"
"FocusBorderHeight"=dword:00000001
"FocusBorderWidth"=dword:00000001
"FontSmoothing"="2"
"FontSmoothingGamma"=dword:00000000
"FontSmoothingOrientation"=dword:00000001
"FontSmoothingType"=dword:00000002
"ForegroundFlashCount"=dword:00000007
"ForegroundLockTimeout"=dword:00030d40
"LeftOverlapChars"="3"
"MenuShowDelay"="400"
"PaintDesktopVersion"=dword:00000000
"Pattern"=dword:00000000
"RightOverlapChars"="3"
"SnapSizing"="1"
"TileWallpaper"="0"
"WallpaperOriginX"=dword:00000000
"WallpaperOriginY"=dword:00000000
"WallpaperStyle"="6"
"WheelScrollChars"="3"
"WheelScrollLines"="3"
"WindowArrangementActive"="1"
"UserPreferencesMask"=hex:9e,3e,07,80,12,00,00,00
"Wallpaper"="C:\\Users\\GreenCan\\AppData\\Roaming\\Microsoft\\Windows\\Themes\\TranscodedWallpaper.jpg"
"ScreenSaveTimeOut"="240"
"ScreenSaverIsSecure"="0"
"SCRNSAVE.EXE"="C:\\Windows\\system32\\Bubbles.scr"

I think theme as some effect on the style

Would you like to test my script?


Contributions

CheckUpdate - SelfUpdating script ------- Self updating script

Dynamic input validation ------------------- Use a Input masks can make your life easier and Validation can be as simple

MsgBox with CountDown ------------------- MsgBox with visual countdown

Display Multiline text cells in ListView ---- Example of pop-up or ToolTip for multiline text items in ListView

Presentation Manager ---------------------- Program to display and refresh different Border-less GUI's on a Display (large screen TV)

USB Drive Tools ------------------------------ Tool to help you with your USB drive management

Input Period udf ------------------------------ GUI for a period input

Excel ColorPicker ---------------------------- Color pickup tool will allow you to select a color from the standard Excel color palette

Excel Chart UDF ----------------------------- Collaboration project with water 

GetDateInString ------------------------------ Find date/time in a string using a date format notation like DD Mon YYYY hh:mm

TaskListAllDetailed --------------------------- List All Scheduled Tasks

Computer Info --------------------------------- A collection of information for helpdesk

Shared memory Demo ----------------------- Demo: Two applications communicate with each other through means of a memory share (using Nomad function, 32bit only)

Universal Date Format Conversion -------- Universal date converter from your PC local date format to any format

Disable Windows DetailsPane -------------- Disable Windows Explorer Details Pane

Oracle SQL Report Generator -------------  Oracle Report generator using SQL

SQLite Report Generator -------------------  SQLite Report generator using SQL

SQLite ListView and BLOB demo ---------- Demo: shows how binary (image) objects can be recognized natively in a database BLOB field

DSN-Less Database connection demo --- Demo: ActiveX Data Objects DSN-Less Database access

Animated animals ----------------------------- Fun: Moving animated objects

Perforated image in GUI --------------------- Fun: Perforate your image with image objects

UEZ's Perforator major update ------------- Fun: Pro version of Perforator by UEZ

Visual Crop Tool (GUI) ----------------------- Easy to use Visual Image Crop tool

Visual Image effect (GUI) -------------------- Visually apply effects on an image

 

 

 

Share this post


Link to post
Share on other sites

This is an export of the HKEY_CURRENT_USERControl PanelDesktop registry on my W7 x64 Home Laptop

as you can see "TileWallpaper"="0" and "WallpaperStyle"="4"

snip

I think theme as some effect on the style

Would you like to test my script?

Here is some screen with the configuration used, so you can well see what happened on the system. As i said before the image is higher than the screen resolution.

No problem, right now i am studing for a good soluction, i can test your script too.

Hi!

Screen.rar


My UDF: NetInfo UDF Play with your network, check your download/upload speed and much more! YTAPI Easy to use YouTube API, now you can easy retrive all needed info from a video. NavInfo Check if a specific browser is installed and retrive other usefull information. YWeather Easy to use Yahoo Weather API, now you can easily retrive details about the weather in a specific region. No-IP UDF Easily update your no-ip hostname(s).

My Script: Wallpaper Changer Change you wallpaper dinamically, you can also download your wallpaper from your website and share it with all!   My Snippet: _ImageSaveToBMPConvert an image to bmp format. _SciteGOTO Open a file in SciTE at specific fileline. _FileToHex Show the hex code of a specified file

Share this post


Link to post
Share on other sites

Nessie (or should I call you Loch?)

Screenshot 1 and 3 are correct (0-4 and 0-6)

Screenshot 4 is what you want to get (and that is different from what needs to be achieved) However, the image is truncated on the top and on the bottom, it still fits (read looks good) by coincidence. You will never have good results with all images of that size if this is what you want.

GreenCan

Edited by GreenCan

Contributions

CheckUpdate - SelfUpdating script ------- Self updating script

Dynamic input validation ------------------- Use a Input masks can make your life easier and Validation can be as simple

MsgBox with CountDown ------------------- MsgBox with visual countdown

Display Multiline text cells in ListView ---- Example of pop-up or ToolTip for multiline text items in ListView

Presentation Manager ---------------------- Program to display and refresh different Border-less GUI's on a Display (large screen TV)

USB Drive Tools ------------------------------ Tool to help you with your USB drive management

Input Period udf ------------------------------ GUI for a period input

Excel ColorPicker ---------------------------- Color pickup tool will allow you to select a color from the standard Excel color palette

Excel Chart UDF ----------------------------- Collaboration project with water 

GetDateInString ------------------------------ Find date/time in a string using a date format notation like DD Mon YYYY hh:mm

TaskListAllDetailed --------------------------- List All Scheduled Tasks

Computer Info --------------------------------- A collection of information for helpdesk

Shared memory Demo ----------------------- Demo: Two applications communicate with each other through means of a memory share (using Nomad function, 32bit only)

Universal Date Format Conversion -------- Universal date converter from your PC local date format to any format

Disable Windows DetailsPane -------------- Disable Windows Explorer Details Pane

Oracle SQL Report Generator -------------  Oracle Report generator using SQL

SQLite Report Generator -------------------  SQLite Report generator using SQL

SQLite ListView and BLOB demo ---------- Demo: shows how binary (image) objects can be recognized natively in a database BLOB field

DSN-Less Database connection demo --- Demo: ActiveX Data Objects DSN-Less Database access

Animated animals ----------------------------- Fun: Moving animated objects

Perforated image in GUI --------------------- Fun: Perforate your image with image objects

UEZ's Perforator major update ------------- Fun: Pro version of Perforator by UEZ

Visual Crop Tool (GUI) ----------------------- Easy to use Visual Image Crop tool

Visual Image effect (GUI) -------------------- Visually apply effects on an image

 

 

 

Share this post


Link to post
Share on other sites

Nessie (or should I call you Loch?)

I made that joke months and months ago.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post


Link to post
Share on other sites

Nessie (or should I call you Loch?)

Screenshot 1 and 3 are correct (0-4 and 0-6)

Screenshot 4 is what you want to get (and that is different from what needs to be achieved) However, the image is truncated on the top and on the bottom, it still fits (read looks good) by coincidence. You will never have good results with all images of that size if this is what you want.

GreenCan

Ops that quite right, can you try this script with an image higher than screen resolution.

#include <GDIPlus.au3>

_ChangeWallpaper("") ;Your image here!

If @error Then
    MsgBox(16, "Error", "Unable to change the wallpaper.")
    Exit
EndIf

; #FUNCTION# ====================================================================================================================
; Name...........: _ChangeWallpaper
; Description ...: Change Windows Wallpaper
; Syntax.........: _ChangeWallpaper($sImage, [$iStyle])
; Parameters ....: $sImage   - The path of the .bmp file
;                   $$iStyle  - The numeric value of desidered style
;                              0 Tiled
;                              1 Centered
;                              2 Stretched
;                              3 Fit (Windows 7 and later)
;                              4 Fill (Windows 7 and later)
;                               5 Screen Width
; Return values .: On Success - Return the new file name.
;                  On Failure -
;                               @error = 1 The image doesn't exist
;                               @error = 2 The image is not a .bmp file
;                               @error = 3 Invalid style
;                               @error = 4 Style not supported by OS
;                               @error = 5 Unable to change the wallpaper
; Author ........: Nessie
; ===============================================================================================================================

Func _ChangeWallpaper($sImage, $iStyle = 0, $bResize = True)
    If Not FileExists($sImage) Then Return SetError(1, 0, "")

    Local $sImageExt = StringLower(StringRight($sImage, 4))

    Local $fWinVer = _GetWinVersion()

    If $sImageExt <> '.bmp' And $fWinVer < 6.0 Then
        Return SetError(2, 0, "")
    Else
        If $fWinVer >= 6.0 And $sImageExt <> '.bmp' And $sImageExt <> '.jpg' Then
            Return SetError(2, 0, "")
        EndIf
    EndIf

    If $iStyle < 0 Or $iStyle > 5 Then Return SetError(3, 0, "")

    If $fWinVer < 6.0 Then ; More info http://msdn.microsoft.com/en-us/library/windows/desktop/ms724832%28v=vs.85%29.aspx
        If $iStyle > 2 Then Return SetError(4, 0, "")
    EndIf

    Local $sWallpaperKey = "HKEY_CURRENT_USER\Control Panel\Desktop"

    Local $iTileWallPaper, $iWallpaperStyle

    If $bResize And $fWinVer >= 6.0 Then
        $aImageSize = _ImageGetSize($sImage)
        If @error Then Return SetError(5, 0, "")

        If $aImageSize[0] > @DesktopWidth Or $aImageSize[1] > @DesktopHeight Then
            $iStyle = 5 ;Force style n°5
        EndIf
    EndIf

    Switch $iStyle
        Case 0
            $iTileWallPaper = 1
            $iWallpaperStyle = 0
        Case 1
            $iTileWallPaper = 0
            $iWallpaperStyle = 0
        Case 2
            $iTileWallPaper = 0
            $iWallpaperStyle = 2
        Case 3
            $iTileWallPaper = 0
            $iWallpaperStyle = 6
        Case 4
            $iTileWallPaper = 0
            $iWallpaperStyle = 10
        Case 5
            $iTileWallPaper = 0
            $iWallpaperStyle = 4
    EndSwitch

    RegWrite($sWallpaperKey, "TileWallPaper", "REG_SZ", $iTileWallPaper)
    If @error Then Return SetError(5, 0, "")
    RegWrite($sWallpaperKey, "WallpaperStyle", "REG_SZ", $iWallpaperStyle)
    If @error Then Return SetError(5, 0, "")


    DllCall("user32.dll", "int", "SystemParametersInfo", "int", 20, "int", 0, "str", $sImage, "int", BitOR(1, 2))
    If @error Then Return SetError(5, 0, "")

    Return True
EndFunc   ;==>_ChangeWallpaper

Func _GetWinVersion()
    Local $sRet = RegRead('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\', 'CurrentVersion')
    If @error Then Return SetError(0, 0, "")

    Return $sRet
EndFunc   ;==>_GetWinVersion

Func _ImageGetSize($sImage)
    Local $aResult[2]

    If Not FileExists($sImage) Then Return SetError(1, 0, "")

    _GDIPlus_Startup()

    Local $hImage = _GDIPlus_ImageLoadFromFile($sImage)
    If @error Then Return SetError(2, 0, "")

    $iWidth = _GDIPlus_ImageGetWidth($hImage)
    If @error Then Return SetError(3, 0, "")

    $iHeight = _GDIPlus_ImageGetHeight($hImage)
    If @error Then Return SetError(4, 0, "")

    _GDIPlus_ImageDispose($hImage)
    _GDIPlus_Shutdown()

    $aResult[0] = $iWidth
    $aResult[1] = $iHeight

    Return $aResult
EndFunc   ;==>_ImageGetSize

Is this working as you suggested?

Hi!

Edited by Nessie

My UDF: NetInfo UDF Play with your network, check your download/upload speed and much more! YTAPI Easy to use YouTube API, now you can easy retrive all needed info from a video. NavInfo Check if a specific browser is installed and retrive other usefull information. YWeather Easy to use Yahoo Weather API, now you can easily retrive details about the weather in a specific region. No-IP UDF Easily update your no-ip hostname(s).

My Script: Wallpaper Changer Change you wallpaper dinamically, you can also download your wallpaper from your website and share it with all!   My Snippet: _ImageSaveToBMPConvert an image to bmp format. _SciteGOTO Open a file in SciTE at specific fileline. _FileToHex Show the hex code of a specified file

Share this post


Link to post
Share on other sites

Nessie,

Did you not see my post? What reason do you have for not using the WinAPI version?

Edited by guinness

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post


Link to post
Share on other sites

I made that joke months and months ago.

I don't copycat your nice script only guinness...

BTW I only drink Belgian beer... :bye:

Edited by GreenCan

Contributions

CheckUpdate - SelfUpdating script ------- Self updating script

Dynamic input validation ------------------- Use a Input masks can make your life easier and Validation can be as simple

MsgBox with CountDown ------------------- MsgBox with visual countdown

Display Multiline text cells in ListView ---- Example of pop-up or ToolTip for multiline text items in ListView

Presentation Manager ---------------------- Program to display and refresh different Border-less GUI's on a Display (large screen TV)

USB Drive Tools ------------------------------ Tool to help you with your USB drive management

Input Period udf ------------------------------ GUI for a period input

Excel ColorPicker ---------------------------- Color pickup tool will allow you to select a color from the standard Excel color palette

Excel Chart UDF ----------------------------- Collaboration project with water 

GetDateInString ------------------------------ Find date/time in a string using a date format notation like DD Mon YYYY hh:mm

TaskListAllDetailed --------------------------- List All Scheduled Tasks

Computer Info --------------------------------- A collection of information for helpdesk

Shared memory Demo ----------------------- Demo: Two applications communicate with each other through means of a memory share (using Nomad function, 32bit only)

Universal Date Format Conversion -------- Universal date converter from your PC local date format to any format

Disable Windows DetailsPane -------------- Disable Windows Explorer Details Pane

Oracle SQL Report Generator -------------  Oracle Report generator using SQL

SQLite Report Generator -------------------  SQLite Report generator using SQL

SQLite ListView and BLOB demo ---------- Demo: shows how binary (image) objects can be recognized natively in a database BLOB field

DSN-Less Database connection demo --- Demo: ActiveX Data Objects DSN-Less Database access

Animated animals ----------------------------- Fun: Moving animated objects

Perforated image in GUI --------------------- Fun: Perforate your image with image objects

UEZ's Perforator major update ------------- Fun: Pro version of Perforator by UEZ

Visual Crop Tool (GUI) ----------------------- Easy to use Visual Image Crop tool

Visual Image effect (GUI) -------------------- Visually apply effects on an image

 

 

 

Share this post


Link to post
Share on other sites

@guinness

I have see your suggestion:

#include <WinAPI.au3>
#include <GDIPlus.au3>

_ChangeWallpaper("") ;Your image here

If @error Then
    MsgBox(16, "Error", "Unable to change the wallpaper.")
    Exit
EndIf

; #FUNCTION# ====================================================================================================================
; Name...........: _ChangeWallpaper
; Description ...: Change Windows Wallpaper
; Syntax.........: _ChangeWallpaper($sImage, [$iStyle])
; Parameters ....: $sImage - The path of the .bmp file
;                $$iStyle - The numeric value of desidered style
; 0 Tiled
; 1 Centered
; 2 Stretched
; 3 Fit (Windows 7 and later)
; 4 Fill (Windows 7 and later)
;                            5 Screen Width
; Return values .: On Success - Return the new file name.
; On Failure -
; @error = 1 The image doesn't exist
; @error = 2 The image is not a .bmp file
; @error = 3 Invalid style
; @error = 4 Style not supported by OS
; @error = 5 Unable to change the wallpaper
; Author ........: Nessie
; ===============================================================================================================================

Func _ChangeWallpaper($sImage, $iStyle = 0, $bResize = True)
    If Not FileExists($sImage) Then Return SetError(1, 0, "")

    Local $sImageExt = StringLower(StringRight($sImage, 4))

    Local $fWinVer = _GetWinVersion()

    If $sImageExt <> '.bmp' And $fWinVer < 6.0 Then
        Return SetError(2, 0, "")
    Else
        If $fWinVer >= 6.0 And $sImageExt <> '.bmp' And $sImageExt <> '.jpg' Then
            Return SetError(2, 0, "")
        EndIf
    EndIf

    If $iStyle < 0 Or $iStyle > 5 Then Return SetError(3, 0, "")

    If $fWinVer < 6.0 Then ; More info http://msdn.microsoft.com/en-us/library/windows/desktop/ms724832%28v=vs.85%29.aspx
        If $iStyle > 2 Then Return SetError(4, 0, "")
    EndIf

    Local $sWallpaperKey = "HKEY_CURRENT_USER\Control Panel\Desktop"

    Local $iTileWallPaper, $iWallpaperStyle

    If $bResize And $fWinVer >= 6.0 Then
        $aImageSize = _ImageGetSize($sImage)
        If @error Then Return SetError(5, 0, "")

        If $aImageSize[0] > @DesktopWidth Or $aImageSize[1] > @DesktopHeight Then
            $iStyle = 5 ;Force style n°5
        EndIf
    EndIf

    Switch $iStyle
        Case 0
            $iTileWallPaper = 1
            $iWallpaperStyle = 0
        Case 1
            $iTileWallPaper = 0
            $iWallpaperStyle = 0
        Case 2
            $iTileWallPaper = 0
            $iWallpaperStyle = 2
        Case 3
            $iTileWallPaper = 0
            $iWallpaperStyle = 6
        Case 4
            $iTileWallPaper = 0
            $iWallpaperStyle = 10
        Case 5
            $iTileWallPaper = 0
            $iWallpaperStyle = 4
    EndSwitch

    RegWrite($sWallpaperKey, "TileWallPaper", "REG_SZ", $iTileWallPaper)
    If @error Then Return SetError(5, 0, "")
    RegWrite($sWallpaperKey, "WallpaperStyle", "REG_SZ", $iWallpaperStyle)
    If @error Then Return SetError(5, 0, "")


    ; Idea from here: http://www.autoitscript.com/forum/topic/19370-autoit-wrappers/page__st__280#entry652536
    ;Thanks to guinness for his advice
Local $tBuffer = DllStructCreate('wchar Text[' & StringLen($sImage) + 1 & ']')
DllStructSetData($tBuffer, 'Text', $sImage)
Return _WinAPI_SystemParametersInfo(0x0014, 0, DllStructGetPtr($tBuffer), BitOR(0x0001, 0x0002))
    If @error Then Return SetError(5, 0, "")

    Return True
EndFunc ;==>_ChangeWallpaper

Func _GetWinVersion()
    Local $sRet = RegRead('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\', 'CurrentVersion')
    If @error Then Return SetError(0, 0, "")

    Return $sRet
EndFunc ;==>_GetWinVersion

Func _ImageGetSize($sImage)
    Local $aResult[2]

    If Not FileExists($sImage) Then Return SetError(1, 0, "")

    _GDIPlus_Startup()

    Local $hImage = _GDIPlus_ImageLoadFromFile($sImage)
    If @error Then Return SetError(2, 0, "")

    $iWidth = _GDIPlus_ImageGetWidth($hImage)
    If @error Then Return SetError(3, 0, "")

    $iHeight = _GDIPlus_ImageGetHeight($hImage)
    If @error Then Return SetError(4, 0, "")

    _GDIPlus_ImageDispose($hImage)
    _GDIPlus_Shutdown()

    $aResult[0] = $iWidth
    $aResult[1] = $iHeight

    Return $aResult
EndFunc ;==>_ImageGetSize

@GreenCan

Can you test this and report if is this the behavior that you are expecting for with image that have higher resolution that screen.

@All

Posted Image


My UDF: NetInfo UDF Play with your network, check your download/upload speed and much more! YTAPI Easy to use YouTube API, now you can easy retrive all needed info from a video. NavInfo Check if a specific browser is installed and retrive other usefull information. YWeather Easy to use Yahoo Weather API, now you can easily retrive details about the weather in a specific region. No-IP UDF Easily update your no-ip hostname(s).

My Script: Wallpaper Changer Change you wallpaper dinamically, you can also download your wallpaper from your website and share it with all!   My Snippet: _ImageSaveToBMPConvert an image to bmp format. _SciteGOTO Open a file in SciTE at specific fileline. _FileToHex Show the hex code of a specified file

Share this post


Link to post
Share on other sites

I'm not concerned about my name being there. Sorry to bombard you, but is there any reason you don't use the constant values? You have to understand not everyone looks around the UDFs or MSDN, so when they see these values, they simple copy them and learn nothing about what they actually mean.


UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post


Link to post
Share on other sites

I'm not concerned about my name being there. Sorry to bombard you, but is there any reason you don't use the constant values? You have to understand not everyone looks around the UDFs or MSDN, so when they see these values, they simple copy them and learn nothing about what they actually mean.

Don't worry is always funny chat with you ;) I have just replaced the constant values only to drop the include of APIConstants.au3 that need WinAPIEx UDF to be downloaded. In that case there were only 3 constant to call, so i preferred to include them by my self.

Hi!

Edited by Nessie

My UDF: NetInfo UDF Play with your network, check your download/upload speed and much more! YTAPI Easy to use YouTube API, now you can easy retrive all needed info from a video. NavInfo Check if a specific browser is installed and retrive other usefull information. YWeather Easy to use Yahoo Weather API, now you can easily retrive details about the weather in a specific region. No-IP UDF Easily update your no-ip hostname(s).

My Script: Wallpaper Changer Change you wallpaper dinamically, you can also download your wallpaper from your website and share it with all!   My Snippet: _ImageSaveToBMPConvert an image to bmp format. _SciteGOTO Open a file in SciTE at specific fileline. _FileToHex Show the hex code of a specified file

Share this post


Link to post
Share on other sites

Don't worry is always funny chat with you ;) I have just replaced the constant values only to drop the include of APIConstants.au3 that need WinAPIEx UDF to be downloaded. In that case there were only 3 constant to call, so i preferred to include them by my self.

Hi!

Okay I understand that, but maybe add a single line comment next to it of the constant variable(s), just for readability purposes. Edited by guinness

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post


Link to post
Share on other sites

Done:

Func _ChangeWallpaper($sImage, $iStyle = 0, $bResize = True)
    If Not FileExists($sImage) Then Return SetError(1, 0, "")

    Local $sImageExt = StringLower(StringRight($sImage, 4))

    Local $fWinVer = _GetWinVersion()

    If $sImageExt <> '.bmp' And $fWinVer < 6.0 Then
        Return SetError(2, 0, "")
    Else
        If $fWinVer >= 6.0 And $sImageExt <> '.bmp' And $sImageExt <> '.jpg' Then
            Return SetError(2, 0, "")
        EndIf
    EndIf

    If $iStyle < 0 Or $iStyle > 5 Then Return SetError(3, 0, "")

    If $fWinVer < 6.0 Then ; More info http://msdn.microsoft.com/en-us/library/windows/desktop/ms724832%28v=vs.85%29.aspx
        If $iStyle > 2 Then Return SetError(4, 0, "")
    EndIf

    Local $sWallpaperKey = "HKEY_CURRENT_USER\Control Panel\Desktop"

    Local $iTileWallPaper, $iWallpaperStyle

    If $bResize And $fWinVer >= 6.0 Then
        $aImageSize = _ImageGetSize($sImage)
        If @error Then Return SetError(5, 0, "")

        If $aImageSize[0] > @DesktopWidth Or $aImageSize[1] > @DesktopHeight Then
            $iStyle = 5 ;Force style n°5
        EndIf
    EndIf

    Switch $iStyle
        Case 0
            $iTileWallPaper = 1
            $iWallpaperStyle = 0
        Case 1
            $iTileWallPaper = 0
            $iWallpaperStyle = 0
        Case 2
            $iTileWallPaper = 0
            $iWallpaperStyle = 2
        Case 3
            $iTileWallPaper = 0
            $iWallpaperStyle = 6
        Case 4
            $iTileWallPaper = 0
            $iWallpaperStyle = 10
        Case 5
            $iTileWallPaper = 0
            $iWallpaperStyle = 4
    EndSwitch

    RegWrite($sWallpaperKey, "TileWallPaper", "REG_SZ", $iTileWallPaper)
    If @error Then Return SetError(5, 0, "")
    RegWrite($sWallpaperKey, "WallpaperStyle", "REG_SZ", $iWallpaperStyle)
    If @error Then Return SetError(5, 0, "")

    ;Thanks to guinness for his advice
    ; Idea from here: http://www.autoitscript.com/forum/topic/19370-autoit-wrappers/page__st__280#entry652536
    ; $SPI_SETDESKWALLPAPER, $SPIF_UPDATEINIFILE and $SPIF_SENDCHANGE can be found on APIConstants.au3 included on WinAPIEx by Yashied
    ;Return _WinAPI_SystemParametersInfo($SPI_SETDESKWALLPAPER, 0, DllStructGetPtr($tBuffer), BitOR($SPIF_UPDATEINIFILE, $SPIF_SENDCHANGE))
    Local $tBuffer = DllStructCreate('wchar Text[' & StringLen($sImage) + 1 & ']')
    DllStructSetData($tBuffer, 'Text', $sImage)
    Return _WinAPI_SystemParametersInfo(0x0014, 0, DllStructGetPtr($tBuffer), BitOR(0x0001, 0x0002))
    If @error Then Return SetError(5, 0, "")

    Return True
EndFunc   ;==>_ChangeWallpaper

Hi!

Edited by Nessie

My UDF: NetInfo UDF Play with your network, check your download/upload speed and much more! YTAPI Easy to use YouTube API, now you can easy retrive all needed info from a video. NavInfo Check if a specific browser is installed and retrive other usefull information. YWeather Easy to use Yahoo Weather API, now you can easily retrive details about the weather in a specific region. No-IP UDF Easily update your no-ip hostname(s).

My Script: Wallpaper Changer Change you wallpaper dinamically, you can also download your wallpaper from your website and share it with all!   My Snippet: _ImageSaveToBMPConvert an image to bmp format. _SciteGOTO Open a file in SciTE at specific fileline. _FileToHex Show the hex code of a specified file

Share this post


Link to post
Share on other sites

I'm happy for now.

Edit: Thanks for listening and providing the function for all.

Edited by guinness

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post


Link to post
Share on other sites

New version released:

;=====================================================
v.1.2.0 (08/05/2013)
Added new style ;Thanks to GreenCan
Added image autoresize if the image has a higher resolution the the screen
Added new option to _ImageSaveToBMP
Fixed convert the image to bmp only when it is necessary

My UDF: NetInfo UDF Play with your network, check your download/upload speed and much more! YTAPI Easy to use YouTube API, now you can easy retrive all needed info from a video. NavInfo Check if a specific browser is installed and retrive other usefull information. YWeather Easy to use Yahoo Weather API, now you can easily retrive details about the weather in a specific region. No-IP UDF Easily update your no-ip hostname(s).

My Script: Wallpaper Changer Change you wallpaper dinamically, you can also download your wallpaper from your website and share it with all!   My Snippet: _ImageSaveToBMPConvert an image to bmp format. _SciteGOTO Open a file in SciTE at specific fileline. _FileToHex Show the hex code of a specified file

Share this post


Link to post
Share on other sites

Nessie,

sorry for late reply.

Your last script is functioning correctly.

Grtz

GreenCan

Edited by GreenCan

Contributions

CheckUpdate - SelfUpdating script ------- Self updating script

Dynamic input validation ------------------- Use a Input masks can make your life easier and Validation can be as simple

MsgBox with CountDown ------------------- MsgBox with visual countdown

Display Multiline text cells in ListView ---- Example of pop-up or ToolTip for multiline text items in ListView

Presentation Manager ---------------------- Program to display and refresh different Border-less GUI's on a Display (large screen TV)

USB Drive Tools ------------------------------ Tool to help you with your USB drive management

Input Period udf ------------------------------ GUI for a period input

Excel ColorPicker ---------------------------- Color pickup tool will allow you to select a color from the standard Excel color palette

Excel Chart UDF ----------------------------- Collaboration project with water 

GetDateInString ------------------------------ Find date/time in a string using a date format notation like DD Mon YYYY hh:mm

TaskListAllDetailed --------------------------- List All Scheduled Tasks

Computer Info --------------------------------- A collection of information for helpdesk

Shared memory Demo ----------------------- Demo: Two applications communicate with each other through means of a memory share (using Nomad function, 32bit only)

Universal Date Format Conversion -------- Universal date converter from your PC local date format to any format

Disable Windows DetailsPane -------------- Disable Windows Explorer Details Pane

Oracle SQL Report Generator -------------  Oracle Report generator using SQL

SQLite Report Generator -------------------  SQLite Report generator using SQL

SQLite ListView and BLOB demo ---------- Demo: shows how binary (image) objects can be recognized natively in a database BLOB field

DSN-Less Database connection demo --- Demo: ActiveX Data Objects DSN-Less Database access

Animated animals ----------------------------- Fun: Moving animated objects

Perforated image in GUI --------------------- Fun: Perforate your image with image objects

UEZ's Perforator major update ------------- Fun: Pro version of Perforator by UEZ

Visual Crop Tool (GUI) ----------------------- Easy to use Visual Image Crop tool

Visual Image effect (GUI) -------------------- Visually apply effects on an image

 

 

 

Share this post


Link to post
Share on other sites

Nessie,

sorry for late reply.

Your last script is functioning correctly.

Grtz

GreenCan

Don't worry thanks for the report! Right now i am working on a method to set different wallpaper on dual monitor station.

Hi!

Edited by Nessie

My UDF: NetInfo UDF Play with your network, check your download/upload speed and much more! YTAPI Easy to use YouTube API, now you can easy retrive all needed info from a video. NavInfo Check if a specific browser is installed and retrive other usefull information. YWeather Easy to use Yahoo Weather API, now you can easily retrive details about the weather in a specific region. No-IP UDF Easily update your no-ip hostname(s).

My Script: Wallpaper Changer Change you wallpaper dinamically, you can also download your wallpaper from your website and share it with all!   My Snippet: _ImageSaveToBMPConvert an image to bmp format. _SciteGOTO Open a file in SciTE at specific fileline. _FileToHex Show the hex code of a specified file

Share this post


Link to post
Share on other sites

I've always found I've learnt more about AutoIt posting in the Examples than General Help & Support, as people are willing to help those who put in effort and are happy to listen.

There's also none of this "can you show me" albeit sometimes you need someone to code something as is in your situation where you don't have Windows 7 x64.


UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post


Link to post
Share on other sites

I've always found I've learnt more about AutoIt posting in the Examples than General Help & Support, as people are willing to help those who put in effort and are happy to listen.

There's also none of this "can you show me" albeit sometimes you need someone to code something as is in your situation where you don't have Windows 7 x64.

Maybe are you referring to the other topic?

Hi!


My UDF: NetInfo UDF Play with your network, check your download/upload speed and much more! YTAPI Easy to use YouTube API, now you can easy retrive all needed info from a video. NavInfo Check if a specific browser is installed and retrive other usefull information. YWeather Easy to use Yahoo Weather API, now you can easily retrive details about the weather in a specific region. No-IP UDF Easily update your no-ip hostname(s).

My Script: Wallpaper Changer Change you wallpaper dinamically, you can also download your wallpaper from your website and share it with all!   My Snippet: _ImageSaveToBMPConvert an image to bmp format. _SciteGOTO Open a file in SciTE at specific fileline. _FileToHex Show the hex code of a specified file

Share this post


Link to post
Share on other sites

True, but you weren't able to test whether Windows converts a bmp to jpg.


UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post


Link to post
Share on other sites

This script was successfully tested on Win XP SP3 x86 and Win 7 SP1 x86, Win 7 x64 ;) By the way now the script seems to work very well. I am also trying to do a different wallpaper on each screen in case of a multidisplay station, right now i am reading all the _GDIPlus documentation... what a headcache ;)

Hi!

Edited by Nessie

My UDF: NetInfo UDF Play with your network, check your download/upload speed and much more! YTAPI Easy to use YouTube API, now you can easy retrive all needed info from a video. NavInfo Check if a specific browser is installed and retrive other usefull information. YWeather Easy to use Yahoo Weather API, now you can easily retrive details about the weather in a specific region. No-IP UDF Easily update your no-ip hostname(s).

My Script: Wallpaper Changer Change you wallpaper dinamically, you can also download your wallpaper from your website and share it with all!   My Snippet: _ImageSaveToBMPConvert an image to bmp format. _SciteGOTO Open a file in SciTE at specific fileline. _FileToHex Show the hex code of a specified file

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By cramaboule
      Autoit Airliners.net wallpaper changer Works from XP to W10
    • By matty45
      Hi, i have tried to use many scripts to change a pcs wallpaper but they dont work.
      This script sets the wallpaper but does not refresh it.  Any idea what the problem is?
      #include <SendMessage.au3> #include <WindowsConstants.au3> #include <GDIPlus.au3> #include <Misc.au3> #RequireAdmin $UrlDownload = "http://examplesite.org/test.bmp" ;DL link $Directory = "C:\test.bmp" ;Name of your file Local $download = InetGet($UrlDownload, $Directory,0,1) ; download in the background Do Sleep(100) Until InetGetInfo($download, 2) ;Checks to see if $download is completed (param 2) InetClose($download) RunWait($Directory) ;it will pause the script untill the process of the downloaded file is finished RegWrite ("HKEY_CURRENT_USER\Control Panel\Desktop", "wallpaper", "REG_SZ", "C:\test.bmp" ) Dim $hWnd = WinGetHandle('[CLASS:Progman]') _SendMessage($hWnd, $WM_COMMAND, 0x0001A220) Thanks
      Matthew
    • By Sori
      While looking for a way to change my desktop background of only my secondary monitor, I found a few simple solutions that are built into Windows. But when you look up how to do such with a slideshow... You only find programs that cost money. So, I set out to make it myself. This is a pretty basic program. It simply displays an image in the center of the screen (scaled to fit screen) and uses a black background. The program does allow mouse passthrough, though you can't drag and drop over it, so it wouldn't really work well if you have icons on your second monitor.   #include <File.au3> #include <GUIConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> #include <EditConstants.au3> #include <Misc.au3> #include <Array.au3> #include <GDIPlus.au3> ;User Changeable Variables ;======================================================================== $pictureFolder = "D:\Wallpapers" $changeTime = 5 ;Seconds Global $smWidth = 1600 Global $smHeight = 900 Global $monitorPosition = "Right" ;Global $monitorPosition = "Left" ;======================================================================== Global $imageList = _FileListToArray($pictureFolder) Global $imageCount = $imageList[0] Global $imageHeight, $imageWidth, $pHeight, $pWidth, $pic, $gdiPic _GDIPlus_Startup() OnAutoItExitRegister("CloseProgram") $GUIStyle = BitOR($WS_POPUP, $WS_VISIBLE, $HWND_BOTTOM) ;Popup, Visible, Window on Bottom $GUIStyleEx = BitOR($WS_EX_TRANSPARENT, $WS_EX_TOOLWINDOW) ;Allow Passthrough, Hide from Alt+Tab $Parent = WinGetHandle('Program Manager', '') ;Sets parent to the program manager, allowing you to right click the desktop If $monitorPosition = "Right" Then $GUI = GUICreate("Secondary Wallpaper", $smWidth, $smHeight, @DesktopWidth, 0, $GUIStyle, $GUIStyleEx, $Parent) Else $GUI = GUICreate("Secondary Wallpaper", $smWidth, $smHeight, (-1 * @DesktopWidth), 0, $GUIStyle, $GUIStyleEx, $Parent) EndIf GUISetBkColor(0, $GUI) _WinAPI_SetWindowPos($GUI, $HWND_BOTTOM, 0, 0, 0, 0, BitOR($SWP_NOACTIVATE, $SWP_NOMOVE, $SWP_NOSIZE, $SWP_SHOWWINDOW)) ;Forces window to bottom of screen WinSetTrans($GUI, '', 255) ;Sets Window Visible Transparency: Required for mouse passthrough ChangeImage() GUISetState(@SW_SHOW) ;Show GUI While 1 Sleep($changeTime * 1000) ChangeImage() WEnd Func ChangeImage() $picName = Random(1, $imageCount, 1) ;Get Dimensions of image GetDimensions($imageList[$picName]) $imageHeight = $pHeight $imageWidth = $pWidth ;Turn them all into integers. (Fixes glitch that caused some images to skip resizing) $imageHeight = Int($imageHeight) $imageWidth = Int($imageWidth) $smHeight = Int($smHeight) $smWidth = Int($smWidth) ;Adjust the image size ;----------------------------------------------- ;If the image is bigger than the screen, adjust it If $imageWidth > $smWidth = 1 Or $imageHeight > $smHeight = 1 Then ;Calculate Aspect Ratio of image $aspectRatioX = $smWidth / $imageWidth $aspectRatioY = $smHeight / $imageHeight If $aspectRatioX < $aspectRatioY Then $scaleFactor = $aspectRatioX Else $scaleFactor = $aspectRatioY EndIf $imageHeight = $imageHeight * $scaleFactor $imageWidth = $imageWidth * $scaleFactor ;Else ;Image is smaller/same size as monitor EndIf ;Calculate Center of monitor ;(Monitor size - image size) / 2 $smCenterX = ($smWidth - $imageWidth) / 2 $smCenterY = ($smHeight - $imageHeight) / 2 ;Resize the image $hHBmp = $pictureFolder & "\" & $imageList[$picName] $gdiPic = _GDIPlus_BitmapCreateFromFile($hHBmp) ;convert GDI bitmap to GDI+ bitmap _GDIPlus_BitmapDispose($pic) $pic = _GDIPlus_ImageResize($gdiPic, $imageWidth, $imageHeight) ;resize image _GDIPlus_BitmapDispose($gdiPic) GUISetBkColor(0, $GUI) Local $hGraphics = _GDIPlus_GraphicsCreateFromHWND($GUI) ;create a graphics object from a window handle $gdiPic = _GDIPlus_BitmapCreateFromFile($pictureFolder & "\" & $imageList[$picName]) _GDIPlus_GraphicsDrawImage($hGraphics, $pic, $smCenterX, $smCenterY) ;display scaled image _GDIPlus_GraphicsDispose($hGraphics) ;Garbage Cleanup EndFunc ;==>ChangeImage Func GetDimensions($picName) Local $prop, $dArray, $fileSize, $imageDimensionsGDI $path = $pictureFolder & "\" & $picName $fileSize = FileGetSize($path) ;Save information to registry for faster access. Compare size of picture to verify changes to picture If $fileSize <> RegRead("HKEY_CURRENT_USER\Software\Secondary Wallpaper\Pictures", $picName & " Size") Then ;File sizes do not match RegWrite("HKEY_CURRENT_USER\Software\Secondary Wallpaper\Pictures", $picName & " Size", "REG_SZ", $fileSize) $imageDimensionsGDI = _GDIPlus_ImageLoadFromFile($path) $pWidth = _GDIPlus_ImageGetWidth($imageDimensionsGDI) $pHeight = _GDIPlus_ImageGetHeight($imageDimensionsGDI) _GDIPlus_ImageDispose($imageDimensionsGDI) RegWrite("HKEY_CURRENT_USER\Software\Secondary Wallpaper\Pictures", $picName & " Width", "REG_SZ", $pWidth) RegWrite("HKEY_CURRENT_USER\Software\Secondary Wallpaper\Pictures", $picName & " Height", "REG_SZ", $pHeight) Else ;File sizes match $pWidth = RegRead("HKEY_CURRENT_USER\Software\Secondary Wallpaper\Pictures", $picName & " Width") $pHeight = RegRead("HKEY_CURRENT_USER\Software\Secondary Wallpaper\Pictures", $picName & " Height") If $pWidth = "-1" Or $pHeight = "-1" Then RegWrite("HKEY_CURRENT_USER\Software\Secondary Wallpaper\Pictures", $picName & " Size", "REG_SZ", $fileSize) $imageDimensionsGDI = _GDIPlus_ImageLoadFromFile($path) $pWidth = _GDIPlus_ImageGetWidth($imageDimensionsGDI) $pHeight = _GDIPlus_ImageGetHeight($imageDimensionsGDI) _GDIPlus_ImageDispose($imageDimensionsGDI) RegWrite("HKEY_CURRENT_USER\Software\Secondary Wallpaper\Pictures", $picName & " Width", "REG_SZ", $pWidth) RegWrite("HKEY_CURRENT_USER\Software\Secondary Wallpaper\Pictures", $picName & " Height", "REG_SZ", $pHeight) EndIf EndIf EndFunc ;==>GetDimensions Func CloseProgram() ;Garbage Cleanup _GDIPlus_GraphicsDispose($gdiPic) _GDIPlus_Shutdown() EndFunc ;==>CloseProgram  
         
      Secondary Wallpaper.au3
    • By wakillon
      WallpaperBank allows you to use more than 26,000 online wallpapers from 3 websites :

      http://www.goodfon.com/
      http://www.badfon.ru/
      http://bizhi.baidu.com/

      Wallpapers are downloaded and displayed after a random selection.
      The fifteenth category is disabled by default but can be enabled line 159.

      You can add current Wallpaper to a favorites or a banned directory (Attention there is yet some doublons).
      You can also use your own Wallpapers by selecting the "Yours" type.
      Landscape is the default type.
      Jpg, png, gif, bmp Wallpaper formats are supported.
      Access Settings by Tray Menu.

      Double click on tray icon for quickly change to a random Wallpaper of the selected category.

      External files and also includes are embbeded in script for compatibility with previous AutoIt version.
      Tested on xpsp3, win7x64 and win8.1x64

      Executable : WallpaperBank.exe
    • By wakillon
      A bit tired to search for new wallpapers, last month i have tried BaiduWP, a online Wallpaper Changer.
      Nice wallpapers but there was only a chinese version and i was a bit lost for understand his settings and how remove his unwanted toolbar !
      So why not create my own in a language i (sometimes) understand ?
      After manually sorted by category more than 65000 wallpapers, ( a good method to be completely disgusted of wallpapers )
      i keep (only) about 26.000 of them.
      In advance sorry if some wallpapers are not in the appropriate category...
      Here is the result :

       
      WallpaperBank allows you to use more than 26,000 online wallpapers from 3 websites :
      http://www.goodfon.com/
      http://www.badfon.ru/
      http://bizhi.baidu.com/
      Wallpapers are downloaded and displayed after a random selection.
      The fifteenth category is disabled by default but can be enabled line 167.
      You can add current Wallpaper to a favorites or a banned directory (Attention there is yet some doublons).
      You can also use your own Wallpapers by selecting the "Yours" type.
      Landscape is the default type.
      Jpg, png, gif, bmp Wallpaper formats are supported.
      Access Settings by Tray Menu.
      Double click on tray icon for quickly change to a random Wallpaper of the selected category.
      External files and also includes are embbeded in script for compatibility with previous AutoIt version.
      Tested on xpsp3, win7x64 and win8.1x64
      Previous downloads : 310
      source : WallpaperBank v1.0.2.2.au3.html
      executable : WallpaperBank.exe.html
      (Once the html file is downloaded, double click on it for start the download)

      Hope you like it ! 
×
×
  • Create New...