LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Evergreen - Windows folder dialog

Hello,

It's a  bit evergreen but Istill haven't figured it out. I would really like to use the native Windows FOLDER dialog since the LabVIEW one is too confusing for the users. All thelinks here on the forum doesn't lead to satisfying results

 

Hasanybody accomplished that? It has to be:

 

Has tobe MODAL

I should be able to set start Path

(Set HeaderString)

(Set type)

(CreateNew Folders)

 

Thanks for any help 

Message Edited by ceties on 04-16-2010 03:56 AM
LV 2011, Win7
0 Kudos
Message 1 of 9
(4,607 Views)
You already have suggested this here and a discussion is going on
0 Kudos
Message 2 of 9
(4,585 Views)
Now I am not asking for change in LabVIEW especially since my wished doesn't seem to be fulfilled any time soon. What I am asking is if somebody made it as far as creating working VIs calling the Win Dlls the way described in the previous post.
LV 2011, Win7
0 Kudos
Message 3 of 9
(4,581 Views)
So this is as far as I got. Mainly by going through the examples posted here at the forum.

Problems 1) I don't know how to specify the start path. Apparently those events play role: BFFM_INITIALIZED, BFFM_SELCHANGED but I have no idea how to handle that
2) The dialog is modal only with respect to the owning/calling VI (or the VI specified by a handle)
3) The dialog consumes too much of CPU power while displayed

Any help would be appreciated.
Message Edited by ceties on 04-16-2010 10:22 AM
LV 2011, Win7
0 Kudos
Message 4 of 9
(4,563 Views)

As far as I know, you have to deal with a callback for the SHBrowseForFolder function. This would be easier to do with a simple wrapper DLL.

 

Or, you could use the .NET method. See attached example. Note that the VI is configured to run in the "User interface" thread.

0 Kudos
Message 5 of 9
(4,547 Views)

Hello Smercurio, thanks for that suggestion. I know the .NET way but that wouldn't work on all of the machines (some of them have W2000 and no .NET). But the suggestion with the wrapper might work. I am just wondering how to make it modal then since the function expects handle of a window. It then becomes modal to it and all my tests showed the window modal only to it but not to the rest of the vis…but I guess I will have to test that.

 

Before I start digging my Visual Basic skills to create such a dll has anybody done that before (dll with the folder dialog)? Thanks

LV 2011, Win7
0 Kudos
Message 6 of 9
(4,532 Views)
Most Windows dialogs are modal to the window handle that is passed as parent. If you pass NULL as handle some are modal to the desktop, meaning anything (but I would be very careful with this. I HATE applications that try to grab the focus like that. A Browse dialog certainly isn't something that should prevent me from changing to a different application, otherwise the software is going to be banned from my machine.) Not sure about the Browse Folder dialog here.
Message Edited by rolfk on 04-18-2010 11:09 AM
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 7 of 9
(4,501 Views)
I agree Rolf, it could even be pretty dangerous - for example when you are running software controlling some machinery. I just meant that I would like to accomplish the normal expected behavior and I had trouble with that regarding the Folder dialog when I was calling it from VI that was set to modal... but I haven't tested it since then.
LV 2011, Win7
0 Kudos
Message 8 of 9
(4,458 Views)
Hi! I took it one step further. I conducted a research on this and there are projects dealing with that in Visual C++. I attach one I found. Would anybody be so kind to create dll from the important function(s) in the project?
Message Edited by ceties on 04-20-2010 09:40 AM
LV 2011, Win7
XBrowseForFolder_demo.zip ‏48 KB
Virus detected! File Removed.
0 Kudos
Message 9 of 9
(4,425 Views)