You have probaly
noticed that if you go into the the
system properties then you can load the
port settings for the LPT and CoM ports.
You can display these properties dialog
boxes by using the ConfigurePort API. For
more information you can subscribe to my
Visual basic journal which will explain
this in much more detail.
Start a new standard-EXE
project and and add a Command button to
form1 and type the following code into
the code window of form1:
Declare Function ConfigurePort _
Lib "winspool.drv" Alias
(ByVal pName As String, ByVal hwnd As
ByVal pPortName As String) As Long
Private Sub Command1_Click()
Run the project
(F5) and click on the command button the
properties for the COM$ and LPT1 ports
will be displayed as well as a message
box that will display 1 ofr success and 0
if an error has occured.