c++ - Quicker alternative to WinAPI PrintWindow()? -
i'm writing program, continuously scans pixels of open windows (which might in background) , reacts on change. i'm using next code:
hdc clientprofile::preparesurface() { updatewindow(handle); hdc window_dc = getdc(handle); hdc res = createcompatibledc(window_dc); rect r; getclientrect(handle, &r); hbitmap bmp = createcompatiblebitmap(window_dc, r.right - r.left, r.bottom - r.top); selectobject(res, bmp); printwindow(handle, res, pw_clientonly); deleteobject(bmp); releasedc(handle, window_dc); homecoming res; }
i utilize getpixel() on returned hdc. works absolutely fine, when scanning alot of windows simultaneously, it's little bit slow needs. noticed time printwindow() consumes varies based on application scans (probably because of way message handled?). there way speed up? tried use
sendmessage(handle,wm_print/wm_printclient, wparam(res),prf_client);
but didn't work @ (would create difference?). couldn't find other solution problem, 1 around here have 1 maybe?
thanks in advance.
c++ windows winapi screenshot
No comments:
Post a Comment