OK.
Ive managed to get an empty level to trigger sucessfully as a screen-saver in XP-pro.
I havent tried more complex than that yet as I only have commercial and cant create WRS's.
Heres how Ive done it.
I copied my EXE(renamed to SCR), my WDL, and acknex.dll to the C:\WINDOWS folder. (not system32)
The SCR file IS still found here automatically by Display-Properties, and it tries to activate it fine.
But my scr died from "twain.dll invalid image" error, so in the WDL, I put
PLUGINDIR = "%";,
that way I needed no empty dummy directory, and it fires up OK.
Ive only got commercial, so it does a mini-compile splash-screen everytime something changes, or every time the
mini-preview window tries to draw, because our SCR app is being called separately each time.
I dont know if this will affect PRO users though. Suppress the winstart window should do the trick.
OK, thats got it going as a screen-saver. Heres the code I used in mine, its very rudimentary,
but you will easily see where to insert your code, as this following code is largely just
to show how to handle the different paramaters windows will pass in as a screensaver application.
Any questions or issues, just ask.
///////////////////////////////////////////////////////////////
#include <acknex.h>
#include <default.c>
///////////////////////////////////////////////////////////////
//
//
void config_popup()
{
//open a configuration panel of some kind
//remember to do a level_load unless you are using APIs
//also, the hWnd of the display properties MAY be available
//on the command line so you can get a window-position
sys_exit("");
}
//
//
void mini_preview()
{
//Open a mini-screensaver version to display the the "virtual"
//monitor in the Display Properties / ScreenSaver panel.
//You can retrieve a size from the hWnd that IS on the command-line
//and then do a video_set to that size and position it I suppose.
//Ive never tried anything like that before.
sys_exit("");
}
//
//
void ScreenSaver()
{
video_set(sys_metrics(0),sys_metrics(1),0,1);
level_load(NULL); wait(5);
VECTOR old_mouse;
vec_set(old_mouse, mouse_cursor);
while(1)
{
if(vec_dist(old_mouse,mouse_cursor)) sys_exit("");
wait(1);
}
sys_exit("");
}
//
//
function main()
{
// From Display Properties panel
// /p 123456 show in little monitor 123456 = Preview D3DWindow hWnd (size is resolution dependant)
// /s run or preview
// /c:987654 configure 987654 = DisplayProperties/ScreenSaver Tab-Dialog hWnd
//
// From RightClick Menu
// /S Test = Instant run
// Configure - no hWnd passed
// Install - does nothing but start DisplayProperties/ScreenSaver panel
//
//
if(str_stri(command_str,"/s")) { ScreenSaver(); } //execute the actual screensaver
else if(str_stri(command_str,"/p")) { mini_preview(); } //show preview in mini-panel
else { config_popup(); } //otherwise show my config panel
}