The StartCapture() method is used to initialize the message capturing process. PrinterName represents the name of the printer which is monitored, such as “Black Ice Color”. The MessagingInterfaceMethod selects the desired message capture method to be used.
StartCapture(PrinterName as String, MessagingInterfaceMethod a Long) as Integer
Input value – PrinterName
Input value – MessagingInterfaceMethod:
1 - CopyData method.
2 - Broadcast messages to all applications.
3 - Pipe interface is used. To use the real Time Printer Hook, use this option.
Return value:
0 - No error occurred.
1 - PrinterName parameter is empty.
2 - MessagingInterfaceMethod parameter is invalid. This parameter must be 3 on terminal server systems. This parameter can be 1, 2 or 3 on 11/10/8/7 systems.
3 - The opening of the specified printer is failed. This error can be occurred if the user has no appropriate permissions.
4 - Error setting the printer data in the registry if the MessagingInterfaceMethod is 1.
5 - Error reading the devmode of the printer.
6 - Error setting the printer data in the registry if the MessagingInterfaceMethod is 2.