🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Changing Desktop background

#6741
From: Remy Lebeau (TeamB)
Date: Mon, 18 Apr 2005 19:40
38 lines
2316 bytes
"Bsisko" <gary.roberson@bluecasa.net> wrote in message
news:4263f2e9@newsgroups.borland.com...

>      I'm trying to write an application to control the Windows XP desktop!
> Specifically speaking, on how to change the background picture on a daily
> basis.

Change in what way exactly?  If you are working with bitmaps only, then you
can use SystemParametersInfo() with the SPI_SETDESKWALLPAPER  flag.  If you
are working with other image formats, or anything else fancy, then make sure
Active Desktop is enabled and then you can use the IActiveDestop interface.

>     1)  I have a book "Win32 Programming API Bible" that instructs
> me on how to get a thread for the Desktop

Why do you need a thread for the Desktop?

> but I get the compiler error "function is not a member of Application" for
GetCurrentThreadID().

You misspelled the function name.  The name is "GetCurrentThreadId", not
"GetCurrentThreadID".

> HDESK hDesktop = GetThreadDesktop( GetCurrentThreadID() )
> This will get me the desktop handle:

You are thinking of the wrong desktop in that code.

> 2.)  Once I got the desktop handle, how do I find out which thread
> controls the background image, or Active Desktop function as XP calls it.

You don't need to know that to begin with.  You are taking the completely
wrong approach in accessing the Desktop background image.  Please refer to
my comments further above.


Gambit
Technical Details
Message-ID: <42640c90$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news2.google.com!proxad.net!212.101.4.254.MISMATCH!solnet.ch!solnet.ch!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4263f2e9@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,18f7396aee5ca768
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <4263f2e9@newsgroups.borland.com>
Subject: Re: Changing Desktop background
Date: Mon, 18 Apr 2005 12:40:14 -0700
Lines: 40
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 68.69.17.41
Message-ID: <42640c90$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1113853072 68.69.17.41 (18 Apr 2005 12:37:52 -0800)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news2.google.com!proxad.net!212.101.4.254.MISMATCH!solnet.ch!solnet.ch!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail