• Advertisement
Sign in to follow this  

turn an already compiled exe into a screensaver

This topic is 3293 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

Hi! I have a little game that shall be converted into an (interactive) screensaver (interactive = it doesn't disappear at mousemovement, only at pressing a key) A windows .scr screensaver file differs from an normal executable .exe file in the following points: -if passed a '/c' parameter at startup, it will run in settings mode -if passed a '/p' parameter at startup, it will run in preview mode now i have here an already compiled exe (no way to recompile it!) which shall be turned into a screensaver. I have a little tool that does this for me automatically (i can chose two pictures, one will be displayed as preview and the other one as settings dialog) - so this seems to be possible. Now this is not really enough - i want a real settings dialog which will store some values in a .ini file. I know i could do this by compiling another exe file into a screensaver which will call the other exe at startup, pack all those together and make an installer to extract the files in one folder. but there's the other requirement that it has to be distributed as A single .scr file! so my question is: how can i alter manually the already compiled exe file to do what i want? i thoght of doing something like writing a new screensaver application and append the code of the exe file to the end of it and then somehow execute this code. if that's possible - how to do it? or do you know a better solution? Thank you for the help :)

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by genesysso my question is: how can i alter manually the already compiled exe file to do what i want? i thoght of doing something like writing a new screensaver application and append the code of the exe file to the end of it and then somehow execute this code. if that's possible - how to do it? or do you know a better solution?
You can't modify the exe, but you could add it to a "launcher" application as a binary resource. When the launcher needs to run the screensaver, it can extract the resource to a temporary file, use CreateProcess() to run it, then wait on the process handle. When the handle becomes signalled, that means the screensaver has ended and you can delete the temporary file.

I can't recall offhand what causes screensavers to be terminated though, I suspect the exe would have to check for WM_MOUSEMOVE, WM_KEYDOWN or WM_*BUTTONDOWN - getting that working could be tricker.

Share this post


Link to post
Share on other sites
is it possible to do this somehow without extracting the exe to harddisk? somehow extracting it to memory only? if the screensaver crashes it can't delete the file afterwards.

Also - i think such "launchers" are treated by many virus scanners as 'suspicious' - no? since this a job i do for a company i don't want it to appear as virus on some computers later on...


thanks for your help so far :)

Share this post


Link to post
Share on other sites
Quote:
Original post by genesys
is it possible to do this somehow without extracting the exe to harddisk? somehow extracting it to memory only? if the screensaver crashes it can't delete the file afterwards.
Only if you can restrict yourself to XP and/or Vista and are ok with your app not running on future Windows versions. And even then, it's pretty complicated - you need to manually do the job of the OS loader, because it's not designed to load images from memory.

Quote:
Original post by genesys
Also - i think such "launchers" are treated by many virus scanners as 'suspicious' - no? since this a job i do for a company i don't want it to appear as virus on some computers later on...
I can't see why. Only if the exe being launched contains a virus.

Share this post


Link to post
Share on other sites
Quote:
Original post by genesys
is it possible to do this somehow without extracting the exe to harddisk? somehow extracting it to memory only? if the screensaver crashes it can't delete the file afterwards.


This is what %TEMP% was designed for.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement