Hello friends, I am using the following code to change the wallpaper in Windows 11 and everything works perfectly as long as the image does not contain special characters such as the letters áéíóú or the letter ñ in its name.
procedure TForm1.Button1Click(Sender: TObject);
var
s: string;
begin
s := 'c:\windows\athena.bmp';
SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, PChar(s), 0)
end;
As an example I have an image called "Móntaña.jpg" and when I use the procedure in the registry I check that it appears as follows HKEY_CURRENT_USER\Control Panel\Desktop\Wallpaper that is written as follows: "C:\Desktop\Móntaña.jpg" for which it places a black image and not the wallpaper because the name had the special character.
It's the same when you want to execute a command from the console. I have the same problem, the texts with special characters don't work for me. Can someone help me? I've been having this problem for months and I can't solve it. Thanks in advance.