Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

desktop image capturing??

Posted on 1998-09-18
8
Medium Priority
?
296 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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 

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
 
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 480 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

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

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

After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

971 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