Jump to content

GDIPlus.au3


au3scr
 Share

Recommended Posts

no no its include script, some wallpaper changers need's it

i want learn how make wallpaper changer, but i cant without this include file.

i want make script that takes pictures from given directory in random order an set it to back gronund.and reapeat it in every minute

Edited by au3scr
Link to comment
Share on other sites

no no its include script, some wallpaper changers need's it

i want learn how make wallpaper changer, but i cant without this include file.

i want make script that takes pictures from given directory in random order an set it to back gronund.and reapeat it in every minute

It's included in the install of AutoIt. Look in the help under UDFs

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

old script I wrote...there are better examples on the forums. I don't remember the exact dll call that did this, but the source code is posted, so I'll bet you can find it :)

"There are 10 types of people in this world - those who can read binary, and those who can't.""We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true." ~Robert Wilensky0101101 1001010 1100001 1101101 1100101 1110011 0110011 1001101 10001110000101 0000111 0001000 0001110 0001101 0010010 1010110 0100001 1101110
Link to comment
Share on other sites

This is slightly outdated but it works:

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

Global Const $SPI_SETDESKWALLPAPER            = 0x0014
Global Const $SPIF_UPDATEINIFILE                = 0x0001
Global Const $SPIF_SENDCHANGE                  = 0x0002

Func _ChangeDesktopBackground($sFile, $iPosition=3)
    Local $sCLSID, $tBuffer, $hImage, $sTemp

; Convert JPG image to BMP image
    _GDIPlus_Startup()
    $hImage = _GDIPlus_ImageLoadFromFile($sFile)
    $sCLSID = _GDIPlus_EncodersGetCLSID("BMP")
    $sTemp  = _Str_ChangeFileExt($sFile, ".bmp")
    _GDIPlus_ImageSaveToFile($hImage, $sTemp)
    _GDIPlus_ImageDispose($hImage)
    _GDIPlus_Shutdown()

; Set wallpaper position
    Switch $iPosition
        Case 1; Tile
            RegWrite('HKCU\Control Panel\Desktop', 'TileWallpaper' , 'reg_sz', '1')
            RegWrite('HKCU\Control Panel\Desktop', 'WallpaperStyle', 'reg_sz', '0')
        Case 2; Center
            RegWrite('HKCU\Control Panel\Desktop', 'TileWallpaper' , 'reg_sz', '0')
            RegWrite('HKCU\Control Panel\Desktop', 'WallpaperStyle', 'reg_sz', '0')
        Case 3; Stretch
            RegWrite('HKCU\Control Panel\Desktop', 'TileWallpaper' , 'reg_sz', '0')
            RegWrite('HKCU\Control Panel\Desktop', 'WallpaperStyle', 'reg_sz', '2')
    EndSwitch

; Set wallpaper
    $tBuffer = DllStructCreate("char Text[" & StringLen($sTemp) + 1 & "]")
    DllStructSetData($tBuffer, "Text", $sTemp)
    _WinAPI_SystemParametersInfo($SPI_SETDESKWALLPAPER, 0, DllStructGetPtr($tBuffer), BitOR($SPIF_UPDATEINIFILE, $SPIF_SENDCHANGE))
EndFunc

Func _Str_ChangeFileExt($sFileName, $sExtension)
  Local $iIndex

  $iIndex = _Str_LastDelimiter(".\:", $sFileName)
  if ($iIndex = 0) or (StringMid($sFileName, $iIndex, 1) <> ".") then $iIndex = StringLen($sFileName) + 1
  Return StringLeft($sFileName, $iIndex - 1) & $sExtension
EndFunc

Func _Str_LastDelimiter($sDelimiters, $sString)
  Local $iI, $iN, $sDelimiter

  for $iI = 1 to StringLen($sDelimiters)
    $sDelimiter = StringMid($sDelimiters, $iI, 1)
    $iN = StringInStr($sString, $sDelimiter, 0, -1)
    if $iN > 0 then Return $iN
  next
EndFunc
My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Link to comment
Share on other sites

>"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:\Documents and Settings\rain\Desktop\lol.au3" /autoit3dir "C:\Program Files\AutoIt3" /UserParams

+>23:32:56 Starting AutoIt3Wrapper v.1.9.5.6 Environment(Language:0409 Keyboard:00000425 OS:WIN_XP/Service Pack 2 CPU:X86)

>Running AU3Check (1.54.9.0) from:C:\Program Files\AutoIt3

C:\Documents and Settings\rain\Desktop\lol.au3(1,9) : ERROR: can't open include file <WinAPI.au3>

#include<WinAPI.au3>

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...