Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GetCaretPos() ignores cursor keys and mouse click
Message
 
To
06/04/2005 15:57:36
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
01002065
Message ID:
01002077
Views:
20
>I'm trying to figure out the physical location of the blinking text cursor (caret) in an editbox so that I can popup a context menu at the appropriate place for KEYBOARD users. (I know how to do this for mouse users)
>
>I've tried using row(), col() and the Windows GetCaretPos() API (thanks Sergey!). Both these techniques seem to provide the same information so I assume that row() and col() actually call GetCaretPos() for their info.
>
>The problem with row()/col() and GetCaretPos() is that both these techniques fail to update their coordinates when a user moves the cursor (caret) with the keyboard cursor keys (left, right, up, down, home, end) or when the user changes the cursor (caret) position by clicking in a new area of an editbox.
>
>So ... how can one force GetCaretPos() to refresh itself so that keyboard and mouse changes to cursor (caret) position are recognized and reflected in the value returned by GetCaretPos() (or row()/col() output)?
>
>Thanks!
>Malcolm

Just a swag, what happens if you call interactive change from the keypress event of the editbox when any of those keys are pressed? (and from mouse up to handle the mouse)
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform