DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: Interaction with ScreenClippings AHK Script  (Read 8,225 times)

BGM

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 566
    • Participated in NANY Challenge Seven Times
Interaction with ScreenClippings AHK Script
« on: January 02, 2016, 03:46 PM »
Recently I found an AHK script called ScreenClippings.

It has a feature where you can capture a portion of the screen and it becomes a floating panel.
This is very useful if you need to use the area as a reference.  Sometimes I do this in certain dialogue windows and then I use the information somewhere else.

Also, I like being able to capture an area by this scripts hotkey: hold win key and draw with the mouse.  To me this is a much better way than pushing a hotkey and then drawing.  The ahk script allows me to draw the box immediately and not have to wait for the crosshair lines to appear.  I just draw the box and the image is captured - it's so fast.

Maybe ScreenshotCaptor could do these things too?

Also, a weird thing happens.  When I use the script to capture an area (by holding win+ctrl and drawing a box) then ScreenshotCaptor thinks I'm trying to capture a particular object (SC's hotkey is alt+printscreen), but I haven't pushed either alt or the printscreen key!  Weird!

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • Coding Snacks
    • Volunteers/Staff
    • Gathering Badge
    • Participated in NANY Challenge Once
    • Linux User
Re: Interaction with ScreenClippings AHK Script
« Reply #1 on: January 03, 2016, 04:06 AM »
Also, a weird thing happens.  When I use the script to capture an area (by holding win+ctrl and drawing a box) then ScreenshotCaptor thinks I'm trying to capture a particular object (SC's hotkey is alt+printscreen), but I haven't pushed either alt or the printscreen key!  Weird!

that happens because the script is sending the alt+printscreen combo internally in this function, SCW_Win2Clipboard (line 7 below). cool script btw!

Code: ( autohotkey)
SCW_Win2Clipboard(KeepBorders=0) {
   /*   ;   does not work for layered windows
   ActiveWinID := WinExist("A")
   pBitmap := Gdip_BitmapFromHWND(ActiveWinID)
   Gdip_SetBitmapToClipboard(pBitmap)
   */
   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")
   }
}

BGM

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 566
    • Participated in NANY Challenge Seven Times
Re: Interaction with ScreenClippings AHK Script
« Reply #2 on: January 03, 2016, 05:37 AM »
I disabled alt+printscreen combo in ScreenshotCaptor and the problem went away.
It's funny though, because when it first happened I was really surprised - I had never used SC to capture a control before and I thought it was something produced by the script!  Then I saw the SC icon somewhere and got to thinking.
Funny!

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • Coding Snacks
    • Volunteers/Staff
    • Gathering Badge
    • Participated in NANY Challenge Once
    • Linux User
Re: Interaction with ScreenClippings AHK Script
« Reply #3 on: January 03, 2016, 07:46 AM »
I disabled alt+printscreen combo in ScreenshotCaptor and the problem went away.
It's funny though, because when it first happened I was really surprised - I had never used SC to capture a control before and I thought it was something produced by the script!  Then I saw the SC icon somewhere and got to thinking.
Funny!

It's a good thing you noticed the flashing ScreenshotCaptor icon and problem solved.

Original address: https://www.donationcoder.com/forum/index.php?topic=42148.0