• Advertisement

Archived

This topic is now archived and is closed to further replies.

Screen Savers

This topic is 5554 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ok, I just finished writing a little bit of nifty looking graphics code. I am intrested in using this code as a screensaver. Does anyone know how I could go about turning this into a screensaver? Thanks.

Share this post


Link to post
Share on other sites
Advertisement
If you don''t need the settings to show up "inside" the settings dialogue, just rename your fullscreen EXE to SCR and put in the windows directory...should work.

Share this post


Link to post
Share on other sites
I am very interested in doing this myself. While renaming it to .SCR will work, it sucks. When you select it, it tries running it when it wants to make the preview. Here are my questions:

How do I make it quit when the user moves the mouse? I tried doing a PostQuitMessage(0); in the WM_MOUSEMOVE event, but it quit right when it started.

Also, how do I make a settings box for my screensaver? I''d like to be able to change a few settings.

If there''s anything else we need to know, please inform us. Any help would be helpful, thanks.



_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
_/http://www.lameware.com _/
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

Share this post


Link to post
Share on other sites
Hrm, well, there is nothing that I need to have in the settings dialogue box. I am still having problems with this. I cannot even find any of the other screensavers. Do I just raname it and put it in the main windows directory (working with xp here, I should add)?


Also, what If I wanted to allow one variable to be changed in the settings box, how difficult would this be to do? If that''s within reason, how would I add boundrys for that variable?



Hope I''m not asking too much.

Share this post


Link to post
Share on other sites
Maybe you could make something that resembels a sensivity counter by add to a variable whenever WM_MOUSEMOVE is called, then if it equals a certin value, then make the call to PostQuitMessage(0); You'll have to make it so this counter slowly lowered when the mouse wasn't moved.

I think I'll experiment with that..I'll let you know of my results.

EDIT:
case WM_MOUSEMOVE:
{
sensivity += 2;
if (sensivity == 20)
PostQuitMessage(0);
return 0;
}


Then put sensivity--; in your main loop. With my program it takes about 3 seconds of moving the mouse to exit out of the program. You can, of corse, tweak to your liking.

Hope this helps you, with this part of the program anyway.

[edited by - lessthanjoe on December 6, 2002 11:27:11 PM]

Share this post


Link to post
Share on other sites
The reason the preview runs it is that you have to accept command line arguments for a screensaver. I dont know the command, but it gives you a preview HDC that you are supposed to draw to. renaming it to .scr is the way to do it.

Brian

Share this post


Link to post
Share on other sites
Thay is exactly what I am looking for. While quite a bit more difficult then I prefered, I have no objecting to a little bedside reading. Thank you very much for thinking of me +)


Also, make sure you use greater then rather then equals in my sensivity thing...otherwise a small pause then a lot of movement could leave you stranded in the screensaver for quite a while.

Share this post


Link to post
Share on other sites
quote:
Original post by LessThanJoe
Also, make sure you use greater then rather then equals in my sensivity thing...otherwise a small pause then a lot of movement could leave you stranded in the screensaver for quite a while.


don''t think so... even if the handler has a lot of messages in its queue, it doesn''t jump over code...

Share this post


Link to post
Share on other sites
well no, it''s because the WM_MOUSEMOVE causes sensivity to go up 2 at a time, and lowers once every loop inside winmain.

So if it goes up two, goes down one, then keeps going up....it''ll never reach ten.

Share this post


Link to post
Share on other sites

  • Advertisement