desktop image?

Blitz3D Forums/Blitz3D Beginners Area/desktop image?

zortzblatz(Posted 2005) [#1]
Does anyone know how to run things ontop of the desktop or over a screen shot of it?

thx Zortzblatz


_PJ_(Posted 2005) [#2]
Someone else wanted this kinda thing previously, I think it involves some API uage to cheat by grabbing an image of the desktop screen, then shoving that image onto the Blitz application drawing buffer.

I'll have a look for the thread and edit here with the link. Laters


jfk EO-11110(Posted 2005) [#3]
I guess there is an example in the code archive to grab the desktop as an image. All you need to do is using GetSystemMetrics to get the Desktop Resolution, then use the same resolution with Graphics or Graphics3D, then continously draw the grabbed desktop screenshot as the background of your app.

check this out:
http://www.blitzbasic.com/codearcs/codearcs.php?code=654


_PJ_(Posted 2005) [#4]
Would it need to be continuously grabbed? Surely just grabbing it once initially would be enough? I mean, the desktop isn't going to change while the Blitz app is running?
Well spotted about the resolution!

Im assuming this is for some kind of screensaver effect or similar?


WolRon(Posted 2005) [#5]
I mean, the desktop isn't going to change while the Blitz app is running?
Depends on the desktop...


zortzblatz(Posted 2005) [#6]
I tried the code jfk EO-11110 linked me to and it didn't work. is there any way to just draw on the desktop like having a windowless app or something (I'm trying to get a weird looking robot to dance on the desktop.)


zortzblatz(Posted 2005) [#7]
hmm none of these things seem to be working does anyone have any other ideas as to how it might be possible?


jfk EO-11110(Posted 2005) [#8]
well the code should work, but you need to set up the userlib stuff the right way. Are you familar with this DECLS stuff?

At the end of the source it says
Lines needed in Userlib: User32.decls

FindWindow%( class$,Text$ ):"FindWindowA"
ShowWindow(hwnd%,nCmdShow%)
GetActiveWindow%()
GetDC%(hWnd% )
ReleaseDC%(hWnd%,hDC%)
GetDesktopWindow%()
GetSystemMetrics%(nIndext%)

Lines needed in Userlib: Gdi32.decls
BitBlt%(hDestDC%,X%,Y%,nWidth%,nHeight%,hSrcDC,XSrc,YSrc,dwRop)


This means you need (if they do not already exist) to create two files in the "userlibs" folder of your Blitz3D intallation folder, one is named "User32.decls" and the second is named "Gdi32.decls". You may open them with notepad, then paste those lines to the files and save them. Then restart Blitz and the example. I think I have tested it some time ago.