AutoHotkey Community

It is currently May 26th, 2012, 2:51 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 181 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7, 8, 9 ... 13  Next
Author Message
 Post subject:
PostPosted: January 2nd, 2009, 2:33 pm 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
adamrgolf wrote:
Irfanview offers an option to capture just the active window.

You can do this
Code:
CaptureScreen(1, false, "c:\active_window.bmp")


Quote:
Code:
CaptureScreen(3,false,"c:\active_screen.bmp")

That can be done.
Code:
Else If aRect = 3
{
   DllCall("GetCursorPos", "int64P", pt)
   DllCall("GetMonitorInfo", "Uint", DllCall("MonitorFromPoint", "int64", pt, "Uint", 2), "Uint", NumPut(VarSetCapacity(mi,40,0),mi)-4)
   nL := NumGet(mi, 4, "int")
   nT := NumGet(mi, 8, "int")
   nW := NumGet(mi,12, "int") - nL
   nH := NumGet(mi,16, "int") - nT
}


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 2nd, 2009, 3:03 pm 
Offline

Joined: December 28th, 2006, 9:46 am
Posts: 440
Sean wrote:
adamrgolf wrote:
Irfanview offers an option to capture just the active window.

You can do this
Code:
CaptureScreen(1, false, "c:\active_window.bmp")



Sorry, I meant to type active screen, not active window - I've edited my previous post. Also thanks for the code! I'll try it out when i get back to multi mon setup (at work).


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 20th, 2009, 10:41 pm 
Offline

Joined: January 20th, 2009, 9:35 pm
Posts: 16
if a window is semi-transparent, is there a way to make this take a screenshot of it as if it had 0 transparency?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 21st, 2009, 12:38 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
ifckladyluck wrote:
if a window is semi-transparent, is there a way to make this take a screenshot of it as if it had 0 transparency?

Sure. Just use the window handle of a window instead of 0 when executing Get(Window)DC in the script. Or you can use PrintWindow API.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 21st, 2009, 12:57 am 
Offline

Joined: January 20th, 2009, 9:35 pm
Posts: 16
Sean wrote:
ifckladyluck wrote:
if a window is semi-transparent, is there a way to make this take a screenshot of it as if it had 0 transparency?

Sure. Just use the window handle of a window instead of 0 when executing Get(Window)DC in the script. Or you can use PrintWindow API.


thank you sean this worked. the only problem is that it removes the border around it (taskbar and all)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 21st, 2009, 1:10 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
ifckladyluck wrote:
thank you sean this worked. the only problem is that it removes the border around it (taskbar and all)

Use GetWindowDC instead of GetDC.


Report this post
Top
 Profile  
Reply with quote  
PostPosted: January 30th, 2009, 8:28 pm 
All the input for AHK is greatly appreciated. It has saved me hours of time. This function gets me most of the way to a solution to my problem, I am looking for help with the remainder.

I access a database where there is a hierarchy of data elements. By double clicking on a parent element the list of child elements expands down, much like expanding a file list in Windows
Explorer. The child elements can range from 1 to several thousands. I need to extract how many children there are for each of 32,000 parents.

I have an AHK script that expands the list. Depending on the number of children, the database can take from seconds to several minutes to expand the list. Once the list is expanded the number of elements appears in the "fake" status bar. Unfortunately this information cannot be read by StatusBarGetText (it returns an errorlevel 1). So my script uses CaptureScreen to copy the section of the 'fake' status bar that holds the number of child elements and pastes it into Excel in the cell next to the parent element.

I need help with:
I would like a routine that reads the screen segment into the clipboard, as it does now, but then takes another snapshot and compares the 2. This way I can tell when children have dropped down, showing the number of children for that parent and proceed without having to sleep the maximum amount of time between each reading, which is the only way I know to do it now.

Once I have all the screen segments pasted in Excel I would like some way to compare them, so that say I can find all the parents that have 1, 2 or 3 children.

Can CaptureScreen be modified so that the rectangle coordinates refer to the active window, not the whole screen?

Thanks in advance for any help you are able to provide.
ed


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 31st, 2009, 1:49 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
WarmBeer wrote:
Can CaptureScreen be modified so that the rectangle coordinates refer to the active window, not the whole screen?

I don't think that's difficult, but, definitely I won't do that to the official one. You can change it however you like, though.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: ScreenCapture
PostPosted: February 12th, 2009, 1:15 pm 
Offline

Joined: August 1st, 2008, 3:16 pm
Posts: 16
Hi

I have downloaded the ScreenCapture.ahk. But am confused to how to run it i.e. where do I set the values (file path etc.).

Cheers
Rob


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 19th, 2009, 2:12 am 
Offline

Joined: December 30th, 2007, 5:42 pm
Posts: 31
Location: East Coast
Thanks for this, especially the transparent window screening with location. I needed this to add a requested feature to a project I'm working on. You should consider including an option in the main function code that's posted to screen transparent windows. I'm sure many people have missed where you mentioned how to do it in this topic. Thanks again Sean for another great contribution.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 20th, 2009, 2:48 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
Precise wrote:
You should consider including an option in the main function code that's posted to screen transparent windows.
I'm not sure if I understood you here. You mean option to enable/disable capturing the transparent windows?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 22nd, 2009, 11:32 am 
Offline

Joined: February 22nd, 2009, 11:24 am
Posts: 2
Great program, I'm getting more and more impressed of the possibilities of autohotkey each day!

1) does anyone have the code to capture a rectangle? (not complete screen/window)
2) what is the fastest way to add a watermark? Or can CaptureScreen automatic overlay a second picture in the result?

Thanks,
rene


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 22nd, 2009, 2:50 pm 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
reneke wrote:
does anyone have the code to capture a rectangle? (not complete screen/window)
Code:
CaptureScreen("10,10,200,200") ; "left, top, right, bottom"

Quote:
Or can CaptureScreen automatic overlay a second picture in the result?
No. However, you can mimic the function CaptureCursor in the script.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 22nd, 2009, 9:16 pm 
Offline

Joined: February 22nd, 2009, 11:24 am
Posts: 2
Sean wrote:
reneke wrote:
does anyone have the code to capture a rectangle? (not complete screen/window)
Code:
CaptureScreen("10,10,200,200") ; "left, top, right, bottom"



Sorry, that is not what I mean. I want to specify the rectangle by using the mouse and draw a rectangle.

Gr,
rene


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 7th, 2009, 1:20 pm 
uhm look, I'm not sure if I'm missing something, but i cannot use this script at all. whenever I double click the ahk file, the tray icon just flickers for a second and nothing happened
I thought I was missing the gdiplus.dll, so I downloaded it here and put it in the same folder of the script
I'm a newbie here guys, any help? what did I do wrong?


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 181 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7, 8, 9 ... 13  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: daonlyfreez, Google [Bot] and 12 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