Welcome Guest. Please Login or Register. Apr 6th, 2018, 12:09am
ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018. Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.
If you require a dump of the post on your message board, please come to the support board and request it.
Re: Caret in Editbox
« Reply #4 on: Apr 25th, 2010, 09:28am »
"I don't believe it" - The mighty Microsoft OS does not have a simple SYS call to give you the caret position. Hopeless!
I will look at the dialogue box solution for my next program but for now I have solved the problem as long as I don't click the mouse in different editbox (which I don't want to anyway!).
"I don't believe it" - The mighty Microsoft OS does not have a simple SYS call to give you the caret position. Hopeless!
There is an API - GetFocus() - but it has to be used from the same thread that contains the Message Queue. That means you cannot call it as a straightforward SYS from BB4W.
If you look at the code for PROC_setfocus in WINLIB5 you will see the hoops that have to be jumped through to make the SetFocus() API work (which has the same restriction). It would be possible to adapt that code to make an FN_getfocus function, but I didn't suggest that approach because it involves assembler code.
There is an API - GetFocus() - but it has to be used from the same thread that contains the Message Queue. That means you cannot call it as a straightforward SYS from BB4W.
I have listed a routine which works (and doesn't use assembler code) here: