Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Active Window and Focus

Author
Message
Ben_UK78
15
Years of Service
User Offline
Joined: 10th Jul 2010
Location:
Posted: 26th Jun 2012 08:52
Hi All,

Just a quick question since I seem to be hitting a wall.

When I compile a program so it opens in FULLDESKTOP it does not have the windows focus/is not active.

I just need it so that I do not have to click in the window before it will start recognising key presses etc. Does anyone know the correct command to do this?
Max P
16
Years of Service
User Offline
Joined: 23rd Jan 2010
Location:
Posted: 26th Jun 2012 18:46
There is a 'Grab Focus' command in the Matrix1Utils, they can be downloaded here: http://forum.thegamecreators.com/?m=forum_view&t=85209&b=18
Just call 'Grab Focus' before you enter the main loop.

Ben_UK78
15
Years of Service
User Offline
Joined: 10th Jul 2010
Location:
Posted: 27th Jun 2012 05:36
Thanks very much. GRAB FOCUS does allow input without clicking in the window, which is something at least.

I had tried it in the past, looking at my other progs, but can to a wall. I still have to click in the box to make it lie above the windows taskbar (for example).

I guess the focus is given, but the window is not brought to the top. Do you know how to make the window the full equivalent of being clicked on using the mouse?

I have tried a method like this, but I can't quite make it work.

Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 28th Jun 2012 00:21
This is some old DBC code, but it should be valid. The main change might be the binary OR operator '||' as opposed to '|'



Enjoy your day.

Login to post a reply

Server time is: 2026-07-08 10:39:25
Your offset time is: 2026-07-08 10:39:25