View Single Post
  #1  
Old 01-10-2001, 11:35 AM
BlakeBlake BlakeBlake is offline
Senior Member
 
Join Date: Jan 2001
Posts: 156
Default Example of StringToWideChar

I have a procedure taking a string parameter

procedure SetActiveDesktopWallpaper(filename : string);
const
CLSID_ActiveDesktop: TGUID = '{75048700-EF1F-11D0-9888-006097DEACF9}';
var
ActiveDesktop: IActiveDesktop;
Buffer: array[0..255] of WideChar;
begin

ActiveDesktop := CreateComObject(CLSID_ActiveDesktop)
as IActiveDesktop;
ActiveDesktop.SetWallpaper('C:\WINDOWS\Desktop\del phi program\OutPut\Wallpaper.bmp', 0);
ActiveDesktop.ApplyChanges(AD_APPLY_ALL or AD_APPLY_FORCE);
end;


I need to convert the string into a widechar but I dont know how the StringtoWideChar function works.

I need the parameter passed to ActiveDesktop.SetWallpaper();
to be in the form of a widechar so that I can vary the wallpaper set.

Can someone please give me a working example of the StringToWideChar function ?
Reply With Quote