05-12-2015, 10:40 AM
Macro Macro2519
int w=win("Paint" "MSPaintApp")
;get all pixels of window client area
PerfFirst
dll- user32 #PrintWindow hwnd hdcBlt nFlags
if(_winver<0x501) end "unavailable on Windows 2000"
RECT r; GetClientRect w &r
__MemBmp m.Create(r.right r.bottom)
if(!PrintWindow(w m.dc 1)) end "failed"
;find two colors
int f1 f2
PerfNext
f1=scan("color:0x1de6b5" m.bm 0 0x200)
PerfNext
f2=scan("color:0x1de6b6" m.bm 0 0x200)
PerfNext
PerfOut
out "%i %i" f1 f2
;__TempFile t.Init(".bmp"); SaveBitmap(m.bm t); run t; 1 ;;debug. PrintWindow does not work with some windows, then the bitmap is black. Some window parts may be different.
;The PerfX functions measure speed. Remove.