Results 1 to 13 of 13

Thread: (Resolved by Serge) Gurus - Em_CharFromPos

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member TiPeRa's Avatar
    Join Date
    Apr 2001
    Location
    In between
    Posts
    464

    (Resolved by Serge) Gurus - Em_CharFromPos

    Is EM_CHARFROMPOS available in Windows 2000? I am using this code:
    VB Code:
    1. Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
    2. Private Const EM_CHARFROMPOS& = &HD7
    3. Public Type POINTAPI
    4.         x As Long
    5.         y As Long
    6. End Type
    7. Public Function WordUnderCursor(txtBox As TextBox, x As Single, y As Single) As String
    8.     Dim mPosAs POINTAPI
    9.     Dim cPos As Integer
    10.     mPos.x = x / Screen.TwipsPerPixelX
    11.     mPos.y = y / Screen.TwipsPerPixelY
    12.     cPos = SendMessage(txtBox.hWnd, EM_CHARFROMPOS, 0&, mPos)
    13.     etc.......
    cPos is always returned as -1. Also I cannot find EM_CHARFROMPOS in the API Viewer.
    Does anyone have any ideas?

    TIA

    -TiPeRa
    Last edited by TiPeRa; Nov 9th, 2001 at 03:53 PM.
    W#Ć€V€® W¦|| ߀ W¦|| ߀, ÄÑÐ †#€®€ ¦§ ÑÖ†#¦Ñ6 ¥Öµ ©ÄÑ ÐÖ ÄßÖµ† ¦†, §Ö §¦† ßÄ©K, ®€|ÄX ÄÑÐ |€† ¦† #ÄÞÞ€Ñ.
    (Whatever will be will be, and there is nothing you can do about it, so sit back, relax and let it happen.)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width