Jump to content

File Dialog - How can I remove "All files" pattern


daal

Recommended Posts

How can I remove "All files" pattern in File Dialog

If you're asking about 8.2, I can't help you. If you're asking about 7, just wire your desired pattern (i.e. *.txt) as a text string into the Pattern input terminal on the file dialog primative (lower left corner).

Gary

Link to comment
If you're asking about 8.2, I can't help you. If you're asking about 7, just wire your desired pattern (i.e. *.txt) as a text string into the Pattern input terminal on the file dialog primative (lower left corner).

Gary

Yes it's about 8.2. When I put *.txt in the Pattern terminal the *.txt is added but *.* is still there as other pattern.

Dany

Link to comment
Yes it's about 8.2. When I put *.txt in the Pattern terminal the *.txt is added but *.* is still there as other pattern.

Dany

Unfortunately this is typical behavior of a file dialog box in Windows.

Labview appears to only access the standard file dialog. When using things

such as the Visual Studio environments, the "All Files" can be removed as you

have access to more lower level functions.

Link to comment
Unfortunately this is typical behavior of a file dialog box in Windows.

Labview appears to only access the standard file dialog. When using things

such as the Visual Studio environments, the "All Files" can be removed as you

have access to more lower level functions.

I think there is a way to bypass the windows dialog. There is as far as I know an option to use a crossplatform file-dialog, I suppose this one don't have that option. Another thing would be looking for a .NET class that will handle the case.

Unfortunately I can't test it right now because I'm uninstalling 8.0 and installing 8.2

[Edit:]Found it, it is an option in Tools>Options>Envirenment>Use native File dialogs[/edit]

Ton

Link to comment
I think there is a way to bypass the windows dialog. There is as far as I know an option to use a crossplatform file-dialog, I suppose this one don't have that option. Another thing would be looking for a .NET class that will handle the case.

Unfortunately I can't test it right now because I'm uninstalling 8.0 and installing 8.2

[Edit:]Found it, it is an option in Tools>Options>Envirenment>Use native File dialogs[/edit]

Ton

I tried the LV file-Dialog with Native File Dialog to false in the INI file but it look not very standard. I want to create an application that look professional and integrated in windows.

For the dotNet option, I dont want to install the dotNET framework on the 35 PCs that have already the application.

The only choice is to create a clone of the NativeWindows File Dialog coded in LabVIEW ... A lot of work :headbang: and a very short time. :blink:

Link to comment
Unfortunately I can't test it right now because I'm uninstalling 8.0 and installing 8.2

[Edit:]Found it, it is an option in Tools>Options>Envirenment>Use native File dialogs[/edit]

Ton

I'm just curious to why you are uninstalling 8.0. The ability to have several LV versions and change between them at will, is probably one of the really strong things about LV. I have 6.1, 7.0, 7.1.1, 8.0.1 and 8.2 on the same PC.

Link to comment
I'm just curious to why you are uninstalling 8.0. The ability to have several LV versions and change between them at will, is probably one of the really strong things about LV. I have 6.1, 7.0, 7.1.1, 8.0.1 and 8.2 on the same PC.

My private laptop is kind of limited of diskspace (and at work I have complete set of 7.0 throught 8.2)

7.1 is very usefull when you are using scripting.

Ton

Link to comment
How can I remove "All files" pattern in File Dialog

Hi,

take a look at

http://www.vi-lib.com/user.lib/OpenFileDialogBox.html

this worked for me

Good luck,

TNT

EDIT: the only problem I have is that I want to pass the owner to the dialogbox,

because otherwise the vi could appear on top of the dialogbox and not always on top...

This means a labview windowhandle is needed of the type Iwin32window (.NET)

and I haven't figured out yet how to accomplish this

Link to comment
Why do you want to remove the *.* file pattern?

In my case it's a security issue (exe can be executed by the file dialog), but after some test even when you remove the *.* from the file pattern, you can type it by your self and got all the file listed :(

The only way is to create my own File Dialog

Thank you for your help

Have a nice labor day

Dany :)

Link to comment
In my case it's a security issue (exe can be executed by the file dialog), but after some test even when you remove the *.* from the file pattern, you can type it by your self and got all the file listed :(

