Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Windows API functions for edit box controls
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00575476
Message ID:
00575775
Vues:
25
George,

Thanks for your help! I follow your logic regarding how to determine the position of a control on a form. Where I'm confused is how to go to the next level of information to determine the position of the current control's text cursor on the form.

I'm still confused about how to get more information about a control's text cursor (beyond the linear information returned by the SelStart property).

I know I must be missing something in what you and Ed have posted - (in spite of numereous cups of coffee) I'm just blind to my ignorance.

Thanks for your help (and patience!).

Regards,
Malcolm

PS: I'm going to post a related question concerning an alternative way to possibly skin this Fox.


>>Is there a Windows API function that will return the ABSOLUTE row and column position (in pixels) of the text cursor within an edit box?
>>
>>Is there a Windows API function that will return the row and column position (in pixels) of the text cursor within an edit box RELATIVE to the frame of the edit control?
>>
>>Thanks!
>Malcolm,
>
>Ed's given you the basics, but here are some hints.
>
>First, foxtools has a function (_GetWRect()) that'll return the absolute position of the form of the form. You need to supply it with the form's window handle:
* Assumes Foxtools is loaded
>IF "7.0" $ VERSION()
>  lnhwnd = ThisForm.hWnd
>ELSE
>  lnhwnd = _WhTohWnd(_WFindTitl(ThisForm.Caption))
>ENDIF
>STORE 0 TO nTop, nLeft, nBottom, nRight
>= _GetWRect(lnHwnd, @nTop, @nLeft, @nBottom, @nRight)
Second, use the OBJTOCLIENT() to retrive the top and left position of the object relative to the client area.
>
>Third, adjust for the frame width, height and the height of the title bar using the SYSMETRIC() function.
>
>I do something similar in my Obj2Bmp applicaton which is available for download. A couple of notes, however. First, in order to reduce the need for Foxtools, I used the GetWindowRect() API call and resolve the POINT structure that Ed mentioned. Second, since I didn't know whether or not OBJTOCLIENT() existed in 5.0 (and was too stupid to look in the "What's New" section), I resolve the location using a different method.
>
>This should get you started should you choose to rely on a native VFP control.
Malcolm Greene
Brooks-Durham
mgreene@bdurham.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform