Click or drag to resize

ShellDataObjectFormatSetHGlobalFormat Method (Object, Int32, String, Encoding, Int32, DVASPECT, Boolean)

Sets a format to an IDataObject using a string.

Namespace:  callback.ShellBoost.Core
Assembly:  callback.CBFSShell (in callback.CBFSShell.dll) Version: 22.0.0.0
Syntax
C#
public static int SetHGlobalFormat(
	Object dataObject,
	int format,
	string text,
	Encoding encoding = null,
	int index = -1,
	DVASPECT aspect = DVASPECT.DVASPECT_CONTENT,
	bool throwOnError = true
)

Parameters

dataObject
Type: SystemObject
The data object.
format
Type: SystemInt32
The format.
text
Type: SystemString
The text.
encoding (Optional)
Type: System.TextEncoding
The encoding to use to transform the string into bytes.
index (Optional)
Type: SystemInt32
The FORMATETC index.
aspect (Optional)
Type: System.Runtime.InteropServices.ComTypesDVASPECT
The aspect.
throwOnError (Optional)
Type: SystemBoolean
if set to true errors may be throw in case of Windows Shell errors.

Return Value

Type: Int32
0 or an error code.
Exceptions
ExceptionCondition
ArgumentNullExceptiondataObject or data is null.
See Also