Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Capture Qm Window
Hi everyone thought i would share a little function i use a lot for creating instant screenshots of the Quick Macros window 

requires GDI+ get it here-->> Get GDI+

Trigger: Ctrl+Prnt Scrn

Function CaptureQmWindow 
Trigger C(44)     Help - how to add the trigger to the macro
Select All      Help
;Captures QM Window and saves as a png(or see below) using GDI+
;Supported formats: bmp, gif, jpg, png, tiff.(png recomended)
;creates a unique file name to avoid saving problems
;requires GDI+ download it here <link "">Get GDI+</link>

if(getopt(nthreads)>1) ret
spe -2
;create file data
mkdir "QM_WindowImages" "$desktop$";;create folder if it doesnt exist to save images in
str sFolderName = "$desktop$\QM_WindowImages\"
str sFileName.timeformat("{yyyy-MM-dd}_{HH-mm-ss}_QmWindow");;unique filename to avoid problems
str sFormat = ".png";;i use png for smaller filesize
str sFile.format("%s%s%s" sFolderName sFileName sFormat)

;captures QM Window to memory
__GdiHandle hb
RECT r; DpiGetWindowRect _hwndqm &r
CaptureImageOnScreen r.left r.right-r.left "" hb

;save image
#compile "__Gdip"
GdipBitmap im
if(!im.FromHBITMAP(hb)) end "error"
if(!im.Save(sFile)) end "error"
;open folder where image is saved
run sFolderName
;optional open file
;run sFile;;uncomment this line to use
requires GDI+ get it here-->> Get GDI+

Forum Jump:

Users browsing this thread: 1 Guest(s)