how to write a custom control in c# to work with any windows text processor application?
I am trying to write a custom control in c# using windows api which should interact with any windows text based application. for e.g. notepad
I had looked at 开发者_Go百科tinyspell and it works like anything. can any one suggest how to get started?
also if u know how tinyspell would work, plz help me.
u can find tinyspell here http://www.tinyspell.m6.net/
Due to your comments, you are not tring to write a custom control but an application, and C# is not a must. I suggest having a look at Autohotkey or AutoIt V3. I am pretty sure what you want can be done most easily with those scripting languages. And if you really need a C# application, you can use the Dll/Com control AutoItX included in AutoIt.
I certainly agree with Doc Brown's statement that you are talking about writing an application, not a control. Also agree with his statement that you need to provide more information : exactly how does your application interact with these other applications that are handling (we assume) unformatted (one font, one style, one size) text ?
If you must do this in C#, you will need to use something like a "global hook" so the user can at any time, via some special keyboard activity, activate your application; for how to do this in C# see : George Mamaladze's article "Processing Global Mouse and Keyboard Hooks in C#"
That also requires however, that your application be running at all times; normally if you want something running at all times, you might want your application to be a Windows Service. The "nitty gritty" of interacting with any one specific "raw" text-handling application could involve some API stuff, and/or use of the old 'SendKeys, and intimate knowledge of the application : my guess is you are not going to want to "go there."
Most likely you'll want to somehow use the clipboard as the "medium of exchange" between your application (or service) and the other applications. Lots of examples here on SO and on CodeProject about how to use the clipboard in .NET and/or drag and drop of selections in text between apps.
Good luck !
精彩评论