Source language: Translate to:

Prevent screensaver from running from neo-app

Post your suggestions for future versions of NeoBook

Moderator: Neosoft Support

Prevent screensaver from running from neo-app

Postby HPW » Tue Oct 09, 2007 9:32 am

It could be that I do not want to let a screensaver start when my app is running.

So how about a new global variable: [PreventScreensaver]

When it is set to 'True' the neobook app prevent a screensaver form starting.

Some delphi snippet from the net:
Code: Select all
procedure WMSysCommand(var Msg: TMessage); message WM_SYSCOMMAND;

procedure TMainForm.WMSysCommand(var Msg: TMessage);
begin
  if (Msg.wParam = SC_SCREENSAVE) then
    Msg.Result := 1
  else
    inherited;
end;


It should work when the neobook app has the focus and that message handling.
Hans-Peter
User avatar
HPW
 
Posts: 2521
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Postby Neosoft Support » Tue Oct 09, 2007 10:31 am

I'll add it to the list of things to think about.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5605
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Postby HPW » Mon Oct 29, 2007 12:20 am

I found another way to do it with neobook's given tools.
(For non-interactive apps)

Define a hidden textentry and a timer.
The timer is started and the time is set to a value shorter then the screensaver time.
In the timer action you focus the textentry and use 'SendKeys' and send a {BS}.
This keeps windows running without enabling the screensaver.
Hans-Peter
User avatar
HPW
 
Posts: 2521
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Postby Gaev » Mon Oct 29, 2007 6:49 am

Hans-Peter:

Would it also work if you had an "off screen" button in the Master Page ... with a shortcut key combination defined for it ... and the same Timer did the SendKeys command using the defined shortcut ? ... the button's click section would have just a Return command.
User avatar
Gaev
 
Posts: 3738
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Postby HPW » Mon Oct 29, 2007 8:18 am

I think so.
As long the windows API gets a key-message it will prevent the screensaver.
Hans-Peter
User avatar
HPW
 
Posts: 2521
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Postby HPW » Mon Oct 29, 2007 12:49 pm

I tried it even without any button.

Only a timer with such action.
Code: Select all
SendKeys "" "{CtrlDn}+{CtrlUp}"


Keeps the screensaver hidden.
As long no object accept this hotkey it goes into nirwana.
Hans-Peter
User avatar
HPW
 
Posts: 2521
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany


Return to NeoBook Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest

cron