LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Prevent right click on save as dialog

I have an application in Labwindows that when a user clicks on a button, 'Save data', the button launches a file selection dialog box. For security reasons I want to disable the user from right clicking any where on the 'file selection dialog box' and being able to delete/rename existing files and/or create/delete existing folders/directories.

 

This can be done in windows with keyboard hook but thought there might be something easier in Labwindows. I have already tried setting the allowMakeDirectory attribute to 0 but this did nothing and the 'FileSelectPopupEx' function does not have an 'allowMakeDirectory' attribute to set.

 

I'm developing on windows7 and running the app on Vista.

 

Any suggestions would be appreciated.

 

Thanks

0 Kudos
Message 1 of 7
(4,800 Views)

Additonaly note: Is there anyway to trap mouse clicks/events once a call to 'FileSelectPopup' has been launched? If I could trap the right mouse click and/or key events I might be able to accomplish what I need.

0 Kudos
Message 2 of 7
(4,775 Views)

I don't think it's possible to customize FileSelectPopup function: as far as I remember, it is calling some OS API function and its behaviour is not under CVI control.

As an alternative, you may try looking at the FileBrowser instrument offered by CVI: it's located in <cvidir>\toolslib\cutsctrl folder. The instrument permits to navigate into local resources and select files, but does not include the ability to create files and folders, unless you explicitly add an item to its context menu.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 3 of 7
(4,753 Views)

Is there anyway to set user access/rights overall on the application dependent if the user is admin/user/guest?

 

Thanks

0 Kudos
Message 4 of 7
(4,725 Views)

Hi atomic928,

 

I don't know of a CVI-specific way of doing this, but I would suggest looking into the Windows API for functions that return system information.  The GetUserName function from Advapi32.dll might be a good place to start.

 

-Myriam

0 Kudos
Message 5 of 7
(4,699 Views)

Is this question somewhat related to the original one? 'Cause I cannot succeed in finding a connection...



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 6 of 7
(4,692 Views)
Yes another parameter of my application is that only administrators can alter files/directories so if I could determine what rights a user has signed in as I could set the rights to the application.
0 Kudos
Message 7 of 7
(4,679 Views)