heavenm 发表于 2015-1-2 12:54:07

有对OBJ熟悉的么,请教下怎么获取桌面背景GetWallpaper

http://autoitx.com/forum.php?mod=viewthread&tid=40315&highlight=%B1%DA%D6%BD;===============================================================================
#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)
Dim $a
$b=$oActiveDesktop.GetWallpaper($a,100,0x00000000)
MsgBox(0, $a, $oActiveDesktop.GetWallpaper($a,100,0x00000000))
#include'array.au3'
_ArrayDisplay($b)
Exit
$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
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
怎么写 貌似弄不明白额!
我想获取桌面背景
http://msdn.microsoft.com/en-us/library/bb776355(v=vs.85).aspx
这个是说明
有大神指教下么

heavenm 发表于 2015-1-2 13:00:15

= =#完全没有头绪!!!
页: [1]
查看完整版本: 有对OBJ熟悉的么,请教下怎么获取桌面背景GetWallpaper