12月142015
AU3更改壁纸例子
来源:==>>官方论坛<<==
使用ObjCreateInterface
创建IActiveDesktop
更改壁纸例子
;===============================================================================
#interface "IActiveDesktop"
Global Const $sCLSID_ActiveDesktop = "{75048700-EF1F-11D0-9888-006097DEACF9}"
Global Const $sIID_IActiveDesktop = "{F490EB00-1240-11D1-9888-006097DEACF9}"
Global Const $tagIActiveDesktop = _
"ApplyChanges hresult(dword);" & _
"GetWallpaper hresult(wstr;uint;dword);" & _
"SetWallpaper hresult(wstr;dword);" & _
"GetWallpaperOptions hresult(struct*;dword);" & _
"SetWallpaperOptions hresult(struct*;dword);" & _
"GetPattern hresult(wstr;uint;dword);" & _
"SetPattern hresult(wstr;dword);" & _
"GetDesktopItemOptions hresult(struct*;dword);" & _
"SetDesktopItemOptions hresult(struct*;dword);" & _
"AddDesktopItem hresult(struct*;dword);" & _
"AddDesktopItemWithUI hresult(hwnd;struct*;dword);" & _
"ModifyDesktopItem hresult(struct*;dword);" & _
"RemoveDesktopItem hresult(struct*;dword);" & _
"GetDesktopItemCount hresult(int*;dword);" & _
"GetDesktopItem hresult(int;struct*;dword);" & _
"GetDesktopItemByID hresult(ulong_ptr;struct*;dword);" & _
"GenerateDesktopItemHtml hresult(wstr;struct*;dword);" & _
"AddUrl hresult(hwnd;wstr;struct*;dword);" & _
"GetDesktopItemBySource hresult(wstr;struct*;dword);"
;===============================================================================
Global Const $AD_APPLY_ALL = 0x00000007
;;;;;;;;;;;;;;;;;;; Example ;;;;;;;;;;;;;;;;;;;;;;;;;;;
$oActiveDesktop = ObjCreateInterface($sCLSID_ActiveDesktop, $sIID_IActiveDesktop, $tagIActiveDesktop)
$sFile = FileOpenDialog("Select New Wallpaper", "", "Images (*.jpg;*.bmp;*.png;*.gif;*.whatever)") ; whatever
If $sFile Then
$oActiveDesktop.SetWallpaper($sFile, 0)
$oActiveDesktop.ApplyChanges($AD_APPLY_ALL)
EndIf
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
扫描二维码,在手机上阅读
发表评论
木有头像就木JJ啦!还木有头像吗?点这里申请属于你的个性Gravatar头像吧!