Advertisement

anyone give me a sample about direct access the DC surface

Started by April 11, 2001 02:00 AM
2 comments, last by FancyZero 23 years, 10 months ago
anyone give me a sample about direct access GDI DC Not in MFC andy i mean direct access the surface Tahnx! Edited by - fancyzero on April 11, 2001 3:01:59 AM Edited by - fancyzero on April 12, 2001 7:59:32 AM
GetSafeHdc( ).

Seriously tho, directly accessing it from where, and for what?

-fel

~ The opinions stated by this individual are the opinions of this individual and not the opinions of her company, any organization she might be part of, her parrot, or anyone else. ~
Advertisement
Are you looking for API funcion

HDC GetDC( HWND hWnd );

Earlier today i used it like this to draw on the windows calc app

//first get a window handle (your prog or other window).
//Param 1 is a class name (if more than one "Calculator"?)
HWND hwnd = FindWindowA(NULL,"Calculator");

//now get a handle to that window''s dc
HDC hdc = GetDC(hwnd);

//Draw shapes, print text -- whatever.
TextOut(hdc,50,50,"BLAH",4);
Ellipse(hdc,10,10,500,500);

Not sure if this is what you mean...

-McAnthrax
You could use directx.

HRESULT GetSurfaceFromDC(hdc,lpDDS);

and then use

HRESULT Lock(
LPRECT lpDestRect,
LPDDSURFACEDESC2 lpDDSurfaceDesc,
DWORD dwFlags,
HANDLE hEvent
);
to directly access surface.

God saw all that he had made. Shit happens sometimes. --the sixth day.

This topic is closed to new replies.

Advertisement