Solved

desktop image capturing??

Posted on 1998-09-18
8
285 Views
Last Modified: 2013-12-03
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??
0
Comment
Question by:ross_nolan
8 Comments
 
LVL 6

Expert Comment

by:thresher_shark
ID: 1414553
What language are you programming in?  If you are using MFC, look into CBitmap and BitBlt.
0
 
LVL 20

Expert Comment

by:Madshi
ID: 1414554
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
 
LVL 10

Expert Comment

by:viktornet
ID: 1414555
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
 

Author Comment

by:ross_nolan
ID: 1414556
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 10

Expert Comment

by:viktornet
ID: 1414557
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
 

Author Comment

by:ross_nolan
ID: 1414558
could you please specify what dll's used would I be using??

thanks

ross
0
 
LVL 10

Accepted Solution

by:
viktornet earned 120 total points
ID: 1414559
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
 

Author Comment

by:ross_nolan
ID: 1414560
most appriciated

cheers
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
knowledge extraction for DB and VBA 6 74
Access Search and Edit Form 6 71
VS2015 compilation and missing DLLs 9 114
Problem to packaging 1 81
This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now