Hey sorry i'm really rubish at this i still cannot get this to work what ever i try - Maybe becuse i'm usless and still a berginner at c++. but anyway i made a new project and just did a simple bit of code thats sets the wallpaper no error handle's or anything just simple stuff.
Code:
int ChangeWallpaper (char* FilePath) {
////////// Variables //////////
HRESULT hr;
////////// //////// //////////
CoInitialize(0); // Initialize COM
IActiveDesktop *pActiveDesktop; // Set IActiveDesktop Type
hr = CoCreateInstance(CLSID_ActiveDesktop, NULL, CLSCTX_INPROC_SERVER, // Load IActiveDesktop
IID_IActiveDesktop, (void**)&pActiveDesktop);
pActiveDesktop -> SetWallpaper (FilePath,0); // Set the Wallpaper ||| Problem is here!
pActiveDesktop -> ApplyChanges (AD_APPLY_ALL); // ApplyChanges
pActiveDesktop->Release(); // Unload IActiveDesktop
CoUninitialize (); // Uninitialize COM
return 1;
}
Yep as you see i have not converted the FilePath this is because every thing i try i still get that same type of error so if possable ( i know you have done ton and tons and well tons for me and thanks ) could somone tell me exactly how to change FilePath into a LPCWSTR. basicly i dont think i'm going to be able to figure out the conversion into a LPCWSTR with out being shown. oh yeh btw erm really i want this to subport multi languages so i dont think that loop thing would work but thanks.