Solved

desktop image capturing??

Posted on 1998-09-18
8
293 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
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…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

627 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