Prevent user from manipulating folders from 'save file' dialog - c

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.
Also for those who don't know most things that can be done in Windows, i.e. calls to strcpy, GetLastError() and etc., can be called from LabWindows.
Any suggestions would be appreciated.
Thanks

Related

using protractor to do selenium automation test with windows upload file popup

Right now, i am doing an UIveri5 automation test. when clicking the button, windows file system dialog pop up, i would like to know how can i input the file that i want to upload and click the upload button to go back to the web page.
I have try the ways here, but all the ways didn't work. if someone know about this situation, please give me some advises, thanks a lot.
File upload is handled by the selenium/webdiver and happens the same way in every selenium-based framework - locate the input of type file and enter the path to the file. Then click the submit button.
You can use uiveri5 control locators to find the upload control and just chain with by.css('input[type="file"]) to locate the input. Locate the submit button in a similar way.

Form.Close isnt working in Windows CE 7

I have windows application that used to run on a Motorola Scanner that used Windows Mobile 6.1. We upgraded the scanner to a newer model which uses Window CE 7. The application has a login form and a main form. One the user is authenticated, the login form closes and the main form opens up as expected but whenever a date is changed on the main form , the login screen reappears. Its as though login.Close() isn't really closing the login form but actually pushing it to the background and its reappearing. This application used to work fine in the older scan gun. I tried searching for specific issues but to no use.
I am not sure this is what you are looking for but you can try to set the minimizebox property to false on the form as winmobile tends to not close application but send them to background instead. With that property to false, it will close it. Although it would be interesting to see your code because calling the close() statement on the form should close it...

Getting IE Browser to open the File

I embed the default Internet Explorer in my win32-C Application via COM/OLE.
I display a web page having a link (anchor tag) to save/open a file.
When i click on the link, It does some processing in the background but does not give me a dialog box asking to save or open the file. From Fiddler I come to know that it is writing to the cache but not able to access it or show any popup.
I expect to see the dialog box asking me to either save or open the file (default)
If i do this from the IE browser then everything works fine.
EDIT : I tried a sample code in which I do get to see the Dialog Box providing me with the option of saving, opening the file although tallied everything with my code I still fail to see the box.
I was thinking of the Modeless Dialog Box issue but I can see a Message Box in my code. So modeless dialog box is not disabled.
Not able to get how to get it to work.
(Note: Please see the attached images)
EDIT: I edited the The EmbedBrowser Function in my code, my browser was not given a pointer to my IOleClientSite object
New Code :- http://paste.ubuntu.com/1062010/
But problem persists!
I figured out the issue.
The interface DWebBrowserEvents2's invoke method was implemented to not display the File download Box while downloading.
Modified it to allow the same.

How can I make a url embedded in the about dialog box appear as a hyperlink? (resource script .rc)

I have an application written in c that has no dialog box.
However, when you right click the icon you get a floating menu and from there you can choose the about option. This will open an about dialog box. I have inside a link to some webpage, that can be pressed- that will open a browser and navigate to the URL. However, I am unable to make that URL appear as a hyperlink (all that GUI related work is done via the resource .rc file only).
Does anyone know how to color that link in blue and underline to make it appear as a hyperlink through resource script only?
Thank you
I haven't tried this myself but it looks like you can use the CONTROL statement in the resource script to include the SysLink class (which requires common controls v6/Win XP, and will therefore mean you also need a manifest in your application). For more details see http://msdn.microsoft.com/en-us/library/bb760706%28VS.85%29.aspx.
However, you will need to handle the notification from the SysLink control in order to launch the browser and you would need to call InitCommonControlsEx() before the dialog resource is used. That might stop all your GUI work being done by the rc file.
Another alternative would be to register a new window class, subclass from the SysLink control and customise the window message that would normally send the click notification to the parent in order to launch the browser. You could then use your custom class name in a CONTROL statement in the rc file. You still have more work to do but all the GUI handling would be done for you.

Open print dialog in Silverlight after callback returns

I have a Silverlight app that gets a unique sequence # back from a WCF call to a db. From there I wanted to pass that into a printing function that opens the print dialog. But the problem is that I get a security exception if I call the open print dialog from the WCF call back (the dialog can only be opened from user click event).
I thought that perhaps a while loop in the click event but that doesn't seem to help.
Any ideas how to deal with this?
As you stated, "the dialog can only be opened from user click event".
All the dialog security measures are intended to protect against malicous use of Silverlight. You should not be able to circumvent it. Sorry.
Would your design allow you to request the code earlier and then have the user click a button to activate the printing?

Resources