AutoHotkey Community

It is currently May 27th, 2012, 4:51 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: October 7th, 2005, 8:05 am 
Offline

Joined: May 26th, 2004, 12:20 pm
Posts: 61
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 7th, 2005, 8:40 am 
Offline

Joined: October 6th, 2005, 7:25 am
Posts: 24
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 7th, 2005, 8:55 am 
Offline

Joined: May 26th, 2004, 12:20 pm
Posts: 61
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.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: 0x150||ISO, Bing [Bot], Yahoo [Bot] and 69 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group