GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 08-Feb-2004, 06:43
toripan toripan is offline
New Member
 
Join Date: Feb 2004
Posts: 6
toripan is on a distinguished road

Deactivate screensaver


Can anyone tell me if there's a function or an object that you can use to deactivate the screensaver while running your program? For example if i create a c++/opengl program that shows the movement of the earthe and the planets and it lasts for 20 minutes, if the screesaver is set to 5 minutes (ok it's an example) it will be disturbing for the user. Can you make the program itself deactivate it while running?
  #2  
Old 08-Feb-2004, 06:50
dsmith's Avatar
dsmith dsmith is offline
Senior Member
 
Join Date: Jan 2004
Location: Utah, USA
Posts: 1,351
dsmith is a glorious beacon of lightdsmith is a glorious beacon of lightdsmith is a glorious beacon of lightdsmith is a glorious beacon of lightdsmith is a glorious beacon of light
Greetings toripan.

That is actually a really good question. I don't have the answer handy, but someone else may. Can you let us know what compiler/OS that you are using?
  #3  
Old 08-Feb-2004, 07:11
toripan toripan is offline
New Member
 
Join Date: Feb 2004
Posts: 6
toripan is on a distinguished road
Greetings everybody (sorry i missed that part in the first post :-))
I have both windows xp with V.Studio 6 and mandrake 9.2 (gcc) (Generally new in linux)
  #4  
Old 08-Feb-2004, 07:25
dsmith's Avatar
dsmith dsmith is offline
Senior Member
 
Join Date: Jan 2004
Location: Utah, USA
Posts: 1,351
dsmith is a glorious beacon of lightdsmith is a glorious beacon of lightdsmith is a glorious beacon of lightdsmith is a glorious beacon of lightdsmith is a glorious beacon of light
Is this something that you want to do both in linux and windows? If in linux, what windows manager are you using (ie, KDE, Gnome, etc.)?
  #5  
Old 08-Feb-2004, 07:51
toripan toripan is offline
New Member
 
Join Date: Feb 2004
Posts: 6
toripan is on a distinguished road
No it's just a general question that has come to my mind, i am most interested in the answer about windows but if someone knows how this could be done in linux gnome that would be fine. I recently managed to compile opengl programs in linux so it would be ok.
  #6  
Old 08-Feb-2004, 09:29
dsmith's Avatar
dsmith dsmith is offline
Senior Member
 
Join Date: Jan 2004
Location: Utah, USA
Posts: 1,351
dsmith is a glorious beacon of lightdsmith is a glorious beacon of lightdsmith is a glorious beacon of lightdsmith is a glorious beacon of lightdsmith is a glorious beacon of light
Obviously, there is no standard library function to do this, so you would need to make use of the system call function in C. I am pretty sure that this would be straight forward in linux (unfortunately, I use KDE), but may not be so easy in windows. You may want to cross post this in the Windows forum to see if anyone knows the system call to disable the screen saver. Be explicit that you want to do this through a call, not graphically, otherwise someone will post how to disable the screen saver using the mouse...
  #7  
Old 08-Feb-2004, 14:58
toripan toripan is offline
New Member
 
Join Date: Feb 2004
Posts: 6
toripan is on a distinguished road
Thanx a lot! I'll try at the windows forum as well
  #8  
Old 11-Feb-2004, 09:26
Garth Farley Garth Farley is offline
Awaiting Email Confirmation
 
Join Date: May 2002
Location: Ireland
Posts: 638
Garth Farley is a jewel in the roughGarth Farley is a jewel in the roughGarth Farley is a jewel in the rough
Looking about on the web, the Windows System Parameter you want to change is SPI_SETSCREENSAVEACTIVE. Using the SystemParametersInfo() function, this can be set to false to deactivate the screensaver. That function is a member of the usual windows SDK, so hopefully Visual has it handy.

Here's where I got the info: msdn.microsoft.com

Hope it helps
GF
 
 

Recent GIDBlogVista ?Widgets? on Windows XP by LocalTech

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 13:16.


vBulletin, Copyright © 2000 - 2010, Jelsoft Enterprises Ltd.