Hi Dany,

in my opinion a user who knows how to execute an executable from the file browser knows how to run an executable in another way. Or are you disabling the windows key, ctrl-alt-del, ctrl-esc? Might it be possible to create a user account with almost no rights just to run your program? Maybe you can use the .net browser and run that one as a low-righted user?

Ton

Link to comment
Hi Dany,

in my opinion a user who knows how to execute an executable from the file browser knows how to run an executable in another way. Or are you disabling the windows key, ctrl-alt-del, ctrl-esc? Might it be possible to create a user account with almost no rights just to run your program? Maybe you can use the .net browser and run that one as a low-righted user?

Ton

I used a simple stategy to lock the user from executing other executable. I start my app at startup and I kill explorer.exe and for the operator account I restrict the acces to taskmgr.exe to be executed. That way you can't execute any other EXE and only if you don't have any File Dialog used in your App.

Dany

Link to comment
I used a simple stategy to lock the user from executing other executable. I start my app at startup and I kill explorer.exe and for the operator account I restrict the acces to taskmgr.exe to be executed. That way you can't execute any other EXE and only if you don't have any File Dialog used in your App.

Dany

You could also configure the policies (or other config info, idon't remember the exact details) on your system to start your app instead of the explorer.exe. This can be configured by users and groups. I don't have all the info needed to achieve it. An experienced IT admin or tech should know how to, idf you have one available to consult.

Link to comment

Download File:post-3482-1157995331.vi

Hi,

take a look at

http://www.vi-lib.com/user.lib/OpenFileDialogBox.html

this worked for me

Good luck,

TNT

EDIT: the only problem I have is that I want to pass the owner to the dialogbox,

because otherwise the vi could appear on top of the dialogbox and not always on top...

This means a labview windowhandle is needed of the type Iwin32window (.NET)

and I haven't figured out yet how to accomplish this

I used the code at the above URL to make a VI using .NET that allows for inputs of

Initial Directory, Filters, FilterIndex and Multiselect options (of course Error In)

The outputs consist of an array of filenames and the dialog status (OK or Cancel) and Error Out.

Hopefully this will be useful to you. You can change the default All Files to Text Files easily enough.

The VI is attached.

Eric

Link to comment
  • 5 years later...

I think there is a way to bypass the windows dialog. There is as far as I know an option to use a crossplatform file-dialog, I suppose this one don't have that option. Another thing would be looking for a .NET class that will handle the case.

Unfortunately I can't test it right now because I'm uninstalling 8.0 and installing 8.2

[Edit:]Found it, it is an option in Tools>Options>Envirenment>Use native File dialogs[/edit]

Ton

Hi I have version 2010 and I cannot find it in Tools>Options>Envirenment>Use native File dialogs

Do you know how to do it in version 2010?

Tx,

Fabio

Link to comment

Removing the "*.*" option will not remove the user's ability to show all files, and execute potentially unsafe programs. Just try entering "*" in any file dialog, and you'll all the files, no matter what the currently selected filter is.

What you really want, is a way to lock down program execution on Windows. That is actually possible. It seems to be called Software Restriction Policy (SRP). Read about it on, for example, MS Technet.

Link to comment

Removing the "*.*" option will not remove the user's ability to show all files, and execute potentially unsafe programs. Just try entering "*" in any file dialog, and you'll all the files, no matter what the currently selected filter is.

What you really want, is a way to lock down program execution on Windows. That is actually possible. It seems to be called Software Restriction Policy (SRP). Read about it on, for example, MS Technet.

Tx I will give it a try!

Link to comment
  • 8 months later...

It has been a while since this topic was active. I have a similar issue where I'm using the file dialog (express VI) in LV 2012 and I want to limit the user to selecting a *ini file type. If they choose a different file type, it will cause an error in the program. Has anyone come up with a good solution for this? Is there a better way to do this in 2012?

Link to comment

If it's just the file type, put the file dialog express VI in a loop and check for a valid extension.

I believe the original problem was that, once the file dialog was open, another pattern could be selected - which allows a user to double-click on an .exe file. In 2012, you can right-click on another file and select "open", and it will execute after the file dialog is done.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.