Yup. A proper screensaver, for all! Open source!
It appears in the little grey monitor on the Display Settings box ('Screensaver' tab), can show a configuration dialog (but doesn't), and has a nice little purple cube too.
But save the praise (pff.. yeah, right) for later - I'm missing *ONE DLL COMMAND* that makes *EVERYTHING* fall apart.
How the f**king hell do you get your window's hWnd?
It's been mentioned before but I forgot!
For now, I leave you with the code - replace where it says '?????' with the return value from the command that gets the DBC window's hWnd, and it will work.
Prepare to be amazed!
`===================================
` Almost Complete DBC Screensaver
`===================================
`[rant]
`NOTE: __ALMOST__ COMPLETE DBC screensaver.
`I can't remember how to get the f**king hWnd of your own window!
`As soon as this is done, it'll f**king work!
`Sorry, but I'm a bit pissed off...
`[/rant]
setting$=cl$()
tempy$=right$(setting$,len(setting$)-3)
ScrSaverBoxHwnd=val(tempy$)
setting$=left$(setting$,2)
if setting$="/c" OR setting$=""
DoSettingsDialog()
end
`If 'Configure' was pressed from 'Display Settings', then we get /c:Number.
`We have *NO* use for 'Number'.
`If we're right-clicked in Explorer and 'Configure' is chosen,
`then we just get a blank thingy instead.
endif
if setting$="/S"
`Start the screensaver normally.
`Note that we were started from Windows Explorer/manually, rather than by 'Display Settings'.
DoNormalScreensaver()
end
endif
if setting$="/s"
`Run normally.
`We've either been started by Windows because it's screensaver time,
`or some dude clicked 'Preview' in 'Display Settings'.
DoNormalScreensaver()
end
endif
if setting$="/p"
`Now, THIS is where my breakthrough is.
`I mean, how the hell do we get our DB window inside that screen thingy?
`Well, Blanky found a way ;)
InitSpecialPreview()
DoNormalScreensaver()
end
endif
`If we're here, then either I missed something or it's bad usage.
`Oh well.
end
function InitSpecialPreview()
set window on
set window layout 0,0,0
`PLEASE, SOMEBODY!
`How do you find your window's hWnd again?
`THIS IS THE ONLY MISSING PIECE OF THE PUZZLE!
MyHWnd=?????
load dll "user32",1
tempy=call dll(1,"SetParent",MyHWnd,ScrSaverBoxHwnd)
maximize window
set display mode 153,113,32
wait 200
`That should do the trick.
endfunction
function DoSettingsDialog()
print "There are... NO SETTINGS"
wait key
endfunction
function DoNormalScreensaver()
`Syncy.
sync on
sync rate 0
`Blah blah blah. Boring purple cube, cartoon-style.
make object cube 1,100.0
make object cube 2,-101.0
set ambient light 100
color object 1,rgb(140,85,255)
color object 2,rgb(255,0,0)
do
rotate object 1,wrapvalue(object angle x(1)+1.0),wrapvalue(object angle y(1)+1.0),wrapvalue(object angle z(1)+1.0)
rotate object 2,object angle x(1),object angle y(1),object angle z(1)
if scancode()<>0 then exit
sync
loop
`cleanup
delete object 2
delete object 1
endfunction
Edit: To run this screensaver, compile it to an EXE, then rename it from [whatever].exe to [whatever].scr. From there, the quickest way would be to right-click it and choose 'Install'. Of course, it'll crash because I'm still missing that one command...
Edit #2: With the last edit, I tweaked the code a bit and forgot to put the '?????' back in....
Avatar - white cat in a snowstorm. Look closely.