desktop image capturing??

I am doing a final year project to remotely access and control the desktop of a separate computer to the
one I am working on ( something like PcAnywhere ).

What would be the best way of capturing the current image on the desktop of the remote computer into some kind of bit map??

Also if you know where I can find information on the functions contained in the DirectDraw part of
DirecttX 5.0, I would be very grateful??
ross_nolanAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
viktornetConnect With a Mentor Commented:
Here are all the APIs that I've used and their declarations in C as well as the DLLs that they come form......
//---------------------------------------------------------
HWND GetDesktopWindow(VOID); ---> user32.dll
//---------------------------------------------------------
HDC GetDC(HWND hWnd); --->  user32.dll
//---------------------------------------------------------
int ReleaseDC(

    HWND hWnd,      // handle of window
    HDC hDC       // handle of device context  
   ); ---> user32.dll
//---------------------------------------------------------
BOOL BitBlt(

    HDC hdcDest,      // handle to destination device context
    int nXDest,      // x-coordinate of destination rectangle's upper-left corner
    int nYDest,      // y-coordinate of destination rectangle's upper-left corner
    int nWidth,      // width of destination rectangle
    int nHeight,      // height of destination rectangle
    HDC hdcSrc,      // handle to source device context
    int nXSrc,      // x-coordinate of source rectangle's upper-left corner  
    int nYSrc,      // y-coordinate of source rectangle's upper-left corner
    DWORD dwRop       // raster operation code
   ); ---> gdi32.dll
//---------------------------------------------------------

Regards,
Viktor Ivanov
0
 
thresher_sharkCommented:
What language are you programming in?  If you are using MFC, look into CBitmap and BitBlt.
0
 
MadshiCommented:
You could do this with DirectDraw (if you need infos, download directX SDK from www.microsoft.com). But I think that could be managed with "normal" functions like BitBlt, too.
BTW, PcAnywhere only transfers the first bitmap as a bitmap. After that it transfers something like GDI commands, I guess. Probably you know that, just wanted to mention that. Have you solved this problem already? That seems to be the more difficult one...

Regards, Madshi.
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
viktornetCommented:
I don't know what programming environment are you using but here is how.//
this code is for Delphi...
var
   DC : hDC;
   H : HWND;
begin
  H := GetDesktopWindow;
  DC := GetDC(H);
  BitBlt(Image1.Canvas.Handle, 0, 0, Width, height, DC, 0, 0, SRCCOPY);
  ReleaseDC(H, DC);
end;

Let me examplain the parameters...

H is decalred as a Handle
DC is declared as a Device Context

H := GetDesktopWindow;//This gets the handle of the Desktop..API call

DC := GetDC(H);//This gets the Device Context of the Desktop...API call

BitBlt(Image1.Canvas.Handle, 0, 0, Width, height, DC, 0, 0, SRCCOPY);
//BitBlt is an API call so you can see the API help file for that..
//On the place of the Image1.Canvas.Handle put the Handle to the Bitmap Canvas' Handle

ReleaseDC(H, DC);//This releases the Device Context...

Regards,
Viktor Ivanov
0
 
ross_nolanAuthor Commented:
I am just starting the research into this project and I considering doing the application in Visual C++ or maybe VB,  but my preference is VC.

Any additional information that you can give as guidence would be appriciated very much in relation to these programming environments.

cheers

0
 
viktornetCommented:
Yes you can use all of that in your VC app since these all are an API calls...

It would be something like this in VC

{
        HDC DC;
        HWND H; //I don't know how to declare handles in VC..maybe HWND is not the right type
       H := GetDesktopWindow(); //API call
       DC := GetDC(H);//API call
       BitBlt(Image1->Canvas->Handle, 0, 0, Width, Height, DC, 0, 0, SRCCOPY); //API call
       ReleaseDC(H, DC); //API call
}

Where it says Image1->Canvas->Handle you need to give the Handle to the Bitmap's or whatever it is,  Handle......

//Viktor Ivanov
0
 
ross_nolanAuthor Commented:
could you please specify what dll's used would I be using??

thanks

ross
0
 
ross_nolanAuthor Commented:
most appriciated

cheers
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.