123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|719|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> Blitz -> capturing windows?

Sat, 12 May 2007, 18:41
spinal
Just wondering for the sake of a screen saver, Is it possible/easy to get a screen grab of each open window and use them as images in a blitz program?

-=-=-
Check out my excellent homepage!
Sat, 12 May 2007, 18:54
Stealth
Maybe with a DLL.. I don't know of any though.
Sat, 12 May 2007, 18:58
Blitz3Dman
For the program to grab them itself, not that I know of. You can press Print Screen right above insert and delete and it copies the screen to the clipboard.

-=-=-
There are 10 kinds of people in this world -

( Insert 16 remarks about to what extent people know hex here )
Sat, 12 May 2007, 19:01
bram32
Yes, it seems to be possible. I'm not sure if it will work on every system. MarkCW wrote functions that can capture the screen to the clipboard and also a function that converts the clipboard to an image:
CaptureScreen:
www.blitzbasic.com/codearcs/codearcs.php?code=1752
PasteFromClipboard:
www.blitzbasic.com/codearcs/codearcs.php?code=1767

I made a desktop screenshot with the following code, which is a combination of the two programs above. You also need the .decls files that are mentioned in the links above to get it to work:

Sat, 12 May 2007, 19:03
Jayenkai
But that's the whole screen. I think Spinal wants each individual window.

And I haven't a clue how to do that, either!

-=-=-
''Load, Next List!''
Sat, 12 May 2007, 19:13
JL235
If you could get information on the other windows, such as what windows are open, their position and size, you could easily cut up the desktop screen shot (but then there is a problem with windows that are on top of other windows).

Presumably there must be something, possibly in Win32, to find out what other windows are open. Maybe then to send them commands such as to get focus (partly curing the problem I said above). This may also be OLE stuff instead.

But I have no idea how to do any of it.
Sat, 12 May 2007, 19:20
bram32
You would need the hwnd for the window you want to capture then. For instance, with Api_FindWindow you can retreive the hwnd for specific windows. If the window is active, you could use Api_GetForeGroundWindow. In the code above I used Api_GetDesktopWindow, which returns the hwnd for the entire desktop. For the .bb window itself, use SystemProperty$("apphwnd")

edit: for Api_FindWindow you need to make sure you have the right declaration:


The first one should be lpClassName%, in some .decls it uses lpClassName$ instead. When the function has this declaration, you can omit the first parameter (window class name) and put in a zero instead. The second parameter is the caption (name/title) of the window:

Sat, 12 May 2007, 20:06
Stealth
That might actually work.
Sun, 13 May 2007, 10:32
Paul
Use this to get the window position and size. then use the captureclient area function and clip the imge with grabimage in blitz.
If you didn't understand then feel free to ask

this also needs the .decels in the above link

|edit| Added cometnts |edit|