Question

I have a question. The problem is that I have another process which invoked ShowDialog() method, I need to close this dialog from another process but I need to close it with returning DialogResult.OK.

So from my .net program(another process) I want to close it successfully. I tried to use winapi to solve this problem, tried EndDialog function, but it returns error that ACCESS_DENIED. Tried to use hooks but those return error_no_token.

I need this to start msi installer silently. I start it with /qn switch, but this damn installer has embedded action that shows dialog in any case. I tried to close this window with sendmessage function, but in this case installer says that it is error, and rolls back the install process. I can fill all the values programmatically and click OK button on the dialog, but it requires to fill ALL THE VALUES, and there are lots of them, so it is time consuming. The purpose of this dialog is to create config file, which I can create manually later, after installation.

Is there any way to accomplish this task?

Was it helpful?

Solution

It sounds like the main issue you are having is doing a end-run around the validation for the text fields. As you said you would be editing the configuration files later just put some dummy values in each box and click the OK the way that causes the validation to happen.

OTHER TIPS

Sometimes you need to change a bad design to remove the need to do a hard task, rather then keep fighting the system.

A UI is owned by one process, and apart from automating tests, should only be changed by that process or the user.

There used to be installer toolkits aims at system admins, that would watch the registry and file system while running a installer and then create a custom MSI file to automate the process. This may be another way for you to go.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top