Drugwash wrote:
Drawbacks:
Can't work in Win9x because of unsupported Up/Down hotkey variants.
No problem, we can change that: Send ^v.
Drugwash wrote:
Directly calls MSPaint.exe, which is bad practice (same as directly calling iexplore.exe).
I've never had a problem with direct callimg a standard windows program in XP or Vista, that's why I put it that way, but there can be issues in some cases - you are right. Let's make it:
run %A_WinDir%\System32\mspaint.exe.
Drugwash wrote:
Subsequent hotkey presses open multiple copies of MSPaint.
True. This is what I meant it to do. I find it convenient to have a seperate instance of mspaint for each screenshot. However, it doesn't have to be this way only, below I provide a revised script that pastes screenshots into the same most recently used instance of mspaint. (Least recently used would be WinActivateBottom, ahk_class MSPaintApp > Send ).
Drugwash wrote:
Advantages:
Takes into account multi-monitor environments.
Perhaps it does, I do not have a multi-monitor environment at the time. If it does, the credit goes to Microsoft.
PrintScreen is not that bad, Mspaint editor is good enough to quickly cut a region from a screenshot. PrintScreen captures Aero and movies just fine, at least that's what I can do with ~PrintScreen~ in my Server 2008 right now:



For advanced screen capturing purposes I sometimes use HyperSnap DX, WinSnap, and Fraps. But the latest versions of these aren't applicable to quite a few modern games. So, Microsoft Printscreen is a good freeware alternative and is convinient to use with freeware Autohotkey.
Revised script that pastes screenshots into the same most recently used instance of mspaint:
Code:
; By Roman Sibirko
#NoEnv
#SingleInstance Force
#MaxThreadsBuffer, Off
#MaxThreadsPerHotkey, 1
#HotKeyModifierTimeOut, 500
SendMode Event
SetKeyDelay, 50
Menu, Tray, Icon, Shell32.dll, 81
Menu, Tray, Icon,,, 1
Menu, Tray, NoStandard
Menu, Tray, Tip, ~PrintScreen~
Menu, Tray, Color, C0C0C0
Menu, Tray, Add, Snapshot
Menu, Tray, Add, Pause
Menu, Tray, Add, Exit
Return
Snapshot:
GoSub, PrntScr
Return
Pause:
Menu, Tray, ToggleCheck, Pause
Suspend, Toggle
Return
Exit:
ExitApp
$F9::
Hotkey, F9, Off
Hotkey, F12, Off
#MaxThreadsPerHotkey, 1
Critical, On
BlockInput, On
Send {Blind}
Send !{PrintScreen}
BlockInput, Off
BlockInput, Off
KeyWait, F9, U
IfWinNotExist, ahk_class MSPaintApp
{
Run %A_WinDir%\System32\mspaint.exe
WinWait, Paint ahk_class MSPaintApp, , 5
}
Sleep 150
BlockInput, On
Send {Blind}
WinActivate, ahk_class MSPaintApp
ControlSend, , ^{v}, ahk_class MSPaintApp
BlockInput, Off
BlockInput, Off
Hotkey, F9, On
Hotkey, F12, On
Return
$F12::
PrntScr:
Hotkey, F9, Off
Hotkey, F12, Off
#MaxThreadsPerHotkey, 1
Critical, On
BlockInput, On
Send {Blind}
Send {PrintScreen}
BlockInput, Off
BlockInput, Off
KeyWait, F12, U
IfWinNotExist, ahk_class MSPaintApp
{
Run %A_WinDir%\System32\mspaint.exe
WinWait, Paint ahk_class MSPaintApp, , 5
}
WinActivate, ahk_class MSPaintApp
Sleep 150
BlockInput, On
Send {Blind}
ControlSend, , ^{v}, ahk_class MSPaintApp
BlockInput, Off
BlockInput, Off
Hotkey, F9, On
Hotkey, F12, On
Return
drainx1 wrote:
it works in viista too!
DHMH wrote:
Thank you!
Its a great Script!
Greets,
DHMH
SoggyDog wrote:
Thanks, Rom.
Thank you drainx1, DHMH, SoggyDog, Drugwash, thanks to all who participate in the autohotkey forums. Thank you for helping learn things, thank you for sharing links, and best regards to everyone.
Roman.