Private Declare Function ConfigurePort Lib "winspool.drv" Alias "ConfigurePortA" (ByVal pName As String, ByVal hwnd As Long, ByVal pPortName As String) As Long
Private Sub Command1_Click() MsgBox ConfigurePort("", Me.hwnd, "COM4") MsgBox ConfigurePort("", Me.hwnd, "LPT1") End Sub |