Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Thread Tools Display Modes
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);
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 ?
Reply With Quote
Old 01-10-2001, 01:26 PM
MrBaseball34 MrBaseball34 is offline
Senior Member
Join Date: Jan 2001
Posts: 7,260
Default RE: Example of StringToWideChar

WideCharBuf: array[0..256] of WideChar;
StringToWideChar(StringToConvert, WideCharBuf,
SizeOf(WideCharBuf) div 2);
Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump

All times are GMT. The time now is 03:40 PM.

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