1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
LRESULT CALLBACK
WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
PAINTSTRUCT ps;
HDC hdc = 0;
HDC tHDC = 0;
HWND hWndApp = 0;
switch(msg)
{
case WM_DESTROY:
PostQuitMessage(0);
return 0;
case WM_PAINT:
hWndApp = FindWindow(0,"Test");
hdc = BeginPaint(hWnd, &ps);
tHDC = GetDC(hWndApp);
BitBlt(hdc, 0, 0, 500, 500, tHDC, 0, 0, SRCCOPY);
ReleaseDC(hWndApp, tHDC);
EndPaint(hWnd, &ps);
return 0;
}
return DefWindowProc(hWnd, msg, wParam, lParam);
}
|