![]() |
|
#1
|
|||
|
|||
Deactivate screensaverCan 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
|
||||
|
||||
|
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
|
|||
|
|||
|
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
|
||||
|
||||
|
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
|
|||
|
|||
|
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
|
||||
|
||||
|
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
|
|||
|
|||
|
Thanx a lot! I'll try at the windows forum as well
|
|
#8
|
|||
|
|||
|
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 GIDBlog
Meeting the local Iraqis by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The