0
votes

I am writing a C# WinForms application that fills a form automatically on an existing website.

Let's consider http://tinypic.com/ as an example to illustrate my problem.

When the user clicks the Browse button, a file browser dialog opens as a modal dialog. In my case, the modal window is opened from code and I own the form and the WebBrowser control.

How can I access this modal window programmatically and paste/enter my filename into it ?

1
You can use findwindow and sendkey to simulate a user clicking an copy pasting to enter the text. - CodingBarfield
Surely there must be a simpler way as my Form is both the parent and owner of the modal dialog. Right ? - Jelly Ama

1 Answers

-1
votes

I don't know particularly, but I do believe its possible (even if you have to hook the OS)

You might want to check TwebstLib for such functionality