設定桌布函式 |
|
GE
一般會員 發表:4 回覆:16 積分:14 註冊:2003-01-23 發送簡訊給我 |
uses ShlObj, ComObj; procedure SetWallpaper(WallpaperPath: String); const CLSID_ActiveDesktop: TGUID = '{75048700-EF1F-11D0-9888-006097DEACF9}'; var ActiveDesktop: IActiveDesktop; ComponentsOpt: TComponentsOpt; WStr : PWideChar; begin WStr := AllocMem(MAX_PATH); try StringToWideChar(WallpaperPath, WStr, MAX_PATH); ActiveDesktop := CreateComObject(CLSID_ActiveDesktop) as IActiveDesktop; ComponentsOpt.dwSize := sizeOf(ComponentsOpt); ActiveDesktop.GetDesktopItemOptions(ComponentsOpt,0); ComponentsOpt.fActiveDesktop := true; //啟動ActiveDesktop ActiveDesktop.SetDesktopItemOptions(ComponentsOpt,0); ActiveDesktop.SetWallpaper(WStr, 0); ActiveDesktop.ApplyChanges(AD_APPLY_ALL); //儲存設定 finally FreeMem(wstr); end; end;這個函式可以指定圖檔、Html檔做為桌布,請各位笑納 :) |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |