Click here to Skip to main content
15,896,557 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: problem with CString Pin
Zac Howland19-Sep-06 4:57
Zac Howland19-Sep-06 4:57 
GeneralRe: problem with CString Pin
David Crow19-Sep-06 7:17
David Crow19-Sep-06 7:17 
GeneralRe: problem with CString Pin
Zac Howland19-Sep-06 8:17
Zac Howland19-Sep-06 8:17 
GeneralRe: problem with CString Pin
PJ Arends19-Sep-06 9:06
professionalPJ Arends19-Sep-06 9:06 
AnswerRe: problem with CString Pin
David Crow19-Sep-06 4:56
David Crow19-Sep-06 4:56 
AnswerRe: problem with CString Pin
Trollslayer19-Sep-06 5:57
mentorTrollslayer19-Sep-06 5:57 
QuestionRe: problem with CString Pin
David Crow19-Sep-06 7:22
David Crow19-Sep-06 7:22 
Questionhow to get window content , when window is invisible Pin
astabasta19-Sep-06 3:19
astabasta19-Sep-06 3:19 
hi.

i would like to get the content (graphics) of a window whose HWND i have, but it is not visible (meaning, visible as in WM_VISIBLE, but not to the human eye i.e. concealed by other windows).
And i would like to do this without bringing the window to the front, as this takes too much time.

i tried the following:
<pre>
HDC hdcWind = GetDC(windowHWND);
HDC hdcComp = CreateCompatibleDC(hdcWind);
HBITMAP hbmWind = CreateCompatibleBitmap(hdcWind,
GetDeviceCaps(hdcWind, HORZRES),
GetDeviceCaps(hdcWind, VERTRES));
SelectObject(hdcComp,hbmWind);

BitBlt(hdcComp,0,0,100,100,hdcWind,0,0,SRCCOPY);
</pre>

Then to display the result i did:
<pre>
HDC hdcScreen = CreateDC("DISPLAY",NULL,NULL,NULL);

BitBlt(hdcScreen,0,0,100,100,hdcComp,0,0);

ReleaseDC(hdcWind);
</pre>

It draws an image onto the left top corner of my screen. The size is correct and the top left corner of the drawing is even taken from the correct point (top left corner of the windowHWND !!). But the contents of the drawing is the background at the moment of execution. As if he gets the window, uses its position to take the "picture", but the window is "invisible" and gets only the background.

Every and any help will be much appreciated.

Thank you

imran
AnswerRe: how to get window content , when window is invisible Pin
Naveen19-Sep-06 3:26
Naveen19-Sep-06 3:26 
GeneralRe: how to get window content , when window is invisible Pin
astabasta19-Sep-06 4:08
astabasta19-Sep-06 4:08 
GeneralRe: how to get window content , when window is invisible Pin
Naveen19-Sep-06 4:20
Naveen19-Sep-06 4:20 
GeneralRe: how to get window content , when window is invisible Pin
astabasta19-Sep-06 5:07
astabasta19-Sep-06 5:07 
GeneralRe: how to get window content , when window is invisible Pin
astabasta19-Sep-06 10:41
astabasta19-Sep-06 10:41 
GeneralRe: how to get window content , when window is invisible Pin
Naveen19-Sep-06 17:04
Naveen19-Sep-06 17:04 
GeneralRe: how to get window content , when window is invisible Pin
astabasta20-Sep-06 2:18
astabasta20-Sep-06 2:18 
GeneralRe: how to get window content , when window is invisible Pin
Naveen20-Sep-06 2:21
Naveen20-Sep-06 2:21 
GeneralRe: how to get window content , when window is invisible Pin
Naveen31-Jan-07 0:45
Naveen31-Jan-07 0:45 
AnswerRe: how to get window content , when window is invisible Pin
Jun Du19-Sep-06 3:45
Jun Du19-Sep-06 3:45 
GeneralRe: how to get window content , when window is invisible Pin
astabasta19-Sep-06 4:11
astabasta19-Sep-06 4:11 
GeneralRe: how to get window content , when window is invisible Pin
Jun Du19-Sep-06 5:00
Jun Du19-Sep-06 5:00 
QuestionWriting Code for 64-bit windows Pin
vikas amin19-Sep-06 3:17
vikas amin19-Sep-06 3:17 
AnswerRe: Writing Code for 64-bit windows Pin
Dimitris Vikeloudas20-Sep-06 23:17
Dimitris Vikeloudas20-Sep-06 23:17 
QuestionInline editing: How explorer does it? Pin
Dimitris Vikeloudas19-Sep-06 3:02
Dimitris Vikeloudas19-Sep-06 3:02 
QuestionDrawing over a window - directdraw overlay? Pin
Andrew Altham19-Sep-06 2:50
Andrew Altham19-Sep-06 2:50 
Questionatlres.h missing Pin
neha.agarwal2719-Sep-06 2:24
neha.agarwal2719-Sep-06 2:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.