🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #16805

Re: change wallpaper gif/jpg

#16805
From: Remy Lebeau (TeamB)
Date: Thu, 24 Apr 2003 17:57
36 lines
1975 bytes
"Subliminal" <doug@cowie3.fsnet.co.uk> wrote in message
news:3ea7f5ab@newsgroups.borland.com...
> what headers are needed

shlobj.h

> and how do I access the SetWallPaper function?

You need to create an instance of the IActiveDesktop interface, then you
simply call SetWallPaper() like you would any other class method.

> could you post and example please

    #include <shlobj.h>
    #include <utilcls.h>

    TComInterface<IActiveDesktop> ActiveDesktop;

    CoCreateInstance(CLSID_ActiveDesktop, NULL, CLSCTX_INPROC_SERVER,
                      IID_IActiveDesktop, (LPVOID*)&ActiveDesktop);

    if( ActiveDesktop )
    {
        ActiveDesktop->SetWallpaper(WideString("path to file"), 0);

        WALLPAPEROPT opt;
        opt.dwSize = sizeof(WALLPAPEROPT);
        opt.dwStyle = WPSTYLE_STRETCH;
        ActiveDesktop->SetWallpaperOptions(&opt, 0);

        ActiveDesktop->ApplyChanges(AD_APPLY_ALL);
    }


Gambit
Technical Details
Message-ID: <3ea82555$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!iad-peer.news.verio.net!news.verio.net!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail
References: <3ea2c223$1@newsgroups.borland.com> <3ea3164d$1@newsgroups.borland.com> <3ea7f5ab@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,fd7225d99dc4b60f
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-04-24 11:03:50 PST
From: "Remy Lebeau \(TeamB\)" <gambit47@yahoo.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3ea2c223$1@newsgroups.borland.com> <3ea3164d$1@newsgroups.borland.com> <3ea7f5ab@newsgroups.borland.com>
Subject: Re: change wallpaper gif/jpg
Date: Thu, 24 Apr 2003 10:57:40 -0700
Lines: 38
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 207.175.226.26
Message-ID: <3ea82555$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1051206997 207.175.226.26 (24 Apr 2003 10:56:37 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!iad-peer.news.verio.net!news.verio.net!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail