Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #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
  #2  
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

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

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 02:53 AM.


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