Click here to Skip to main content
15,921,646 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Newbie Question Pin
kenexcelon16-Sep-05 13:58
kenexcelon16-Sep-05 13:58 
QuestionRun Shellexecute and wait for it to return Pin
anderslundsgard16-Sep-05 9:51
anderslundsgard16-Sep-05 9:51 
AnswerRe: Run Shellexecute and wait for it to return Pin
David Crow16-Sep-05 10:09
David Crow16-Sep-05 10:09 
GeneralRe: Run Shellexecute and wait for it to return Pin
hunter1316-Sep-05 10:33
hunter1316-Sep-05 10:33 
QuestionIrregularly spaced x,y,z data to regular contours Pin
Chris Maunder16-Sep-05 9:47
cofounderChris Maunder16-Sep-05 9:47 
AnswerRe: Irregularly spaced x,y,z data to regular contours Pin
Yongki C. A. Jong17-Sep-05 6:11
Yongki C. A. Jong17-Sep-05 6:11 
AnswerRe: Irregularly spaced x,y,z data to regular contours Pin
cmk17-Sep-05 17:54
cmk17-Sep-05 17:54 
Questioncapturing window image through its handle Pin
Neo_MXP16-Sep-05 9:34
Neo_MXP16-Sep-05 9:34 
here is my code:
---------------------------------------------
RECT rect;
GetWindowRect(hWnd, & rect);

HDC hDC = GetDC(hWnd);
HDC hDCMem = CreateCompatibleDC(hDC);
HBITMAP hBmp = NULL;

hBmp = CreateCompatibleBitmap(hDC, rect.right - rect.left, rect.bottom - rect.top);

HGDIOBJ hOld = SelectObject(hDCMem, hBmp);
SendMessage(hWnd, WM_PRINT, (WPARAM) hDCMem, PRF_CHILDREN | PRF_CLIENT | PRF_ERASEBKGND | PRF_NONCLIENT | PRF_OWNED);
SelectObject(hDCMem, hOld);

OpenClipboard(NULL);
EmptyClipboard();
SetClipboardData(CF_BITMAP, hBmp);
CloseClipboard();

DeleteDC(hDCMem);
ReleaseDC(hWnd,hDC);
---------------------------------------------

if hWnd holds the handle of the window of the same program in which i place this code then it works fine. but if i store another program's window's handle in it then it gives me black image. the size of the image is according to the window whose handle was given but the image is totally black. i get the handle of other windows through the FindWindow fucntion.

can anybody tell me where did i go wrong?
AnswerRe: capturing window image through its handle Pin
hunter1316-Sep-05 9:41
hunter1316-Sep-05 9:41 
GeneralRe: capturing window image through its handle Pin
hunter1316-Sep-05 9:50
hunter1316-Sep-05 9:50 
GeneralRe: capturing window image through its handle Pin
Anonymous16-Sep-05 9:59
Anonymous16-Sep-05 9:59 
QuestionConvert ASCII to HEX Pin
RedDragon2k16-Sep-05 9:25
RedDragon2k16-Sep-05 9:25 
AnswerRe: Convert ASCII to HEX Pin
hunter1316-Sep-05 9:35
hunter1316-Sep-05 9:35 
GeneralRe: Convert ASCII to HEX Pin
RedDragon2k16-Sep-05 10:07
RedDragon2k16-Sep-05 10:07 
GeneralRe: Convert ASCII to HEX Pin
hunter1316-Sep-05 10:24
hunter1316-Sep-05 10:24 
GeneralRe: Convert ASCII to HEX Pin
David Crow16-Sep-05 10:38
David Crow16-Sep-05 10:38 
GeneralRe: Convert ASCII to HEX Pin
gamitech16-Sep-05 10:34
gamitech16-Sep-05 10:34 
AnswerRe: Convert ASCII to HEX Pin
David Crow16-Sep-05 10:04
David Crow16-Sep-05 10:04 
QuestionNetAddShare under NTFS Pin
hunter1316-Sep-05 7:48
hunter1316-Sep-05 7:48 
AnswerRe: NetAddShare under NTFS Pin
David Crow16-Sep-05 8:01
David Crow16-Sep-05 8:01 
GeneralRe: NetAddShare under NTFS Pin
hunter1316-Sep-05 9:20
hunter1316-Sep-05 9:20 
GeneralRe: NetAddShare under NTFS Pin
David Crow16-Sep-05 16:37
David Crow16-Sep-05 16:37 
AnswerRe: NetAddShare under NTFS Pin
Anonymous16-Sep-05 20:36
Anonymous16-Sep-05 20:36 
GeneralRe: NetAddShare under NTFS Pin
David Crow17-Sep-05 14:57
David Crow17-Sep-05 14:57 
QuestionHow to get LAN connected duration Pin
Member 222024516-Sep-05 7:22
Member 222024516-Sep-05 7:22 

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.