babou Posted January 19, 2009 Posted January 19, 2009 (edited) Hi all,I do not understand how it work, i have this exampleFunc _ScreenSaverActive($bBoolean) Local Const $SPI_SETSCREENSAVEACTIVE = 17 Local $lActiveFlag Dim $lActiveFlag Dim $retvaL If $bBoolean Then $lActiveFlag = 1 Else $lActiveFlag = 0 EndIf $dll = DllOpen("user32.dll") $retvaL = DllCall($dll, "long", "<span class="searchlite">SystemParametersInfo</span>", "long", $SPI_SETSCREENSAVEACTIVE, "long", $lActiveFlag, "long", 0, "long", 0) DllClose($dll) EndFuncI do not understand Local Const $SPI_SETSCREENSAVEACTIVE = 17because in msdn doc i read that the name of uiAction is SPI_SETSCREENSAVEACTIVE and in autoit script you use "17" ... How can i convert ? i would like to use "SPI_GETDESKWALLPAPER" how can i do ?that's all Edited January 19, 2009 by babou
azure Posted January 19, 2009 Posted January 19, 2009 Hi all, I do not understand how it work, i have this example Func _ScreenSaverActive($bBoolean) Local Const $SPI_SETSCREENSAVEACTIVE = 17 Local $lActiveFlag Dim $lActiveFlag Dim $retvaL If $bBoolean Then $lActiveFlag = 1 Else $lActiveFlag = 0 EndIf $dll = DllOpen("user32.dll") $retvaL = DllCall($dll, "long", "<span class="searchlite">SystemParametersInfo</span>", "long", $SPI_SETSCREENSAVEACTIVE, "long", $lActiveFlag, "long", 0, "long", 0) DllClose($dll) EndFunc I do not understand Local Const $SPI_SETSCREENSAVEACTIVE = 17 because in msdn doc i read that the name of uiAction is SPI_SETSCREENSAVEACTIVE and in autoit script you use "17" ... How can i convert ? i would like to use "SPI_GETDESKWALLPAPER" how can i do ? that's all Try $SPI_GETDESKWALLPAPER=115
babou Posted January 19, 2009 Author Posted January 19, 2009 thanks i have found a web sitehttp://www.experts-exchange.com/Programmin...Q_21718714.htmlnow i cannot get my valueGlobal Const $SPI_GETDESKWALLPAPER = 115 $Wallpaper = DllStructCreate("int") DllStructSetData($Wallpaper, 1, 0) DllCall("user32.dll", "int", "SystemParametersInfo", "int", $SPI_GETDESKWALLPAPER, "int", 0, "ptr", DllStructGetPtr($Wallpaper), "char", 0) MsgBox(64, Default, DllStructGetData($Wallpaper, 1))my messagebox return "0" ... I do not understand the mistake and not the path of my wallpaperthanks
Developers Jos Posted January 19, 2009 Developers Posted January 19, 2009 (edited) Your receiving structure isn't correct:SPI_GETDESKWALLPAPER Retrieves the full path of the bitmap file for the desktop wallpaper. The pvParam parameter must point to a buffer to receive the NULL-terminated path string. Set the uiParam parameter to the size, in characters, of the pvParam buffer. The returned string will not exceed MAX_PATH characters. If there is no desktop wallpaper, the returned string is empty. Edited January 19, 2009 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Developers Jos Posted January 19, 2009 Developers Posted January 19, 2009 Global Const $SPI_GETDESKWALLPAPER = 115 $Wallpaper = DllStructCreate("char[256]") DllStructSetData($Wallpaper, 1, 0) DllCall("user32.dll", "int", "SystemParametersInfo", "int", $SPI_GETDESKWALLPAPER, "int", 255, "ptr", DllStructGetPtr($Wallpaper), "int", 0) MsgBox(64, Default, DllStructGetData($Wallpaper, 1)) SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now