|
tech
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Text From Another (Application) Window...I think this issue has been posted at a number of locations on the internet
but I have yet to find a satisfactory answer. I would like to be able to grab the (selected) text of another application window to use for processing. For example, if I type "ABC" into another window (be it Notepad, Word, or some other application, highlight this text, and then fire my application up, I would like to be able to get the text "ABC" from the other window within my application. I figure this will involve numerous calls to the Win32 API, but I am not sure what functions to call. Any help will be greatly appreciated. Thank you, Jason Richmeier You can use the GetWindowText function (or {Post|Send}Message with
WM_GETTEXT). But, that won't work with Vista's new security schemes. By default an application won't accept messages (GetWindowText just uses the WM_GETTEXT message) from applications or classes of applications it doesn't explicitly give permission to. -- Show quoteHide quoteBrowse http://connect.microsoft.com/VisualStudio/feedback/ and vote. http://www.peterRitchie.com/blog/ Microsoft MVP, Visual Developer - Visual C# "Jason Richmeier" wrote: > I think this issue has been posted at a number of locations on the internet > but I have yet to find a satisfactory answer. > > I would like to be able to grab the (selected) text of another application > window to use for processing. For example, if I type "ABC" into another > window (be it Notepad, Word, or some other application, highlight this text, > and then fire my application up, I would like to be able to get the text > "ABC" from the other window within my application. I figure this will > involve numerous calls to the Win32 API, but I am not sure what functions to > call. > > Any help will be greatly appreciated. > > Thank you, > > Jason Richmeier
For Microsoft Partners and Customers Who Can't Download or Access MSDN2...
Create custom rectangle UI Element Urgent help needed : Strange error !!! Help with VB.NET Combobox Software Design Question: Properties and Functions beginner: weakest sides of .NET? ASP.NET 2.0: Page loaded twice on debug. Detecting .NET Framework 2.0 runtime env. String Comparsion on Different Locale Machine VS 2005 Service Pack 1 - details |
|||||||||||||||||||||||