BBC BASIC for Windows
« Caret in Editbox »

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.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Caret in Editbox  (Read 1179 times)
nitwit
Guest
xx 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!).
User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: Caret in Editbox
« Reply #5 on: Apr 25th, 2010, 09:41am »

on Apr 25th, 2010, 09:28am, Guest-nitwit wrote:
"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.

Richard.
User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: Caret in Editbox
« Reply #6 on: Apr 26th, 2010, 08:30am »

on Apr 25th, 2010, 09:41am, Richard Russell wrote:
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:

http://bb4w.wikispaces.com/Finding+which+window+has+input+focus

Richard.
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls