WriteFile ()

From ISXKB

Jump to: navigation, search

This article shows how to use the Windows API function WriteFile with Inno Setup. This function is sometimes useful because Inno Setup's file handling functions don't support security or any kind of locking/sharing mechanism. You can write to a file after opening it with CreateFile ().

Contents

Declaration

The following declaration is required in a [Code] section:

function WriteFile (
     hFile:                      THandle;
     lpBuffer:                   String;
     nNumberOfBytesToWrite:      LongInt;
     var lpNumberOfBytesWritten: LongInt;
     lpOverlapped:               LongInt
) : Boolean;
 external 'WriteFile@kernel32.dll stdcall';

WriteFile () at MSDN

Example

See Also

Personal tools
Ads: