ClosePort

BOOL ClosePort(
     HANDLE  hPort
);
 

Closes a previously-opened port when no printers are connected to the port.

Returns TRUE if the operation is successful.

hPort The handle of a port previously opened by a call to the OpenPort function.

The ClosePort function is called by the spooler to enable your monitor to clean up any resources, such as data structures, that are associated with one of the ports your port monitor is maintaining.