Choose Transfer Mode for ActMask Virtual Printer Driver SDK
After printing, ActMask Virtual Printer Driver cracks print job then converts it to target format. But you should let it know how to notice your application after converting. You can choose one from three Transfer Modes below.
1)
Command line parameter: The virtual printer driver runs application you specified and passes full name of the INI file to it as command line parameter. To pass additional parameter(s) to your application, you could set the AppParam value.
2)
WM_COPYDATA message: The virtual printer driver sends WM_COPYDATA message contains full name (ANSI characters) of the INI file to application you specified. Please make sure your application is running.
3)
Clipboard data: The virtual printer driver places full name (ANSI characters) of the INI file on clipboard in format you specified, then posts message to your application. Please make sure your application is running.
4)
Plugin Dll: If plugin dll exists, the virtual printer driver always calls your plugin dll and passes full path of INI file created to it directly, without setup TransMode value. For more details, please see Plugin Dll sample and "Pre-Processing & Plug-in DLL" in help document.
5)
Task: Virtual printer driver calls your application (task) and passes created file to it. For more details, please see "Preferences" in help document.
TransMode
Command Line
Parameter mode
WM_COPYDATA
Message mode
Clipboard mode
Action
ActMask Virtual Printer Driver will call command line below.
YourAppFileName.exe szIniFileName
ActMask Virtual Printer Driver will call Windows API FindWindow(TagWndClass, TagWndTitle) to get HWND of YourAppFileName.exe first, fill out COPYDATASTRUCT Structure, then send WM_COPYDATA message to your application.
typedef struct tagCOPYDATASTRUCT {
ULONG_PTR dwData;
DWORD cbData;
PVOID lpData;
} COPYDATASTRUCT, *PCOPYDATASTRUCT;
COPYDATASTRUCT stCopyData;
//Get HWND of YourAppFileName.exe
stCopyData.dwData = iTagWndMsgID; //TagWndMsgID setting in Registry
stCopyData.lpData = szIniFileName; //Includes terminating null ansi characters
stCopyData.cbData = strlen(szIniFileName) + 1; //Size of ini filename + 1
//Send WM_COPYDATA Message to YourAppFileName.exe
ActMask Virtual Printer Driver calls Windows API FindWindow(TagWndClass, TagWndTitle) to get HWND of YourAppFileName.exe first, registers your Clipboard format, copies ini filename (ansi characters, includes terminating null) to Clipboard, then sends message to notice YourAppFileName.exe
Set TransMode via GUI tools
We provide a GUI tools to help you set TransferMode settings. Please run "Configure driver" shortcut from SDK's program group. See below.
If you select Command Line Parameter mode, just click "Open..." button to choose the target exe will be called after printing.
If you select WM_COPYDATA Message mode, just set "Target Window Class"(optional), "Target Window Title" and "Message ID" options.
If you select Clipboard mode, just set "Target Window Class"(optional), "Target Window Title", "Message ID" and "Clipboard Format" options.
Click Save button to save settings.
To specify output format and options, run "Printer Preferences" shortcut.
Set TransMode via Registry
Of course, you can set TransferMode settings in registry directly. Learn more details about set registry value, please see Windows API RegOpenKeyEx, RegSetValueEx and RegCloseKey in MS SDK.
Registry Key Name:
HKEY_LOCAL_MACHINE\SOFTWARE\%PrinterName%
ie. HKEY_LOCAL_MACHINE\SOFTWARE\ActMask Virtual Printer, if the printer name is "ActMask Virtual Printer".
Value Name:
TransMode
AppFileName
TagWndMsgID
TagWndTitle
TagWndClass
ClipboardFormat
Data Type:
DWORD
String
DWORD
String
String
String
Details:
Specify mode for transfer. After printing, ActMask Universe Virtual Printer Driver transfers file(s) created and all printing information to your application with this mode you specified.
Default value: 0
Constants below can be used:
0 - Command Line Parameter mode
1 - WM_COPYDATA Message mode
2 - Clipboard mode
This setting is available if TransfMode equals 0 (Command Line Mode). Specify the application will be called after converting print job.
Defaule value: "{sys}\PrtClient.exe"
Constants below can be used:
{sys} - Windows system folder, compatible with Win32/64Wow64
{pf} - Windows Program Files folder, compatible with Win32/64Wow64
This setting is available if TransfMode equals 1 (WM_COPYDATA Mode) or 2 (Clipboard Mode).
Once print job is converted, this message will be sent to your application.
You should specify TagWndTitle and TagWndClass (optional) also, Virtual Printer Driver calls Windows API FindWindow with these settings to decide target window receives the message.
Default value: 32768
This setting is available if TransfMode equals 1 (WM_COPYDATA Mode) or 2 (Clipboard Mode).
Virtual Printer Driver finds target window with this setting.
Default value: "Your Virtual Printer Example Title"
This optional setting is available if TransfMode equals 1 (WM_COPYDATA Mode) or 2 (Clipboard Mode).
Virtual Printer Driver finds target window with this setting.
Default value: ""
This setting is available if TransfMode equals 2 (Clipboard Mode).
Once print job is converted, Virtual Printer Driver places full name of INI file on Clipboard in format specified by this setting, then finds target window and post message to it.
Default value: "Your Virtual Printer Example Clipboard Format"
We provide a GUI tools to help you set TransferMode settings. Please run "Configure driver" shortcut from SDK's program group. See below.
If you select Command Line Parameter mode, just click "Open..." button to choose the target exe will be called after printing.
If you select WM_COPYDATA Message mode, just set "Target Window Class"(optional), "Target Window Title" and "Message ID" options.
If you select Clipboard mode, just set "Target Window Class"(optional), "Target Window Title", "Message ID" and "Clipboard Format" options.
Click Save button to save settings.
To specify output format and options, run "Printer Preferences" shortcut.