LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

windows network password

Hi there.

I need to read files off a networked machine (using LabVIEW), but trying to open the files fails until I have manually browsed to the networked PC and entered a valid username and password on the dialog that pops up. Is there any way to do this automatically via either some Win32 command or LabVIEW? Both machines are running Win2k, and I am using LabVIEW 7.0 Express

thanks
Neil
0 Kudos
Message 1 of 6
(3,180 Views)
nrp wrote:

> Hi there.
>
> I need to read files off a networked machine (using LabVIEW), but
> trying to open the files fails until I have manually browsed to the
> networked PC and entered a valid username and password on the dialog
> that pops up. Is there any way to do this automatically via either
> some Win32 command or LabVIEW? Both machines are running Win2k, and I
> am using LabVIEW 7.0 Express

Windows API call: mpr.dll
WNetConnectionDialog: simple
WNetConnectionDialog1A: complicated structure parameter not easily done
in LabVIEW itself, so you would need to write a cover DLL.

Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 2 of 6
(3,180 Views)
nrp wrote:

> Hi there.
>
> I need to read files off a networked machine (using LabVIEW), but
> trying to open the files fails until I have manually browsed to the
> networked PC and entered a valid username and password on the dialog
> that pops up. Is there any way to do this automatically via either
> some Win32 command or LabVIEW? Both machines are running Win2k, and I
> am using LabVIEW 7.0 Express

More possible functions:

WNetAddConnection[2][3]A
WNetUseConnectionA

Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 3 of 6
(3,180 Views)
Rolf,

thanks for your reply. I think the WNetConnectionDialog API function is exactly what I need, but it needs a handle to the owner window as an input parameter, and I have no idea how to obtain this via labview (another Win32 function I suppose???)

Neil
0 Kudos
Message 4 of 6
(3,180 Views)
Neil,

You can use GetActiveWindow (user23.dll, no inputs needed). You can also use
FindChild, but it's more difficult. I suppose the OpenG toolkit has
functions for this too.

Regards,

Wiebe.

"nrp" wrote in message
news:506500000005000000AFB40100-1079395200000@exchange.ni.com...
> Rolf,
>
> thanks for your reply. I think the WNetConnectionDialog API function
> is exactly what I need, but it needs a handle to the owner window as
> an input parameter, and I have no idea how to obtain this via labview
> (another Win32 function I suppose???)
>
> Neil
0 Kudos
Message 5 of 6
(3,180 Views)
nrp wrote:
> Rolf,
>
> thanks for your reply. I think the WNetConnectionDialog API function
> is exactly what I need, but it needs a handle to the owner window as
> an input parameter, and I have no idea how to obtain this via labview
> (another Win32 function I suppose???)

Search on the Developer Exchange for windows API utility or go directly to

http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B45EACE3EF4556A4E034080020E74861&p_node=ZONE&p_source=external

There are functions to retrieve the Windows handle of a window by name.
Bascially you query the Title of a VI through a VI property node and
pass that to the Get Window Handle.vi or similar function. The returned
int32 is the actual window handle.

Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 6 of 6
(3,180 Views)