Delphi Pages Forums

Delphi Pages Forums (http://www.delphipages.com/forum/index.php)
-   General (http://www.delphipages.com/forum/forumdisplay.php?f=2)
-   -   Example of StringToWideChar (http://www.delphipages.com/forum/showthread.php?t=18287)

BlakeBlake 01-10-2001 11:35 AM

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 ?

MrBaseball34 01-10-2001 01:26 PM

RE: Example of StringToWideChar
 
var
WideCharBuf: array[0..256] of WideChar;
begin
StringToWideChar(StringToConvert, WideCharBuf,
SizeOf(WideCharBuf) div 2);
end;


All times are GMT. The time now is 10:45 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.