Can I get word under mouse in any program in C# app?
2006-11-08 21:17
609 查看
Can I get word under mouse in any program in C# app?
Void A state of nonexistence |
|
|
in a texbox for examle, handle the MouseHover Event, and then you might have to find a way to get the x y co-ordinates, and the then the word location and copy it to clipboard or select it |
|
You can use TextBox.GetCharIndexFromPosition to get the index the mouse is over, then search backwards and forwards from that index for word boundaries and you'll have your word. |
|
I’ve not tried it in C# yet, but I have an article in Delphi that shows you how to hook your code to global mouse events. It is not Delphi specific in the sense that you use Windows API calls to do the hook. On the fact about how to get the text from the textbox (you get the window handle through the hook call-back) displaying the text you want is a thing I would very much like to know myself. But, should you be able to find the “class” of the “textbox” window does not mean that the text displayed on the screen is made public via some method or property (it could be a custom “textbox” drawn by the application it self displaying text from a private property/method). |
相关文章推荐
- Get Selected Radio button’s Text in C# windows app
- C# 解决InvalidProgramException: Invalid IL code in System.Data.DataTable:get_Columns (): IL_0000: ret
- Get program files folder in C#
- (HTTP) Streaming a video using a program in C/C++ under Linux(轉載)
- how to get domain user info from AD in C#
- Using Settings in C# 在C#中使用APP.CONFIG配置文件
- How to make Windows Form app truly Full Screen (and to hide Taskbar) in C#? 转
- Processing Global Mouse and Keyboard Hooks in C#
- Get Volume Serial Number in C#
- C#调用VC的DLL时AfxGetApp失败的解决方法
- Xcode The ‘in-app purchase’ feature is only available to users enrolled in apple developer program
- ios 提交 App Store Error Problem with Icon.png (Icon specified in the Info.plist not found under the t
- iOS Programming 101: How To Get the User Location in iPhone App
- Processing Global Mouse and Keyboard Hooks in C#
- Code snippet of the day : Get Chinese Spell in C#
- Get the SharePoint groups in Infopath 2010 and SharePoint 2010 by current user without any code
- How to get Intellisense for Web.config and App.config in Visual Studio .NET?(转载)
- Get Sender Email Address from Outlook using CDO in C#
- Hello Word Outlook Add-In using C#
- ORACLE中IN和OR谁更高效?【WHICH KEY WORD CAN GET BETTER PERFORMANCE? 】 推荐