Page 2 of 15

Re: Screen clipping

Posted: 19 Jan 2016, 08:32
by Joe Glines
Look under applications then select the Client ID

Re: Screen clipping

Posted: 19 Jan 2016, 09:22
by TheBrohman
Allright, thanks I got it. But it is not working. https://youtu.be/FawNbKpdDBU

Re: Screen clipping

Posted: 19 Jan 2016, 14:17
by Joe Glines
troubleshooting remotely is pretty tough... Here are a few quick take-aways
1) the IMUGR part didn't work because there was no file to upload
2) although you said "nothing" which doing some of the hotkeys, you do see the rectangle being made when you drag which is a good sign that somethiig is working
3) I'd put some message boxes in there to see if an object is getting created (or at least to confirm where you get to in the script)
4) the way the script works you should see a capture immediately after holding down the windows key and dragging. (thus your opening paint/editor and pasting will not work) It boils down to an error why the file/image isn't getting created in the first place

Re: Screen clipping

Posted: 14 Feb 2016, 19:50
by JJohnston2
This is a really great script... thank you for posting :bravo:

I had a few troubles getting it to work but that was due to my setup and here is what I had to update...
  • First update I had to make before anything would work was using the latest GDIP routines... I'm wondering if that was an x64 compatibility issue.
  • After that I had a secondary issue, because in SCW_SelectAreaMod() there is a while loop that waits for the mouse button to no longer be pressed, i.e., user is done drawing the box... While, (GetKeyState(Hotkey, "p")). It turns out that I had an old copy of polyethylene's functions.ahk #included which had a duplicate/deprecated GetKeyState() function... getting that nuked finally got it running.
I also added the escape option to close before I saw it noted in previous posts here on this thread... I tried options for closing both the active window or all windows, not sure which option I'll keep, but maybe just the individual window option for now since it's easy enough to click through them and close individually.

I have been itching to have this running ever since I saw the YouTube video (which was also great btw--if it weren't for that I would have ignored the code because it didn't run for me out of the box).

Something I am currently working on (which is partially working) is to slave this to the OneNote screen capture utility. There is a key difference between the OneNote utility and this tool, which is the order of capture. The OneNote utility will capture the whole screen and then make it available to crop. This means you can grab things instantaneously that popup and disappear, including windows that might disappear if they lose focus, or things like that. With this screen clipper utility, it will only capture after you're done drawing the box, and ongoing activity will continue to update the screen underneath it. BUT, this one will keep the graphics on the screen and can be customized to save, attach to an email, etc. So I'm hoping to get the best of both worlds eventually.

Nice work... this is really great :thumbup:

Re: Screen clipping

Posted: 14 Feb 2016, 21:32
by JJohnston2
Another thing I forgot about that was not working... the part that copies the screen to the clipboard without the border:

Code: Select all

SCW_Win2Clipboard(KeepBorders=0) {
   Send, !{PrintScreen} ; Active Win's client area to Clipboard
   if !KeepBorders
   {
      pToken := Gdip_Startup()
      pBitmap := Gdip_CreateBitmapFromClipboard()
      Gdip_GetDimensions(pBitmap, w, h)
      pBitmap2 := SCW_CropImage(pBitmap, 3, 3, w-6, h-6)
      Gdip_SetBitmapToClipboard(pBitmap2)
      Gdip_DisposeImage(pBitmap), Gdip_DisposeImage(pBitmap2)
      Gdip_Shutdown("pToken")
   }
}
Two things about this:
  • First, possibly because I am using a different version of GDIP and/or x64 issues, it just doesn't work for me... not sure how to go about tackling that one yet
  • Second, I'm pretty sure "pToken" should be passed as an argument, not in quotes, i.e., Gdip_Shutdown("pToken") should be Gdip_Shutdown(pToken)... that looks like a typo in the original code as far as I can tell that would mostly go unnoticed unless you're looking at the memory profile, where various pToken objects are accumulating over time and not actually being released

Help to make it work

Posted: 14 Jul 2016, 08:06
by rickss
Hi, this is a really great script, but I didn't get it to work!
01. When I press "Win + Left Button" and drag I see the rectangle being made, but when I release the "Left Button" nothing happens!

I am running the latest version of AHK, with Windows10 x64.
Please, help me.

Re: Screen clipping

Posted: 14 Jul 2016, 08:42
by Joe Glines
Can you confirm the script is actually running? Also you might throw in a messagebox right after the call to the hotkey to see if your hotkey is actually triggering anything

Re: Screen clipping

Posted: 14 Jul 2016, 09:08
by rickss
Yes, the script is running. I checked with a messagebox.

Btw, I've got it to work with the "Gdip All" (for other versions of AHK: 32, 64, unicode, ansi)
#Include %A_ScriptDir%\Gdip_All.ahk
This way the script seems to work properly.

Re: Screen clipping

