| View previous topic :: View next topic |
| Author |
Message |
corrupt
Joined: 29 Dec 2004 Posts: 2328
|
Posted: Tue Jun 07, 2005 10:07 am Post subject: Get Word Under Mouse (DLL) |
|
|
Here's a function and DLL I put together for retrieving the current word under the mouse in an Edit control. If there is enough interest I may be able to expand functionality to include a few other types of controls.
Download
Updated to version 0.0.2 Beta
- A few bugs squished
- Test script changed to use tooltip to display word
| Code: | ; GetWordUnderMouse Test Script
; only Edit controls currently supported
; --------------------------------------
; Place the mouse over text in an edit control to
; retrieve the current word under the mouse.
; --------------------------------------
#Persistent
; Open this script in notepad for testing...
Run, Notepad %A_ScriptFullPath%
SetTimer, disp, 200
Return
^j::
SetTimer, disp, Off
ToolTip
ExitApp
Return
disp:
delimiter1 = "%A_Space%```(`)`,.`=/\+-*!@#$`%^&*?<>~`;`:`{`}`[`]
word := GetWordUnderMouse(delimiter1)
ToolTip, %word%
Return
GetWordUnderMouse(delim)
{
; delim = character(s) specified to separate words
; if no delimiter character(s) specified then the entire line of text
; under the mouse pointer will be returned.
VarSetCapacity(word, 2048)
RetVal := DllCall("gwrd.dll\GetWord", "str", word, "str", delim, "Uint")
; The DLL returns the handle to the control the mouse is over
Return, %word%
} |
(WARNING - Beta version - Use at your own risk )
Last edited by corrupt on Wed Jun 08, 2005 4:53 am; edited 2 times in total |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10450
|
Posted: Tue Jun 07, 2005 11:13 am Post subject: |
|
|
| Nice! There's also an item on the to-do list to research Active Accessibility, which is said to have the ability to get the text-under-mouse from many different control types. |
|
| Back to top |
|
 |
Jon
Joined: 28 Apr 2004 Posts: 373
|
Posted: Tue Jun 07, 2005 2:54 pm Post subject: |
|
|
| That looks really good corrupt (especially with the deliminators). I can think of quite a few things it will be useful for. Would it be possible to make it work under browser controls i.e Firefox and Internet Explorer? |
|
| Back to top |
|
 |
corrupt
Joined: 29 Dec 2004 Posts: 2328
|
Posted: Wed Jun 08, 2005 4:44 am Post subject: |
|
|
| Jon wrote: | | That looks really good corrupt (especially with the deliminators). I can think of quite a few things it will be useful for. Would it be possible to make it work under browser controls i.e Firefox and Internet Explorer? | Only the address bar in IE so far... |
|
| Back to top |
|
 |
corrupt
Joined: 29 Dec 2004 Posts: 2328
|
Posted: Wed Jun 08, 2005 4:47 am Post subject: |
|
|
| Chris wrote: | | Nice! There's also an item on the to-do list to research Active Accessibility, which is said to have the ability to get the text-under-mouse from many different control types. | Thanks . Interesting. Looks like a bit of light reading . |
|
| Back to top |
|
 |
corrupt
Joined: 29 Dec 2004 Posts: 2328
|
Posted: Wed Jun 08, 2005 4:55 am Post subject: |
|
|
Updated to version 0.0.2 Beta
- A few bugs squished
- Fixed script crash under Win98? |
|
| Back to top |
|
 |
Guest
|
Posted: Fri Jun 10, 2005 9:19 am Post subject: |
|
|
hi, i have a question
how could you create the dll file?
and is there a way to read its source?
thanks |
|
| Back to top |
|
 |
corrupt
Joined: 29 Dec 2004 Posts: 2328
|
Posted: Fri Jun 10, 2005 9:38 am Post subject: |
|
|
| Anonymous wrote: | hi, i have a question
how could you create the dll file? |
I use BCX for creating .DLL files (compiled using Pelles C).
| Anonymous wrote: | and is there a way to read its source?
thanks | Asking the author is the preferred method  |
|
| Back to top |
|
 |
Navid Guest
|
Posted: Wed Sep 14, 2005 2:05 pm Post subject: Can you write the syntax for using this dll in visual basic? |
|
|
I want to use it in VB6.
can you guide me? |
|
| Back to top |
|
 |
savage
Joined: 02 Jul 2004 Posts: 205
|
Posted: Thu Sep 15, 2005 12:44 am Post subject: |
|
|
It should work like using any other dll in vb6. Google is your friend. _________________ <enormous animated gif> |
|
| Back to top |
|
 |
heresy
Joined: 11 Mar 2008 Posts: 131
|
Posted: Wed Apr 16, 2008 7:46 am Post subject: |
|
|
if it's not restricted to specific control type.
i would like to make tooltip dictionary
which gets translated local word for that english word
sigh |
|
| Back to top |
|
 |
corrupt
Joined: 29 Dec 2004 Posts: 2328
|
Posted: Fri Apr 18, 2008 6:58 am Post subject: |
|
|
| heresy wrote: | if it's not restricted to specific control type.
i would like to make tooltip dictionary
which gets translated local word for that english word
sigh | It is currently restricted to Edit based controls (Edit, RichEdit, etc...). Having a look at the example will give you an idea of what might be possible with the current methods used...  |
|
| Back to top |
|
 |
|