AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Expose for Windows - any DLL writers out there?!

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
antonyb



Joined: 26 May 2004
Posts: 61

PostPosted: Fri Oct 07, 2005 8:05 am    Post subject: Expose for Windows - any DLL writers out there?! Reply with quote

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? Wink ). 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
View user's profile Send private message
Peepsalot



Joined: 06 Oct 2005
Posts: 24

PostPosted: Fri Oct 07, 2005 8:40 am    Post subject: Reply with quote

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
View user's profile Send private message
antonyb



Joined: 26 May 2004
Posts: 61

PostPosted: Fri Oct 07, 2005 8:55 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group