I'm trying to figure out how to launch a specific page/form in an Access project from a winforms app. Basically I'm trying to link the two applications via hyperlink or button or whatever (clicking on a button from a winforms form should take the user to that specific form in the access project). Is this possible?
You can launch MSAccess using Process Class
and
Open a Page/Form in MSAccess using Command-Line switches in Microsoft Access
to achieve your task you need to Create Macros in MSAccess to Open the specified page/form depend on your needs. you can call the Macro by specifying some parameters. here you need to use /Excl to open the database exclusively and /X to run the Macro.
a sample workaround is here
Process access = new Process();
access.StartInfo.FileName = "msaccess.exe";
access.StartInfo.Arguments = #"e:\test.mdb /Excl /X Macro1";
access.Start();
hope this helps
Related
I am trying to auto schedule a GUI-based application (brokerage platform) in windows 10 using Task Scheduler. I need some help with writing the batch file (which I will auto schedule in the Task Scheduler later). I am able to fire up the application ....but how do I pass the username and password to the application in the batch file so the application starts on its own without user intervention? The application when started pops up a GUI window with the username and password fields.
I have tried some windows utilities and writing a batch file....but can't get it to work.
One approach is to see if the application can accept parameters from the command line - yes, even if it is a GUI application.
A couple of approaches:
- Check the documentation (obviously)
- From the command prompt type "appname /?" and see if it responds with some information about the parameters that it accepts. If you are lucky, this will include username and password.
Otherwise you will really need to find out what methods the application supports to authenticate the user.
Scripting may be helpful after you find out that information.
I have requirement of opening share point URL and it looks for credential through windows authentication. So I read some where to use AutoIt with seleniun webdriver but how we can call this AutoIt script because my web driver script will wait until window dialogue is get off. So cursor will not go to next line to execute AutoIT script and finally we will not be able run our script.
Not sure if you are using Java or C#. In C#, I would go with MSUIA. Write a method to deal with the Windows dialogues and run it on a separate thread. This method should act as a listener to the Desktop tree and whenever encounters a control that it needs to work on, does its job. Have the method scan the Desktop tree once every 5 seconds or so and put it to sleep if no object is found.
In Java, using AutoIt should do the trick, not that it won't in C#
http://www.toolsqa.com/selenium-webdriver/autoit-selenium-webdriver/
Is there any way I can restrict a user to select files from only a particular directory in C#? It should not be allowed to browse other folders.
Not possible with the standard .NET wrappers. Reject the path with the FileOk event.
If you can count on your program running on Vista and up then you could consider using the CommonFileDialog class in the Windows API Code Pack. It has a FolderChanging event that can be canceled.
You can't do it from the application. It can be however done using user management on the OS.
I've been trying to create a WPF application which will be a proactive filter trying to limit user activity. I've controlled mouse and keyboard through Win32 API. Now another requirement is to let the user open every other application/file through the WPF one.
I don't want to disable the user's clicking ability while he's inside a process. I've tried to disable file access but with no luck.
I have control over the user while launching a new process but what if he opens a file within the process?
Can I just disable 'New' and 'Open' options or the complete file menu in any other process like Microsoft Word?
You can try this. But the problem is, that this just tells what files are currently being accessed by the given process. So you can maybe kill the process in that moment:D Or warn the user. But as far as i know, you cannot create a semi-layer between another process and his system requests (like is the file [read/write] access request).
EDIT: Maybe there is another option. If these restricted files are known to you, and there is just small amount of them... then you can just lock them for your process and disable access to them for every other processes.
I have a WPF application that is designed for a touchscreen kiosk. Users will not have access to a keyboard or mouse. The application runs fine when started normally from the program icon in windows. However, when it is set up to run automatically at startup (by replacing the Windows shell using a registry key), the application does not function properly.
The application reads an XML file that lists available videos, then displays buttons to show the videos. When run in "kiosk mode," it does not seem to have access to the files in its media directory (the XML file and presumably the videos as well). I suspect that because the application is running in place of the windows explorer, it is missing resources it needs for file access that are normally loaded by windows explorer.
I have not been able to find any info on this - there is plenty of info on how to get an app to run at startup, but not much on how to make sure it will actually function in that environment. The PC is running Windows 7 Professional.
Is my assumption about the problem correct, or is it likely something else (e.g. permissions - we checked the permissions, but maybe they operate differently when you replace the windows shell?) If it is because needed resources are not loaded, does anyone have pointers on how to make sure my app loads them?
Perhaps you have file access occurring via a file dialog? This might explain a bit further. What is the minimum functionality needed to create Shell Replacement for Windows?
because you have stopped windows default running explorer.exe , your program can not get access to default xml directory therefore you should specify the complete path for example like below:
stream = File.Open(#"C:\x86\Debug\xml.xml", FileMode.OpenOrCreate);