Posted: 14 Jul 2016, 09:45
by Joe Glines
There should be no need to include it because I went through and extracted everything needed and included it in my file. Having said that, I wonder why it works when you do that. Can you send me the script you're running so I can review? [email protected]

Re: Screen clipping

Posted: 14 Jul 2016, 09:52
by rickss
I've just send it

Re: Screen clipping

Posted: 15 Jul 2016, 12:17
by Joe Glines
Just in case y'all have had the same issue as rickss, we figured out the issue. He's normally running the 64-bit version of AutoHotkey and thus caused the issue. I've updated the original code to detect what version it is running under and revert to 32 bit if it is launched in 64 bit code. (maestrith helped with that one)

Re: Screen clipping

Posted: 01 Aug 2016, 04:57
by DeepMind
This is awesome, thanks you for sharing man

Re: Screen clipping

Posted: 01 Aug 2016, 22:26
by BGM
Mr. Glines - I have been using this script now for awhile and I absolutely love it! I use it on my desktop all the time and even put it on my laptop.

So useful! I use win+drag to create the screen-snip and use it as reference.

Thank you so much for this!

Someone is copycatting your idea, though!
Look: http://www.snapfiles.com/get/snipaste.html

Re: Screen clipping

Posted: 02 Aug 2016, 06:21
by Joe Glines
DeepMind & BGM- I'm glad y'all find it helpful! I sure do as it is one of the scripts I use most often.

yes, there are a lot of "snipping" tools out there. I used the original one of this for quite awhile but added in the extra functionality which, for me, is what really makes it useful. :)

Re: Screen clipping

Posted: 03 Aug 2016, 17:04
by joshebosh
Hey Joe,

For what it's worth, I'm on Windows 10, 64bit, and the snipping did not work out of the box...
I noticed you had Gdip v1.38 in your script...
I replaced it with Gdip v1.45 and now things are working as I see in your youtube videos...

Thanks for all your effort! This is definitely cool stuff!!!

Re: Screen clipping

Posted: 03 Aug 2016, 18:24
by Joe Glines
Yeah- I use 32-bit of AutoHotkey. I added the below code which will relaunch the script if the current version is 64 bit but hadn't updated the original code yet.

Code: Select all

if((A_PtrSize=8&&A_IsCompiled="")||!A_IsUnicode){ ;32 bit=4  ;64 bit=8
    SplitPath,A_AhkPath,,dir
    if(!FileExist(correct:=dir "\AutoHotkeyU32.exe")){
	    MsgBox error
	    ExitApp
    }
    Run,"%correct%" "%A_ScriptName%",%A_ScriptDir%
    ExitApp
    return
}

Re: Screen clipping

Posted: 17 Oct 2016, 17:31
by redtwo
Hi. I love this script. However, I have to use a 125% zoom to text, apps, etc in Windows 10. It is the only way I can read the screen without killing my eyes. Because of this, the end of the rectangle is off with my mouse. I know I need a scaling factor but I don't know enough to know where to put it. Any suggestions?

H

Re: Screen clipping

Posted: 22 Oct 2016, 15:43
by rommmcek
Try to finde Gui %g%: +AlwaysOnTop -caption +Border +ToolWindow +LastFound and convert to Gui %g%: +AlwaysOnTop -caption +Border +ToolWindow +LastFound -DPIScale

Re: Screen clipping

Posted: 22 Oct 2016, 23:01
by paik1002
Unlike other people here, I am having trouble getting it running it to do what it claims, on my system(64-bit Windows 10).

Lwin+Lbutton+drag mouse brings up the yellow highlighted box alright.
However, nothing happens after that(releasing the mouse button should result in a final capture).
No screen capture, therefore no floating window.
The other hotkeys(i.e. e-mail & URL extensions) produce runtime errors staring at line 2508: imag.LoadFile(File_to_Upload).

I tested it in two different ways:
(1) Incorporating it into my existing script via "#Include %A_ScriptDir%\screenclip.ahk" where screenclip.ahk is the screen clipping script(full update version),
(2) Compiling and independently running it(without other AHK scipts running together).

Both non-compiled/compiled versions show similar symptoms, and both fail to work.
Suspecting version imcompatibility, I also tried setting the compatiblity mode to Windows 7 , but to no avail.

Help would be appreciated.

Re: Screen clipping

Posted: 23 Oct 2016, 20:18
by Joe Glines
Sorry I didn't see your post. The original post didn't work for 64 bit. I've updated it to detect if you're running 64 bit. If you are, it will switch to 32 bit version of AutoHotkey. that's what the following code is doing:

Code: Select all

if((A_PtrSize=8&&A_IsCompiled="")||!A_IsUnicode){ ;32 bit=4  ;64 bit=8
    SplitPath,A_AhkPath,,dir
    if(!FileExist(correct:=dir "\AutoHotkeyU32.exe")){
	    MsgBox error
	    ExitApp
    }
    Run,"%correct%" "%A_ScriptName%",%A_ScriptDir%
    ExitApp
    return
}