User Tools

Site Tools


finding_20which_20window_20has_20input_20focus

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
finding_20which_20window_20has_20input_20focus [2018/03/31 13:19] – external edit 127.0.0.1finding_20which_20window_20has_20input_20focus [2024/01/05 00:22] (current) – external edit 127.0.0.1
Line 1: Line 1:
 =====Finding which window has input focus===== =====Finding which window has input focus=====
  
-//by Richard Russell, April 2010//\\ \\  The **WINLIB5** (and **WINLIB5A**) libaries contain the [[http://www.bbcbasic.co.uk/bbcwin/manual/bbcwing.html#setfocus|PROC_setfocus]] routine which allows you to set the input focus to a specified child window (or the main output window). However, there is no related function to return the handle of the window which currently has input focus.\\ \\  The code below implements just such a function. It returns the handle of the child window (or main output window) which currently has input focus. If none of the windows 'owned' by your program have input focus, the function returns zero:\\ +//by Richard Russell, April 2010//\\ \\  The **WINLIB5** (and **WINLIB5A**) libaries contain the [[http://www.bbcbasic.co.uk/bbcwin/manual/bbcwing.html#setfocus|PROC_setfocus]] routine which allows you to set the input focus to a specified child window (or the main output window). However, there is no related function to return the handle of the window which currently has input focus.\\ \\  The code below implements just such a function. It returns the handle of the child window (or main output window) which currently has input focus. If none of the windows 'owned' by your program have input focus, the function returns zero: 
 + 
 +<code bb4w>
         DEF FN_getfocus         DEF FN_getfocus
         LOCAL H%, O%, W%         LOCAL H%, O%, W%
Line 10: Line 12:
         SYS "AttachThreadInput", O%, W%, FALSE         SYS "AttachThreadInput", O%, W%, FALSE
         = H%         = H%
 +</code>
finding_20which_20window_20has_20input_20focus.1522502362.txt.gz · Last modified: 2024/01/05 00:17 (external edit)