Export (0) Print
Expand All

ConfigurePort function

The ConfigurePort function displays the port-configuration dialog box for a port on the specified server.

Syntax


BOOL ConfigurePort(
  _In_  LPTSTR pName,
  _In_  HWND hWnd,
  _In_  LPTSTR pPortName
);

Parameters

pName [in]

Pointer to a null-terminated string that specifies the name of the server on which the specified port exists. If this parameter is NULL, the port is local.

hWnd [in]

Handle to the parent window of the port-configuration dialog box.

pPortName [in]

Pointer to a null-terminated string that specifies the name of the port to be configured.

Return value

If the function succeeds, the return value is a nonzero value.

If the function fails, the return value is zero.

Remarks

Note  This is a blocking or synchronous function and might not return immediately. How quickly this function returns depends on run-time factors such as network status, print server configuration, and printer driver implementation—factors that are difficult to predict when writing an application. Calling this function from a thread that manages interaction with the user interface could make the application appear to be unresponsive.

Before calling the ConfigurePort function, an application should call the EnumPorts function to determine valid port names.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Winspool.h (include Windows.h)

Library

Winspool.lib

DLL

Winspool.drv

Unicode and ANSI names

ConfigurePortW (Unicode) and ConfigurePortA (ANSI)

See also

Printing
Print Spooler API Functions
EnumPorts

 

 

Community Additions

ADD
Show:
© 2014 Microsoft