We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Sending data to an editor from win forms.

Hi i am trying to send a message to a windows editor(like notepad, wordpad, word etc) whenever i click a button on a windows form.(I am using C#). If i have to use the sendkeys class, how do i make that particular editor an active window while running the form? Thanks for your time.

2 Replies

Prakash S October 19, 2002 06:18 PM UTC

From the Class Library docs on the SendKeys class: Note Because there is no managed method to activate another application, you can either use this class within the current application or use native Windows methods, such as FindWindow and SetForegroundWindow, to force focus on other applications. Will this not work for you? Are there any complications involved that I am missing? Prakash Syncfusion, Inc.

SK Sharath Kumar Gajare October 21, 2002 08:30 AM UTC

Thanks - I got this working using FindWindow/SetForegroundWindow. Actually i was wondering if there was any new method to do this in C#. -Sharath. > From the Class Library docs on the SendKeys class: > > > Note Because there is no managed method to activate another application, you can either use this class within the current application or use native Windows methods, such as FindWindow and SetForegroundWindow, to force focus on other applications. > > > Will this not work for you? Are there any complications involved that I am missing? > > Prakash > Syncfusion, Inc. >
Loader.
Live Chat Icon For mobile
Up arrow icon