(page requirements)

How to bring up the network connections dialog using Win32 API

If you want to give your users the opportunity to connect to network resources from within your program, all you have to do is call the "WNetConnectionDialog()" Win32 API function:
 
WNetConnectionDialog(
  0,
  RESOURCETYPE_DISK );
Listing #1 : Delphi code. Download netdrv (0.18 KB).
 
First parameter is the handle of the parent Window, so if you're calling "WNetConnectionDialog()" from a "form" window, you can pass "Handle" to make the network drives dialog a child window of the form.
 
WNetConnectionDialog(
  Handle,
  RESOURCETYPE_DISK );
Listing #2 : Delphi code. Download netdrv2 (0.19 KB).
 
 
Applicable Keywords : Delphi, Delphi 2.x, Delphi 3.x, Functions, Networking, Win32
 
 
 
Copyright © 2009 Chami.com. All Rights Reserved. | Advertise | Created in HTML Kit editor