#Include GDIPlusHelper.ahk ; see: http://www.autohotkey.com/forum/viewtopic.php?t=11860 for orignal OnExit, handle_exit main: SetWorkingDir C:\Users\Jeremy\Desktop\Inbox ;FileCreateDir, screens ;FileCreateDir, thumbs WinGet, hw_frame, id, "Program Manager" ; Desktop ? hdc_frame := DllCall( "GetDC", "uint", hw_frame ) hdc_frame_full := DllCall( "GetDC", "uint", hw_frame ) counter:=0 ; thumbnails counter_f:=0 ; fullscreens thumb_w:= 500 thumb_h:= ceil( thumb_w * A_ScreenHeight / A_ScreenWidth ) ; keep screenratio use_antialize := 1 ; buffer hdc_buffer := DllCall( "gdi32.dll\CreateCompatibleDC" , "uint", hdc_frame ) hbm_buffer := DllCall( "gdi32.dll\CreateCompatibleBitmap" , "uint", hdc_frame, "int", thumb_w, "int", thumb_h ) r := DllCall( "gdi32.dll\SelectObject" , "uint", hdc_buffer, "uint", hbm_buffer ) hdc_buffer_full := DllCall( "gdi32.dll\CreateCompatibleDC" , "uint", hdc_frame_full ) hbm_buffer_full := DllCall( "gdi32.dll\CreateCompatibleBitmap" , "uint", hdc_frame_full, "int", A_ScreenWidth, "int", A_ScreenHeight ) r_full := DllCall( "gdi32.dll\SelectObject" , "uint", hdc_buffer_full, "uint", hbm_buffer_full ) ; comment this line for speed but less quality if use_antialize = 1 DllCall( "gdi32.dll\SetStretchBltMode", "uint", hdc_buffer, "int", 4 ) ; Halftone better quality with stretch return ;#+SC137:: ; Windows Key + Print Screen #SC137:: ; Windows Key + Print Screen SaveImage: counter := counter +1 FormatTime, myTime, , yyyyMMdd_hhmmss fileNameDestP = SMALL-T_%myTime%_%counter%_%thumb_w%x%thumb_h%.png If (GDIplus_Start() != 0) Goto GDIplusError ; Copy BMP from DC DllCall( "gdi32.dll\StretchBlt" , "uint", hdc_buffer, "int", 0, "int", 0, "int", thumb_w, "int", thumb_h , "uint", hdc_frame, "int", 0, "int", 0, "int", A_ScreenWidth, "int", A_ScreenHeight, "uint", 0x00CC0020 ) DllCall( "GDIplus\GdipCreateBitmapFromHBITMAP", uint, hbm_buffer, uint, 0, uintp, bitmap ) ; Save to PNG If (GDIplus_GetEncoderCLSID(pngEncoder, #GDIplus_mimeType_png) != 0) Goto GDIplusError noParams = NONE If (GDIplus_SaveImage(bitmap, fileNameDestP, pngEncoder, noParams) != 0) Goto GDIplusError Gosub GDIplusStop ;Return ;#SC137:: ; Windows Key + Print Screen SaveImage_Full: counter_f := counter_f +1 FormatTime, myTime, , yyyyMMdd_hhmmss fileNameDestP = FULL-S_%myTime%_%counter_f%_%A_ScreenWidth%x%A_ScreenHeight%.png If (GDIplus_Start() != 0) Goto GDIplusError ; Copy BMP from DC DllCall( "gdi32.dll\BitBlt" , "uint", hdc_buffer_full, "int", 0, "int", 0, "int", A_ScreenWidth, "int", A_ScreenHeight , "uint", hdc_frame_full, "int", 0, "int", 0, "uint", 0x00CC0020 ) DllCall( "GDIplus\GdipCreateBitmapFromHBITMAP", uint, hbm_buffer_full, uint, 0, uintp, bitmap ) ; Save to PNG If (GDIplus_GetEncoderCLSID(pngEncoder, #GDIplus_mimeType_png) != 0) Goto GDIplusError noParams = NONE If (GDIplus_SaveImage(bitmap, fileNameDestP, pngEncoder, noParams) != 0) Goto GDIplusError Gosub GDIplusStop Return GDIplusError: GDIplusStop: If (#GDIplus_lastError != "") MsgBox 16, GDIplus Test, Error in %#GDIplus_lastError% GDIplus_Stop() Return #q:: handle_exit: DllCall( "gdi32.dll\DeleteObject", "uint", hbm_buffer ) DllCall( "gdi32.dll\DeleteDC" , "uint", hdc_frame ) DllCall( "gdi32.dll\DeleteDC" , "uint", hdc_buffer ) ExitApp RAlt::Home RCtrl::End #i:: { Run "C:\Users\Jeremy\Desktop\Inbox" } return #p:: { Run "C:\Users\Jeremy\Desktop\Processing" } return #o:: { Run "C:\Users\Jeremy\Desktop\Outbox" } return #a:: { Run "C:\Users\Jeremy\Desktop\Archive.lnk" } return #c:: { Run "I:\Campaign 2007\" } return #b:: { Run "C:\Users\Jeremy\Desktop\Processing\Chamber\Blitz" } return #!r:: { Run http://www.google.com/reader/view/ } return #s:: { Run "C:\Program Files\Mozilla Thunderbird\thunderbird.exe" -compose } return #+s:: { Run "C:\Program Files\Mozilla Thunderbird\thunderbird.exe" -compose WinWait, Compose: (no subject) Send {tab}{tab}^v } return ;SC15D::SC15D Menu Button #t:: { Run "C:\Users\Jeremy\Desktop\Processing\Chamber\NewTimesheet.xlsx" } return #!t:: DetectHiddenWindows, on IfWinNotExist ahk_class 32770 { Run "c:\InstantRails\InstantRails.exe" WinWait, Instant Rails ; WinMinimize } Run "C:\Program Files\cmdow\tracks.bat" DetectHiddenWindows, off return #!s:: IfWinNotExist cmdowlocation.txt - Notepad { Run "C:\Program Files\cmdow\showtracks.bat" } else { ; MsgBox %clipboard% Run C:\Program Files\cmdow\cmdow.exe %clipboard% /VIS } return ; Launch console if necessary; hide/show on Win+` #`:: DetectHiddenWindows, on IfWinExist ahk_class Console Main Command Window { IfWinActive ahk_class Console Main Command Window { WinHide ahk_class Console Main Command Window ; need to move the focus somewhere else. WinActivate ahk_class Shell_TrayWnd } else { WinShow ahk_class Console Main Command Window WinActivate ahk_class Console Main Command Window } } else Run console ; the above assumes a shortcut in the c:\windows folder to console.exe. ; also assumes console is using the default console.xml file, or ; that the desired config file is set in the shortcut. DetectHiddenWindows, off return ; Launch console if necessary; hide/show on Win+Shift+` #+`:: DetectHiddenWindows, on IfWinExist ahk_class Console Main Command Window { IfWinActive ahk_class Console Main Command Window { WinHide ahk_class Console Main Command Window ; need to move the focus somewhere else. WinActivate ahk_class Shell_TrayWnd } else { WinShow ahk_class Console Main Command Window WinActivate ahk_class Console Main Command Window } } else Run consolecyg ; the above assumes a shortcut in the c:\windows folder to console.exe. ; also assumes console is using the default console.xml file, or ; that the desired config file is set in the shortcut. DetectHiddenWindows, off return ; hide console on "esc". #IfWinActive ahk_class Console Main Command Window esc:: { WinHide ahk_class Console Main Command Window WinActivate ahk_class Shell_TrayWnd } return