|
davidvan
|
 |
« on: October 15, 2009, 10:11:46 AM » |
|
Basically, I am currently using Screenshot Captor and I defined the PrtScr button to capture the active window each time I press it. What I hope to do is to eliminate the need to press the PrtScr button by leveraging the left-button click on mouse to trigger it. The left-mouse button click must still function as normal but now with an added function of simulating a press of the PrtScr button. Is there such a program available that can help me do this? Or can someone create a script to do this? Thank you in advance for any suggestions.
|
|
|
|
|
Logged
|
|
|
|
|
mouser
|
 |
« Reply #1 on: October 15, 2009, 10:32:08 AM » |
|
when we talked earlier i think an important aspect of what you wanted was not to trigger the hotkey every time you pressed the left mouse button, but only when you clicked left mouse button on the title bar of a menu.
|
|
|
|
|
Logged
|
|
|
|
|
davidvan
|
 |
« Reply #2 on: October 15, 2009, 10:59:37 AM » |
|
Yes, you are correct. However, after giving it some thoughts, I figured it may be easier to implement for every click then conditional clicks. If by making the request simpler, my hope is that I can find a close-enough solution sooner. Thanks.
|
|
|
|
|
Logged
|
|
|
|
|
|
skwire
|
 |
« Reply #3 on: October 15, 2009, 04:51:26 PM » |
|
This AutoHotkey code will send a PrintScreen every time you left click a titlebar. Save it out to something.ahk, run it, and left click a titlebar. Let me know if you have issues. Formatted for AutoIt with the GeSHI Syntax Highlighter [ copy or print] ~LButton:: { CoordMode, Mouse, Screen SetMouseDelay, -1 SetKeyDelay, -1 ; 0x84 is WM_NCHITTEST SendMessage, 0x84, , ( x & 0xFFFF ) | ( y & 0xFFFF ) << 16, , ahk_id %hWnd% If ErrorLevel in 2,3,8,9,20,21 { ; Send, !{PrintScreen} ; Sends an alt-printscreen. } }
|
|
|
|
« Last Edit: October 15, 2009, 05:12:55 PM by skwire »
|
Logged
|
|
|
|
|
mouser
|
 |
« Reply #4 on: October 15, 2009, 04:58:01 PM » |
|
just tested it.. works. very cool  to make it trigger Alt+Prtscr (screenshot captor's default for capturing the active window) skwire said to use "Send, !{PrintScreen}" That may be a small amount of code.. but there's a fair amount of knowledge behind it. Kudos to skwire for another amazing job. 
|
|
|
|
« Last Edit: October 15, 2009, 04:59:47 PM by mouser »
|
Logged
|
|
|
|
|
skwire
|
 |
« Reply #5 on: October 15, 2009, 05:05:07 PM » |
|
Thanks, mouser.  The kudos needs to go to Microsoft, however, for providing the window message that makes it easy to do stuff like that.
|
|
|
|
|
Logged
|
|
|
|
|
davidvan
|
 |
« Reply #6 on: October 15, 2009, 08:59:03 PM » |
|
Skwire, this is awesome! Thank you so much for such a quick turn-around. I will test it tomorrow in my work pc...but given the confirmation from mouser (thanks!), I know it will work for me.
One question: what change can I make to the code to have every mouse click trigger the prtscr without clicking on the titlebar? Is this significantly more difficult to achieve? Thanks!
|
|
|
|
|
Logged
|
|
|
|
|
skwire
|
 |
« Reply #7 on: October 15, 2009, 09:58:45 PM » |
|
You want every left mouse click, no matter where, to trigger a PrintScreen? If so: Formatted for AutoIt with the GeSHI Syntax Highlighter [ copy or print] ~LButton:: { ; Send, !{PrintScreen} ; Sends an alt-printscreen. }
|
|
|
|
|
Logged
|
|
|
|
|
davidvan
|
 |
« Reply #8 on: October 15, 2009, 11:51:07 PM » |
|
Thank you again. This is exactly what I was looking for!
A final question if I may (I promise):
If the mouse click in not on an application window (ie: desktop area, task bar, Start, etc.), can I not trigger the prtscr? In other words, can I trigger only when a click is in an app window (including the title bar and border)?
|
|
|
|
|
Logged
|
|
|
|
|
skwire
|
 |
« Reply #9 on: October 16, 2009, 12:38:09 AM » |
|
This should do it (under XP, at least): Formatted for AutoIt with the GeSHI Syntax Highlighter [ copy or print] ~LButton:: { CoordMode, Mouse, Screen SetMouseDelay, -1 SetKeyDelay, -1 WinGetClass , myClass , % "ahk_id " . hWnd If myClass not in Progman ,Shell_TrayWnd { } }
|
|
|
|
« Last Edit: October 16, 2009, 12:41:48 AM by skwire »
|
Logged
|
|
|
|
|
davidvan
|
 |
« Reply #10 on: October 16, 2009, 11:22:38 AM » |
|
Skwire, this is perfect! Thank you again for all your help!
|
|
|
|
|
Logged
|
|
|
|
|
skwire
|
 |
« Reply #11 on: October 16, 2009, 12:56:33 PM » |
|
You're welcome. Happy to help. 
|
|
|
|
|
Logged
|
|
|
|
|