Subject: I can't set the desktop wallpaper.
From: [email-masked] (Alessandro Staltari)

24 Oct 1998 06:47:39 -0700
Message-ID: <00ab01bdfea7$5c14c320$010110ac.cygnus.gnu-win32@archimede>
Mime-Version: 1.0
Content-Type: multipart/alternative;
	boundary="----=_NextPart_000_00A6_01BDFEB8.1EDD5060"
To: <[email-masked]>

This is a multi-part message in MIME format.

------=_NextPart_000_00A6_01BDFEB8.1EDD5060
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hello!

I'm Alessandro Staltari and I have a little big problem with Cygnus =
Win32 C/C++ environment(release B19 with patched cygwinb19.dll).
I'm tryng to port the nice X-windows program xearth =
(http://www.cs.colorado.edu/~tuna/xearth/index.html) to windows, and I =
thougth to use the SystemParametersInfo function to update the desktop =
wallpaper.
The probelm is that when I try to update the wallpaper nothing happen to =
the desktop configuration, SystemParametersInfo returns 0 (failure) ad =
GetLastError returns 0 (No error). Why?
=20
To test the SystemParametersInfo function I used the following simple =
program:
=20
#include <windows.h>
=20
int WINAPI WinMain (HINSTANCE hInstance, =20
    HINSTANCE hPrevInstance,
    LPSTR   lpszCmdLine,
    int     cmdShow    =20
   )
{
 if (SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, "c:\\screen.bmp", =
SPIF_UPDATEINIFILE))
  printf("Success\n");
 else printf("Error:%lu\n",GetLastError());
}
=20
I compiled it with
gcc test.c -luser32 -lgdi32 -o test.exe
=20
When I execute ./test.exe at the bash prompt the output is
=20
Error:0

I tried to use the same SystemParametersInfo call in a program built =
with Visual C++ and it worked properly.
I also tried to use SystemParametersInfo to retrieve the size of the =
desktop not covered by the system tray (using the SPI_GETWORKAREA =
argument) and it woked with Visual C++ and Cygnus both.
=20
I hope somebody could help me.
=20
Thanks
=20
Alessandro Staltari

------=_NextPart_000_00A6_01BDFEB8.1EDD5060
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>

<META content=3Dtext/html;charset=3Diso-8859-1 =
http-equiv=3DContent-Type><!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 =
HTML//EN"><!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN"><!DOCTYPE HTML =
PUBLIC "-//W3C//DTD W3 HTML//EN"><!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 =
HTML//EN"><!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<META content=3D'"MSHTML 4.72.3110.7"' name=3DGENERATOR>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT color=3D#000000 size=3D2>Hello!</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>I'm Alessandro Staltari and I have a =
little big=20
problem with Cygnus Win32 C/C++ environment(release B19 with patched=20
cygwinb19.dll).</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2>I'm tryng to port the nice X-windows =
program=20
xearth (<B><A=20
href=3D"http://www.cs.colorado.edu/~tuna/xearth/index.html">http://www.cs=
..colorado.edu/~tuna/xearth/index.html</A></B>)=20
to windows, and I thougth to use the SystemParametersInfo function to =
update the=20
desktop wallpaper.</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2>The probelm is that when I try to =
update the=20
wallpaper nothing happen to the desktop configuration, =
SystemParametersInfo=20
returns 0 (failure) ad GetLastError returns 0 (No error). =
Why?</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>To test the SystemParametersInfo =
function I used=20
the following simple program:</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>#include =
&lt;windows.h&gt;</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>int WINAPI WinMain (HINSTANCE =
hInstance,&nbsp;=20
<BR>&nbsp;&nbsp;&nbsp; HINSTANCE hPrevInstance,<BR>&nbsp;&nbsp;&nbsp;=20
LPSTR&nbsp;&nbsp; lpszCmdLine,<BR>&nbsp;&nbsp;&nbsp; =
int&nbsp;&nbsp;&nbsp;&nbsp;=20
cmdShow&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp; )<BR>{<BR>&nbsp;if=20
(SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, =
&quot;c:\\screen.bmp&quot;,=20
SPIF_UPDATEINIFILE))<BR>&nbsp; =
printf(&quot;Success\n&quot;);<BR>&nbsp;else=20
printf(&quot;Error:%lu\n&quot;,GetLastError());<BR>}</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>I compiled it with</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2>gcc test.c -luser32 -lgdi32 -o=20
test.exe</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>When I execute ./test.exe at the bash prompt the =
output=20
is</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>Error:0</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>I tried to use the same =
SystemParametersInfo=20
call in a program built with Visual C++ and it worked =
properly.</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT><FONT size=3D2>I also tried =
to use=20
SystemParametersInfo to retrieve the size of the desktop not covered by =
the=20
system tray (using the SPI_GETWORKAREA argument) and it woked with =
Visual C++=20
and Cygnus both.</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>I hope somebody could help =
me.</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>Thanks</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>Alessandro =
Staltari</FONT></DIV></BODY></HTML>

------=_NextPart_000_00A6_01BDFEB8.1EDD5060--

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".