AddPort

機能
サポートされたポートのリストにポート名を追加する
Declare Function AddPort Lib "winspool.drv" Alias "AddPortA" _
(ByVal pName As String, ByVal hWnd As Long, ByVal pMonitorName As String) As Long
Declare Function AddPort Lib "winspool.drv" Alias "AddPortA" _
(ByVal pName As String, ByVal hWnd As Integer, ByVal pMonitorName As String) As Integer

BOOL AddPort(
LPTSTR pName,
HWND hWnd,
LPTSTR pMonitorName
);

引数
pName

プリントサーバー名(ローカルプリンタのときVbNullString)
hWnd
ダイアログボックスの親ウィンドウ
pMonitorName
モニタ名
戻り値
正常終了のとき       0以外
中止のとき           0
備考
ポート名を追加する場合は、あらかじめEnumPorts()関数を使用して既存のポート名を調べる。