views:

170

answers:

1

I am using WatiN to script actions in Internet Explorer that run in the background of the user's machine. (I know...hacky). I am able through WatiN to make the Internet Explorer window not show. However, during my script, some HTML dialogs are opened. I am able to hide them using the P-Invoke ShowWindow in User32.dll, but they still appear for a second or so while I find the HWnd for the dialog. My question is:

Is there a way to stop a process from showing any windows?

Thanks

A: 

I'm assuming you tried the AutoCloseDialogs property on the IE object's Settings property in WatiN?

One option would be to run the whole thing under a different user account. I'm not sure what is invoking WatiN but the CreateProcessAsUser Windows API will, by default, put whatever processes it create's in a separate interactive desktop i.e. not the current user's one. This blog post has some info on calling CreateProcessAsUser from .net.

d4nt