BBC BASIC for Windows
« Necessity to use mouse to activate program. »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 10:10pm



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: Necessity to use mouse to activate program.  (Read 867 times)
TheFamousCash
New Member
Image


member is offline

Avatar




PM


Posts: 16
xx Necessity to use mouse to activate program.
« Thread started on: Jul 11th, 2015, 01:02am »

I transferred a program which has run successfully for years to a Dell OptiPlex 3030 all-in-one when the original computer failed.
When the program is a run from a shortcut in "startup" folder, the first screen awaits input from the user to enter ID.
The problem with this computer is, the keyboard is disabled and only activates when a mouse is connected and clicked anywhere on the screen.
I ran three other programs, including an "empty" one and all failed to accept keyboard input until the mouse was clicked.
Obviously, I would like to avoid this, (The dedicated system does not even have a mouse connected under normal usage.)
If anyone has experienced this, or may offer a solution, I would be grateful to hear from them.
Thanks,
Bob.
User IP Logged

rtr2
Guest
xx Re: Necessity to use mouse to activate program.
« Reply #1 on: Jul 11th, 2015, 07:40am »

on Jul 11th, 2015, 01:02am, TheFamousCash wrote:
The problem with this computer is, the keyboard is disabled and only activates when a mouse is connected and clicked anywhere on the screen.

In private correspondence Bob has confirmed that the text caret (cursor) is present and flashing at the time, suggesting that the window does have the input focus.

He has also tried the following code as a workaround, but it was ineffective:

Code:
      INSTALL @lib$+"WINLIB5"
      PROC_setfocus(@hwnd%) 

This is a strange fault indeed.

Richard.
User IP Logged

ady
Junior Member
ImageImage


member is offline

Avatar




PM


Posts: 55
xx Re: Necessity to use mouse to activate program.
« Reply #2 on: Jul 11th, 2015, 08:50am »

Cycle with the tab button?

Alt-Esc?
User IP Logged

rtr2
Guest
xx Re: Necessity to use mouse to activate program.
« Reply #3 on: Jul 11th, 2015, 09:55am »

on Jul 11th, 2015, 08:50am, ady wrote:
Cycle with the tab button? Alt-Esc?

Certainly worth trying as a workaround, but obviously not a 'solution' as such since it requires operator action that should not be needed.

Some more things for Bob to try, as much as a diagnostic aid than a workaround (clearly they should not be necessary):

1. Code:
      SYS "SetForegroundWindow", @hwnd% 

2. Code:
      SYS "BringWindowToTop", @hwnd% 

If neither of those work try these more complicated variants:

3. Code:
      SYS "GetWindowThreadProcessId", @hwnd%, 0 TO W%
      SYS "GetCurrentThreadId" TO O%
      SYS "AttachThreadInput", O%, W%, TRUE
      SYS "SetForegroundWindow", @hwnd%
      SYS "AttachThreadInput", O%, W%, FALSE 

4. Code:
      SYS "GetWindowThreadProcessId", @hwnd%, 0 TO W%
      SYS "GetCurrentThreadId" TO O%
      SYS "AttachThreadInput", O%, W%, TRUE
      SYS "BringWindowToTop", @hwnd%
      SYS "AttachThreadInput", O%, W%, FALSE 

Richard.
User IP Logged

TheFamousCash
New Member
Image


member is offline

Avatar




PM


Posts: 16
xx Re: Necessity to use mouse to activate program.
« Reply #4 on: Jul 11th, 2015, 12:49pm »

Many thanks for the responses.
I will try implementing the suggestions.
The program is used from 7.45am to 2.30am seven days a week and it is difficult to gain access for experiments when the owner is more than happy as it stands and reluctant to permit interruption.
I will advise of progress.
Thanks,
Bob.
User IP Logged

rtr2
Guest
xx Re: Necessity to use mouse to activate program.
« Reply #5 on: Jul 11th, 2015, 1:59pm »

on Jul 11th, 2015, 12:49pm, TheFamousCash wrote:
The program is used from 7.45am to 2.30am seven days a week

If it's as hot there as it is here (26.2 C at the moment and rising) you might appreciate some night shifts.... tongue

Richard.
User IP Logged

TheFamousCash
New Member
Image


member is offline

Avatar




PM


Posts: 16
xx Re: Necessity to use mouse to activate program.
« Reply #6 on: Jul 11th, 2015, 2:12pm »

Richard, since my days of running casino when I retired in 1981, I always go to bed around 5 or 6 am. . . No problem for me.
I program using your fantastic BB4W from midnight each night.
I never get bored experimenting. Done it for years since I used to program BBC Master Series.
Regards,
Bob.
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