PrintCtrl
int PrintCtrl (int panelHandle, int controlID, char filename[], int scaling, int confirmDialogBox);
Purpose
Prints the selected control.
While this function is printing, it blocks any other thread in your program that attempts to print.
Remember that LabWindows/CVI maintains only one copy of the print attributes you set with SetPrintAttribute. Thus, when you change a print attribute in one thread, the change affects printing functions you subsequently call in other threads.
Supported Controls
You can use PrintCtrl with all LabWindows/CVI user interface controls.
Parameters
Input | ||||
Name | Type | Description | ||
panelHandle | int | Specifier for a particular panel that is currently in memory. You can obtain this handle from functions such as LoadPanel and NewPanel. | ||
controlID | int | The defined constant, located in the .uir header file, that you assigned to the control in the User Interface Editor, or the ID returned by functions such as NewCtrl and DuplicateCtrl. | ||
filename | char [] | Name of the output file. If the name is not empty, the output is redirected to the file. If the name is not a complete pathname, the file is created relative to the current working directory. The format of the generated output file depends on the printer driver. This obsolete parameter is only for backwards compatibility. |
||
scaling | int | Selects the scaling mode for printing. Specify a nonzero value or select full size in the function panel to expand the object to full size. Specify 0 or select size to screen in the function panel to print the object at the same relative location and size on paper as displayed on the screen.
|
||
confirmDialogBox | int | Determines whether to display a dialog box before printing to confirm print attributes. This dialog box shows the current print attribute values and to what extent the current printer supports them. The user can change the attribute values during run time. Specify a nonzero value or select show in the function panel to display the dialog box. Specify 0 or select hide in the function panel to omit the dialog box. |
Return Value
Name | Type | Description | ||||||||||||||||||||||||
printStatus | int | The status of the print operation. The PrintCtrl function returns a value that contains bit-fields.
A negative value indicates that an error occurred. |
Additional Information
Library: User Interface Library
Include file: userint.h
LabWindows/CVI compatibility: LabWindows/CVI 3.0 and later
Example
Refer to userint\custctrl\cviogl\ogldemo.cws for an example of using the PrintCtrl function.