Click here to Skip to main content
16,005,697 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: waveInXXX - USB device returns MMSYSERR_BADDEVICEID Pin
Vaclav_1-May-07 11:33
Vaclav_1-May-07 11:33 
GeneralRe: waveInXXX - USB device returns MMSYSERR_BADDEVICEID Pin
Mark Salsbery1-May-07 12:16
Mark Salsbery1-May-07 12:16 
GeneralRe: waveInXXX - USB device returns MMSYSERR_BADDEVICEID Pin
Vaclav_1-May-07 16:22
Vaclav_1-May-07 16:22 
Questionhow to plot the values Pin
Chandrasekharan P1-May-07 7:40
Chandrasekharan P1-May-07 7:40 
AnswerRe: how to plot the values Pin
Vaclav_1-May-07 8:22
Vaclav_1-May-07 8:22 
AnswerRe: how to plot the values Pin
Moak1-May-07 15:14
Moak1-May-07 15:14 
Questionhow to plat the values Pin
Chandrasekharan P1-May-07 7:37
Chandrasekharan P1-May-07 7:37 
QuestionCapturing Network Pc`s desktop Pin
HassanKU1-May-07 5:56
HassanKU1-May-07 5:56 
When performance is not an issue and when all that we want is just a snapshot of the desktop, we can consider the GDI option. This mechanism is based on the simple principle that the desktop is also a window - that is it has a window Handle (HWND) and a device context (DC). If we can get the device context of the desktop to be captured, we can just blit those contents to our application defined device context in the normal way. And getting the device context of the desktop is pretty straightforward if we know its window handle - which can be achieved through the function GetDesktopWindow(). Thus, the steps involved are:

Acquire the Desktop window handle using the function GetDesktopWindow();
Get the DC of the desktop window using the function GetDC();
Create a compatible DC for the Desktop DC and a compatible bitmap to select into that compatible DC. These can be done using CreateCompatibleDC() and CreateCompatibleBitmap(); selecting the bitmap into our DC can be done with SelectObject();
Whenever you are ready to capture the screen, just blit the contents of the Desktop DC into the created compatible DC - that's all - you are done. The compatible bitmap we created now contains the contents of the screen at the moment of the capture.
Do not forget to release the objects when you are done. Memory is precious (for the other applications).

Void CaptureScreen()
{
int nScreenWidth = GetSystemMetrics(SM_CXSCREEN);
int nScreenHeight = GetSystemMetrics(SM_CYSCREEN);
HWND hDesktopWnd = GetDesktopWindow();
HDC hDesktopDC = GetDC(hDesktopWnd);
HDC hCaptureDC = CreateCompatibleDC(hDesktopDC);
HBITMAP hCaptureBitmap =CreateCompatibleBitmap(hDesktopDC,
nScreenWidth, nScreenHeight);
SelectObject(hCaptureDC,hCaptureBitmap);
BitBlt(hCaptureDC,0,0,nScreenWidth,nScreenHeight,
hDesktopDC,0,0,SRCCOPY|CAPTUREBLT);
SaveCapturedBitmap(hCaptureBitmap); //Place holder - Put your code
//here to save the captured image to disk
ReleaseDC(hDesktopWnd,hDesktopDC);
DeleteDC(hCaptureDC);
DeleteObject(hCaptureBitmap);
}
In the above code snippet, the function GetSystemMetrics() returns the screen width when used with SM_CXSCREEN, and returns the screen height when called with SM_CYSCREEN. Refer to the accompanying source code for details of how to save the captured bitmap to the disk and how to send it to the clipboard. Its pretty straightforward. The source code implements the above technique for capturing the screen contents at regular intervals, and creates a movie out of the captured image sequences.

In consideration to the above code please let me know how to capture the network PC`s desktop to my software..

I want to capture it continously i dont want to save it, i want it`s Rectangular Area in ma software...
Please let me know how to do this(of course sockets are used) or create a method for this...


AnswerRe: Capturing Network Pc`s desktop Pin
Mark Salsbery1-May-07 6:27
Mark Salsbery1-May-07 6:27 
GeneralRe: Capturing Network Pc`s desktop Pin
Eytukan1-May-07 6:43
Eytukan1-May-07 6:43 
GeneralRe: Capturing Network Pc`s desktop Pin
Mark Salsbery1-May-07 7:01
Mark Salsbery1-May-07 7:01 
QuestionHow to display a double value as text in a CEdit window Pin
Reagan Conservative1-May-07 5:50
Reagan Conservative1-May-07 5:50 
AnswerRe: How to display a double value as text in a CEdit window Pin
David Crow1-May-07 5:53
David Crow1-May-07 5:53 
GeneralRe: How to display a double value as text in a CEdit window Pin
Reagan Conservative1-May-07 5:56
Reagan Conservative1-May-07 5:56 
AnswerRe: How to display a double value as text in a CEdit window Pin
JudyL_MD1-May-07 7:06
JudyL_MD1-May-07 7:06 
GeneralRe: How to display a double value as text in a CEdit window Pin
Reagan Conservative1-May-07 7:54
Reagan Conservative1-May-07 7:54 
Questionsystem menu on dialog Pin
deeps_cute1-May-07 3:39
deeps_cute1-May-07 3:39 
AnswerRe: system menu on dialog Pin
GuyM1-May-07 3:57
GuyM1-May-07 3:57 
AnswerRe: system menu on dialog Pin
Eytukan1-May-07 4:15
Eytukan1-May-07 4:15 
GeneralRe: system menu on dialog Pin
GuyM1-May-07 4:38
GuyM1-May-07 4:38 
GeneralRe: system menu on dialog Pin
Eytukan1-May-07 5:09
Eytukan1-May-07 5:09 
GeneralRe: system menu on dialog Pin
GuyM1-May-07 5:16
GuyM1-May-07 5:16 
QuestionRe: system menu on dialog Pin
Rajesh R Subramanian1-May-07 7:32
professionalRajesh R Subramanian1-May-07 7:32 
AnswerRe: system menu on dialog Pin
Eytukan1-May-07 18:59
Eytukan1-May-07 18:59 
GeneralRe: system menu on dialog Pin
Eytukan1-May-07 5:18
Eytukan1-May-07 5:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.