Doubt I`ll get an answer, but what the hell.
Seems like you can't prevent the screensaver from kicking in once DelphiX is operating in fullscreen mode. The code is fine for windowed, but not full screen.
Anyone defeated this?
Doubt I`ll get an answer, but what the hell.
Seems like you can't prevent the screensaver from kicking in once DelphiX is operating in fullscreen mode. The code is fine for windowed, but not full screen.
Anyone defeated this?
Yes you can - have a search this topic has been answered before
The views expressed on this programme are bloody good ones. - Fred Dagg
http://www.pascalgamedevelopment.com...t=wmsyscommand
have a look there
This is what I use - but more info in the thread
procedure WMSysCommand(var Msg : TWMSysCommand); message WM_SYSCOMMAND;
[pascal]// SWITCH OFF THE SCREENSAVER AND THE MONITOR POWER SAVER IF THEY TRY TO CUT IN
procedure TForm1.WMSysCommand(var Msg : TWMSysCommand);
begin
//catch the message and turn it off
if (Msg.CmdType = SC_MONITORPOWER) or (Msg.CmdType = SC_SCREENSAVE) then
begin
Msg.Result := -1;
end
else
inherited;///Otherwise do whatever is supposed to be done
end;[/pascal]
The views expressed on this programme are bloody good ones. - Fred Dagg
Same solution here:
http://www.swissdelphicenter.ch/torr...ode.php?id=344
<center>
<br />Federico "FNX" Nisoli
<br />Lead Programmer - FNX Games
<br />http://www.fnxgames.com
<br /><img src="http://www.fnxgames.com/imgs/banners/fnxban.gif">
<br /></center>
I have tried this one already (and slight variations of)Originally Posted by FNX
This solution doesn't work. The message is intercepted correctly, but the screensaver fires nonetheless.
Maybe the secret lies in Czar's extra result setting - will try now..
How is this proc suppose to be called? It won't plug onto the application.OnMessage....Originally Posted by czar
Put this
procedure WMSysCommand(var Msg : TWMSysCommand); message WM_SYSCOMMAND;
in your form private - add the routine and bob's your uncle.
Works for us - and we have this code used in hundreds of programs
The views expressed on this programme are bloody good ones. - Fred Dagg
This is very strange. The condition is met and and the msg.result is set, but the screensaver still activates...
Is there any other factor that I need to consider?
I thought the
[pascal]Msg.Result := -1; [/pascal]
should actually be
[pascal]Msg.Result := 0;[/pascal]
meaning handled, therefore it won't power off. Have you tried changing the result to zero?
Bookmarks