0

I've been trying a lot with this, such as using a bitmap and trying to use that for setting the background however everything I've been trying results in failure. So I was wondering can I use something like this:

SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, (void*)image, SPIF_UPDATEINIFILE);

however for image I use an image thats precompiled with the executable itself that I can call to set as its background.

EDIT: As @paddy pointed out down below, Ill post my finished source once I figure out how to dump the image :)

  • 1
    Is `image` a string containing the full path to the file? If not, it should be. And since this image is baked into your program, you program will need to dump it out somewhere in a supported image format. As always, try simplifying your program when you're not sure what's going on. Such as trying with a known file path to make sure it works. Call [`GetLastError`](https://docs.microsoft.com/en-us/windows/win32/api/errhandlingapi/nf-errhandlingapi-getlasterror) if `SystemParametersInfo` returns FALSE to find out more. – paddy Mar 10 '20 at 02:19
  • Concerning the JPEG in your executable: Things become easy if you store a jpeg file byte for byte into your exe (as is). Then, the exe just have to store it as file (without actually knowing the semantic of the data). FYI: [SO: How to include data object files (images, etc.) in program and access the symbols?](https://stackoverflow.com/a/47415163/7478597) – Scheff's Cat Mar 10 '20 at 04:15
  • Aren't resource files for including files in your binary and accessing them like they were a file on disk? – SKCoder Mar 10 '20 at 15:10

0 Answers0