Printer for Remote Desktop API — it's a reference guide that describes the API structure, classes, functions and etc.

DLL API Integration
Developer API is a DLL file, that provides set of functions. 

Note: Developer API file is located in C:\WINDOWS\system32\vpprintapi.dll.
In order to use the api you should copy this dll file in a folder with your product. 

Functions
FtPrnVirtApiInit		Initialize API to communicate with the client side and set the event callback method.
FtPrnVirtApiCleanUp		Stop communicating with the client side.
FtPrnSelectPrinter		Select default printer
FtPrnGetDefaultPrinter		Get default printer

/////////////////////////////////////////////////////////////////////////////////
FtPrnVirtApiInit Function
Initialize API to communicate with the client side and set the event callback method.

FtStatus FtPrnVirtApiInit(
	PNOTIFICATION_CALLBACK pCallback,
	LPVOID lpContext
	);

Parameters
pCallback
[in] [out] Callback function.

lpContext
[in] User context (any value).

Return Value
ftSuccess, ftFail, one of the values of FtStatus.

/////////////////////////////////////////////////////////////////////////////////
FtPrnVirtApiCleanUp Function
Stop communicating with the client side.

FtStatus FtPrnVirtApiCleanUp(); 

Parameters
None. 

Return Value
ftSuccess, one of the values of FtStatus.

/////////////////////////////////////////////////////////////////////////////////
FtPrnSelectPrinter Function

Sets the specified virtual printer as the default printer for the current user on the local computer. Invokes the SetDefaultPrinter WinAPI.

FtStatus FtPrnSelectPrinter(
	DWORD dwPrinterID
	);

Parameters
dwPrinterID
[in] Unique Id of printer.

Return Value
ftSuccess, ftFail, one of the values of FtStatus.

/////////////////////////////////////////////////////////////////////////////////
FtPrnGetDefaultPrinter Function

Retrieves virtual printer configured as default printer for the current user on the local computer. Invokes the GetDefaultPrinter WinAPI.

FtStatus FtPrnGetDefaultPrinter(
	ftPrinter *lpPrinter
	);
	
Parameters
lpPrinter
[out] Pointer to ftPrinter structure. Refer to ftPrinter structure

Return Value
ftSuccess, ftFail, one of the values of FtStatus.

/////////////////////////////////////////////////////////////////////////////////
FtPrnSetLastUsedPrinter Function

Saves the specified printer in the registry and sets it as the default printer for the current user in the product.

This function is called by the tray shell. If it is not running, the "LastUsedPrinter" functionality will not work during the next session login.
In that case, this functionality can be implemented by calling FtPrnSetLastUsedPrinter after FtPrnSelectPrinter.

FtStatus FtPrnSetLastUsedPrinter(
	DWORD dwPrinterID
	);

Parameters
dwPrinterID
[in] Unique Id of printer.

Return Value
ftSuccess, ftFail, one of the values of FtStatus.

/////////////////////////////////////////////////////////////////////////////////
ftPrinter Structure
Contains information about the printer.

#define PRINTER_MAME_LENGTH	256

typedef struct FT_PRINTER
{
	DWORD dwUniqId;
	BOOL  bSelected;
	WCHAR wsName[PRINTER_MAME_LENGTH];
	WCHAR wsVirtName[PRINTER_MAME_LENGTH];
} ftPrinter;

dwUniqId
Unique Id of the printer.

bSelected
if TRUE – default printer

wsName
Physical printer name

wsVirtName
Virtual printer name

/////////////////////////////////////////////////////////////////////////////////
FtStatus Constants

ftSuccess 			0 	The operation completed successfully. 
ftFail 				1 	The operation failed. Unknown error. 
ftOutOfMemory 			2 	Memory allocation error. 
ftBufferTooSmall 		3 	Allocated buffer is not large enough to store required data. 
ftInvalidParameter 		4 	Invalid parameter. 
ftNotFound 			5 	Element not found. 
ftNotReady 			6 	The device (or a program component) is not ready. 
ftAlreadyExists 		7 	Cannot create an item when that item already exists. 
ftSecurityRestriction 		8 	The operation is impossible due to rights restriction. 
ftNotConnected 			20 	Connection has not been established due to some reason. 
ftLicInvalidKey 		100 	Invalid license key. 
ftLicInvalidKeyVersion 		101 	Wrong key version. 
ftLicNotMyKey 			102 	Attempt to apply another product's license key. 
ftLicBrokenKey 			103 	Defective license key. 
ftLicBlacklistedKey 		104 	The license key has been blacklisted. 
ftLicExpired 			105 	License key has expired. 
ftLicExceeded 			106 	Count of licenses has been exceeded. 
ftLicUpgradePeriodExpired 	107 	Upgrade period has expired. 

/////////////////////////////////////////////////////////////////////////////////
FT_PRINTER_EVENT Event
Global Events.

typedef 
void(__cdecl *PNOTIFICATION_CALLBACK)(
	FT_PRINTER_EVENT nNotifyEvent, 
	LPVOID lpData, 
	LPVOID lpContext
	);

typedef PNOTIFICATION_CALLBACK *NOTIFICATION_CALLBACK;

Parameters

nNotifyEvent
Event type. Refer to FT_PRINTER_EVENT

lpParam
Event value (it depends on event type)

lpContext
User context. Refer to FtPrnVirtApiInit

/////////////////////////////////////////////////////////////////////////////////
FT_PRINTER_EVENT Constants

evPrinterUnplugged		50 		Printer has been removed
evPrinterPlugged		51		Printer has been added
evPrintersListed 		52		All printers are listed
evSvcStarted			53		Notification that the service has been launched.
evSvcStopped			54		Notification that the service has been stopped.
evRdpConnected			55		A client connected to a Virtual Devices.
evRdpNotConnected		56		A client disconnected from a Virtual Devices.
evRdpConnectionBroken		57		Connection to a Virtual Devices has been broken.
evRdpInvalidProtocol		58		Invalid network protocol.
evLicOk				59		License has been applied successfully.
evLicLicenseExceeding		60		License has exceeded
evLicLicenseExpired		61		License has expired.
evLicNoMoreSublicenses		62
evLicSublicReleased		63
evLicAcquiredLocally		64	
evLicAcquiredBySrv		65
evLicReleasedLocally		66
evLicReleasedBySrv		67
evLicSrvSessionOpened		68
evLicSrvSessionClosed		69
evLicGeneralError		70

