c++ - BitBlt not working for Office 2013 -


i'm using bitblt screenshots of windows on user's desktop. i've found works windows programs. however, bitblt returns blank pixels office 2013 windows (word, powerpoint, etc).

printwindow work these office 2013 windows, has higher processor overhead. i'd rather use bitblt if possible.

any ideas why bitblt not work office 2013 windows?

code snippet below.

thanks

update: bitblt(...) returns true. changing code capture entire desktop instead of appwin captures office 2013 window correctly, see post. can capture whole desktop , extract desired window. however, loses 1 cool thing new dwm allows software capture images windows not in foreground.

is there better way allow system both capture office 2013 type windows , capture images windows not in foreground?

update 2: when doing bitblt on appwin, looks first bitblt gives valid pixel data, subsequent bitblts give blank pixels. not sure why may important data point.

int texusize = 1024; int texvsize = 1024;  rect rect; getclientrect(appwin, &rect); int appw = rect.right - rect.left; int apph = rect.bottom - rect.top;  // create bitmap in memory, write texture pixels bitmap hdc hdc = getdc(appwin); hdc hdc_app = createcompatibledc(hdc); hdc hdc_tex = createcompatibledc(hdc); hbitmap hbmp_app = createcompatiblebitmap(hdc, appw, apph); hbitmap hbmp_tex = createcompatiblebitmap(hdc, texusize, texvsize); hbitmap hbmp_appold = (hbitmap)selectobject(hdc_app, hbmp_app); hbitmap hbmp_texold = (hbitmap)selectobject(hdc_tex, hbmp_tex);  // due new desktop window manager, windows vista , windows 7 can bitblt app window // windows xp has issues bitblt if app window covered different window if (false)//bvista7 || (getforegroundwindow() == appwin)) {     appoutputdebugstringf(text("-- bitblting"));     bitblt(hdc_app, 0, 0, appw, apph, hdc, 0, 0, srccopy); } else {     appoutputdebugstringf(text("-- printwindow"));     printwindow(appwin, hdc_app, null); }