 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
antonyb
Joined: 26 May 2004 Posts: 61
|
Posted: Fri Oct 07, 2005 8:05 am Post subject: Expose for Windows - any DLL writers out there?! |
|
|
Hello,
I've been messing around recently trying to write a proof-of-concept Expose style app for Windows using AHK. I know there are a number of other apps out there for this kind of thing, but firstly none of them do exactly what I want, and secondly its kind of a fun project anyway (has anyone else found that since they started using AHK there's always one more thing to do? ). Its actually fairly straightforward to get most of it done.
But.
The one major problem is the difficulty in getting decent screen grabs of windows, particularly windows which are minimized, partially or fully off screen, covered by other windows, etc. What I'm trying to do is to have a background script that cycles through all the windows from "WinGet, idlist" and grabs a current snapshot of them into a temp directory, then resizes them according to an algorithm based on the current number of windows, relative sizes, etc.
There is a way of doing this, but its non-trivial. The best documentation I've found on this is here, but the sample code seems to crash more apps than not on my system, and anyway is beyond my understanding of the Win32 API (I'm a humble Java programmer...!).
So, if anyone know's this stuff, and is willing to tackle a project, it would be great if we could create either a dll or a standalone app that was capable of grabbing a screen shot of a window to a file (or to memory, clipboard, etc) based on its ahk_id. There's scope for development from there too - resizing, converting to jpg/png, etc.
I'm more than happy to continue work on the rest of the script, but this part is beyond me, I'm afraid.
Any interest?
Ant. |
|
| Back to top |
|
 |
Peepsalot
Joined: 06 Oct 2005 Posts: 24
|
Posted: Fri Oct 07, 2005 8:40 am Post subject: |
|
|
Not sure if this helps, but as built into windows xp(maybe other versions, I don't know) Alt-PrintScreen automatically copies a screenshot of the current active window to the clipboard.
PrintScreen by itself copies the entire screen. |
|
| Back to top |
|
 |
antonyb
Joined: 26 May 2004 Posts: 61
|
Posted: Fri Oct 07, 2005 8:55 am Post subject: |
|
|
Hi Peepsalot,
Actually, thats not strictly true. Try this: open 2 windows, but set one to be AlwaysOnTop. Position that window over the other window, but make sure the other window is the currently active (focused) window. Hit Alt-Printscreen and paste into whatever image viewer you want. You'll see the AlwaysOnTop window has made it into your screengrab as well.
Alternatively, move a window half off screen and hit Alt-Printscreen.
That method of screen grab actually just BitBlts from the main desktop DC, it doesn't cause the currently active window to repaint itself to a different context. Most of the time, you get the desired result, but for an Expose style app its not good enough.
ant. |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|