Quote Originally Posted by DrUnicode View Post
There is an API that finds the first character from cursor.
From there you should be able to search forward to get the word.
Code:
Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByRef lParam As Any) As Long

Private Type POINTAPI
	x As Long
	y As Long
End Type

Private Const EM_CHARFROMPOS As Long = &HD7

Function CharFromPos(ByVal hWnd As Long, ByVal xPixels As Long, ByVal yPixels As Long) As Long
   Dim tP As POINTAPI
   tP.X = xPixels
   tP.Y = yPixels
   CharFromPos = SendMessage(hWnd, EM_CHARFROMPOS, 0, tP)
End Property

This work for RichTextBox not TextBox, beside it doesn't help to get the word under the cursor because it just return the cursor position inside the RichTextBox, it is simulate RichTextBox1.SelStart