how can i change the desktop wallpaper with a c programm?
(without active desktop)
the exambles i found on this page doesn't run.
thanks for help : )
how can i change the desktop wallpaper with a c programm?
(without active desktop)
the exambles i found on this page doesn't run.
thanks for help : )
Surely there must be a Win32 API call to do this?
http://msdn.microsoft.com
http://www.google.co.uk
Good class architecture is not like a Swiss Army Knife; it should be more like a well balanced throwing knife.
- Mike McShaffry
ähmm, is it possible that some could write a code examble for me , please =)
there are some examples at www.codeproject.com -- but they require COM and Microsoft IE.
Code:#pragma comment( lib, "user32.lib" ) #include <windows.h> int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int cmdShow ) { SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, "c:\\desktop.bmp", SPIF_UPDATEINIFILE); }
well this is what im also looking for but just one question
if i do this my background doesnt get updated (though the bmp does show up in the desktop configure thingie) , do i need to send a refresh thingie or is the active desktop mocking with me
ill try thx
*edit*
doesnt change anything ; though i see a register change
here is my testing code (though it is pure c) i didn't want to make a new thread
*edit*Code:#pragma comment( lib, "user32.lib" ) #include <windows.h> #include <stdio.h> int main(int argc,char *argv[]) { printf("Testing..."); scanf("%*c"); SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, "c:\\desktop.bmp",SPIF_UPDATEINIFILE); SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, "c:\\desktop.bmp",SPIF_SENDWININICHANGE); return 0; }
after googling some more ^^
bitoperaters are the key hereCode:SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, "c:\\desktop.bmp",SPIF_UPDATEINIFILE | SPIF_SENDWININICHANGE );
thx Tonto for the clue
Last edited by Narcose; 08-09-2006 at 03:58 AM.