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 / Window focus in app made with DBPro

Author
Message
Cybermind
16
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 17th Oct 2018 21:06
I have a small problem, if I use another app while my editor made in DBPro is running, the editor still thinks it has focus and stuff happens in my editor as I click on other stuff in other apps/windows. I have to minimize my editor before doing other stuff. How can I check for window focus in my DBPro app? Or is there anything else I can do to prevent this from happening?
13/0
Mage
12
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Canada
Posted: 18th Oct 2018 05:42 Edited at: 18th Oct 2018 05:42
I don't remember doing this but I apparently answered this exact question.

Call Standby_Main() in your loops before or after each SYNC. Put the globals at the beginning of the program. Call Standby_Init() at the beginning of your program.


This not only detects loss of focus but also reduces CPU and GPU usage to zero.

Read more about implementing standby mode here:
https://forum.thegamecreators.com/thread/205649

Mage's Modular Code - Get awesome UI controls and powerful Bitmap Fonts!
Screen Device Recovery - Stop your apps from crashing when minimized/tabbed/screen locked.
CPU Friendly Frame Limiter - Make your app generate less computer heat + noise, and use less battery life!
Cybermind
16
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 19th Oct 2018 14:05
Thank you great wizard I have been trying to get in to the habit of minimizing the editor before doing stuff in other stuff, but this, this will give me more freedom! I will look into it on monday.
13/0
Cybermind
16
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 2nd Nov 2018 13:31
It seems to be working just fine Thanks a bunch
13/0

Login to post a reply

Server time is: 2019-06-17 13:41:11
Your offset time is: 2019-06-17 13:41:11