Delphi Pages Forums

Delphi Pages Forums (
-   General (
-   -   Example of StringToWideChar (

BlakeBlake 01-10-2001 11:35 AM

Example of StringToWideChar
I have a procedure taking a string parameter

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

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);

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
WideCharBuf: array[0..256] of WideChar;
StringToWideChar(StringToConvert, WideCharBuf,
SizeOf(WideCharBuf) div 2);

All times are GMT. The time now is 12:44 AM.

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