Jump to content

SplQueryControlPanel: Difference between revisions

From EDM2
Created page with "This function queries a specific control panel DLL for support for the printer attached to the given port. == Syntax == SplQueryControlPanel(pszComputerName, pszPor..."
 
Ak120 (talk | contribs)
mNo edit summary
 
Line 1: Line 1:
This function queries a specific control panel DLL for support for the printer attached to the given port.  
This function queries a specific control panel DLL for support for the printer attached to the given port.
 
== Syntax ==  
== Syntax ==  
  SplQueryControlPanel(pszComputerName,
SplQueryControlPanel(pszComputerName, pszPortName, pszDeviceID,
      pszPortName, pszDeviceID, pszControlPanel,
                      pszControlPanel, flCapabilities, pulOptions)
      flCapabilities, pulOptions);


== Parameters ==
== Parameters ==
; pszComputerName (PSZ) - input  
;pszComputerName (PSZ) - input: Name of computer connected to the printer port.
: Name of computer connected to the printer port.  
:This parameter is NULL for printers whose port exists on the current machine.  
 
;pszPortName (PSZ) - input: Printer port name.
: This parameter is NULL for printers whose port exists on the current machine.  
:The name of the printer port in pszComputerName used to determine if a control panel can be displayed. Following is an example of a port name: <tt>LPT1</tt>
 
:This will be a locally defined port name.
; pszPortName (PSZ) - input  
;pszDeviceID (PSZ) - input: Device ID, if known, for the printer connected to pszPortName.
: Printer port name.  
;pszControlPanel (PSZ) - input: Name of control panel to call to query support for this printer.
 
:This name can be one of the following:
: The name of the printer port in pszComputerName used to determine if a control panel can be displayed. Following is an example of a port name:  
:*The name registered with SplRegisterControlPanel
  LPT1  
:*One of the control panel names returned by [[SplGetControlPanelList]]
 
:This parameter can be used to determine the type of support given by a control panel in the list.
:This will be a locally defined port name.  
;flCapabilities (ULONG) - input: Capabilities requested.
 
::FL_ADMIN - 0x00000001: Set if an administrator wants the control panel.
; pszDeviceID (PSZ) - input  
;pulOptions (PULONG) - output:Option value returned by the control panel DLL.
: Device ID, if known, for the printer connected to pszPortName.  
:Values are as follows:
 
::OPT_CUSTOM(2) A control panel for the specific device is available.
; pszControlPanel (PSZ) - input  
::OPT_GENERIC(1) A generic control panel can be displayed for the printer.
: Name of control panel to call to query support for this printer.  
 
: This name can be one of the following:  
:*The name registered with SplRegisterControlPanel  
:*One of the control panel names returned by SplGetControlPanelList  
 
:This parameter can be used to determine the type of support given by a control panel in the list.  
 
; flCapabilities (ULONG) - input  
: Capabilities requested.  
 
 
:;FL_ADMIN - 0x00000001  
::Set if an administrator wants the control panel.  
 
;pulOptions (PULONG) - output  
:Option value returned by the control panel DLL.  
 
:Values are as follows:  
 
;:OPT_CUSTOM(2)  
::A control panel for the specific device is available.  
 
:;OPT_GENERIC(1)  
::A generic control panel can be displayed for the printer.  


== Returns ==
== Returns ==
; rc (ULONG) - returns : Return codes.  
;rc (ULONG) - returns : Return codes.
 
*0 Success
*0 Success  
*ERROR_INVALID_NAME(123) pszName is not the name of a control panel DLL.  
 
*ERROR_NOT_SUPPORTED(50) A control panel for this printer is not supported by the called control panel DLL.
*ERROR_INVALID_NAME(123)  
:pszName is not the name of a control panel DLL.  
 
*ERROR_NOT_SUPPORTED(50)  
:A control panel for this printer is not supported by the called control panel DLL.  
 
 
== Sample ==
<pre>
#define INCL_SPL
#define INCL_SPLBIDI
#include <os2.h>
 
PSZ      pszComputerName;  /*  Name of computer connected to the printer port. */
PSZ      pszPortName;      /*  Printer port name. */
PSZ      pszDeviceID;      /*  Device ID, if known, for the printer connected to pszPortName. */
PSZ      pszControlPanel;  /*  Name of control panel to call to query support for this printer. */
ULONG    flCapabilities;  /*  Capabilities requested. */
PULONG    pulOptions;      /*  Option value returned by the control panel DLL. */
ULONG    rc;              /*  Return codes. */
 
rc = SplQueryControlPanel(pszComputerName,
      pszPortName, pszDeviceID, pszControlPanel,
      flCapabilities, pulOptions);


</pre>
[[Category:Spl]]
[[Category:Spl]]

Latest revision as of 18:16, 6 March 2020

This function queries a specific control panel DLL for support for the printer attached to the given port.

Syntax

SplQueryControlPanel(pszComputerName, pszPortName, pszDeviceID,
                     pszControlPanel, flCapabilities, pulOptions)

Parameters

pszComputerName (PSZ) - input
Name of computer connected to the printer port.
This parameter is NULL for printers whose port exists on the current machine.
pszPortName (PSZ) - input
Printer port name.
The name of the printer port in pszComputerName used to determine if a control panel can be displayed. Following is an example of a port name: LPT1
This will be a locally defined port name.
pszDeviceID (PSZ) - input
Device ID, if known, for the printer connected to pszPortName.
pszControlPanel (PSZ) - input
Name of control panel to call to query support for this printer.
This name can be one of the following:
  • The name registered with SplRegisterControlPanel
  • One of the control panel names returned by SplGetControlPanelList
This parameter can be used to determine the type of support given by a control panel in the list.
flCapabilities (ULONG) - input
Capabilities requested.
FL_ADMIN - 0x00000001: Set if an administrator wants the control panel.
pulOptions (PULONG) - output
Option value returned by the control panel DLL.
Values are as follows:
OPT_CUSTOM(2) A control panel for the specific device is available.
OPT_GENERIC(1) A generic control panel can be displayed for the printer.

Returns

rc (ULONG) - returns
Return codes.
  • 0 Success
  • ERROR_INVALID_NAME(123) pszName is not the name of a control panel DLL.
  • ERROR_NOT_SUPPORTED(50) A control panel for this printer is not supported by the called control panel DLL.