Click here to Skip to main content
15,902,938 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: Unusual Problem: Listbox Not Updating Pin
Luc Pattyn19-Oct-09 9:11
sitebuilderLuc Pattyn19-Oct-09 9:11 
GeneralRe: Unusual Problem: Listbox Not Updating Pin
raineym19-Oct-09 10:34
raineym19-Oct-09 10:34 
GeneralRe: Unusual Problem: Listbox Not Updating Pin
Luc Pattyn19-Oct-09 10:38
sitebuilderLuc Pattyn19-Oct-09 10:38 
NewsVisual Studio Beta 2 Available This Week, VS 2010 Launch Date Announced, New Packaging Revealed Pin
brucedkyle19-Oct-09 6:24
brucedkyle19-Oct-09 6:24 
QuestionCapture Screenshot of a Window(With Handle) Pin
Harrison Jones19-Oct-09 6:17
Harrison Jones19-Oct-09 6:17 
AnswerRe: Capture Screenshot of a Window(With Handle) Pin
Richard MacCutchan19-Oct-09 10:14
mveRichard MacCutchan19-Oct-09 10:14 
AnswerRe: Capture Screenshot of a Window(With Handle) Pin
Mark Salsbery19-Oct-09 11:19
Mark Salsbery19-Oct-09 11:19 
AnswerRe: Capture Screenshot of a Window(With Handle) Pin
freakyit20-Oct-09 1:44
freakyit20-Oct-09 1:44 
hi,

this is possible
..i made an application that makes screenshots of handles and other things..

and this is a code snip:
[DllImport("user32.dll")]
private static extern bool PrintWindow(IntPtr hwnd, IntPtr hdcBlt, uint nFlags);

[DllImport("user32.dll")]
private static extern int GetWindowRect(IntPtr hWnd, ref Rectangle rect);
		
[DllImport("user32.dll",EntryPoint="GetDC")]
public static extern IntPtr GetDC(IntPtr ptr);

[DllImport("gdi32.dll",EntryPoint="DeleteObject")]
public static extern IntPtr DeleteObject(IntPtr hDc);
        
private Bitmap Capture(IntPtr pHwnd)
{

// Rectobject
Rectangle r = new Rectangle(0,0,0,0);
			
// GetWindowRectangle
GetWindowRect(pHwnd,ref r);
// Set Client Rectangle only (like ALT + Print)
r.Width = r.Width - r.X;
r.Height = r.Height - r.Y;
									
// Create new empty Bitmap
Bitmap bmp = new Bitmap(r.Width,r.Height);
			
// Get Grapthics from Bitmap
Graphics e = Graphics.FromImage(bmp);
			
// Get Graphics Handle
IntPtr ptr = e.GetHdc();
			
try
{
	// Get DeviceContext Handles
	IntPtr hDC = GetDC(pHwnd);
				
	// Copy Screen from Process-Handle into Bitmap handle
	PrintWindow(pHwnd,ptr,0);
				
	// Delete the DeviceContextHandle
	DeleteObject(hDC);
}catch{}

// Apply new bitmap handle with graphics
e.ReleaseHdc(ptr);
			
// apply changes
e.Flush();
			
// free graphic object
e.Dispose();

return bmp;

}


bless Smile | :)
GeneralRe: Capture Screenshot of a Window(With Handle) Pin
dxlee20-Oct-09 7:11
dxlee20-Oct-09 7:11 
GeneralRe: Capture Screenshot of a Window(With Handle) Pin
dxlee20-Oct-09 7:13
dxlee20-Oct-09 7:13 
GeneralRe: Capture Screenshot of a Window(With Handle) Pin
freakyit27-Oct-09 2:49
freakyit27-Oct-09 2:49 
GeneralRe: Capture Screenshot of a Window(With Handle) Pin
dxlee27-Oct-09 3:52
dxlee27-Oct-09 3:52 
GeneralGuidance for writing a wrapper for a REST API Pin
Brady Kelly19-Oct-09 6:11
Brady Kelly19-Oct-09 6:11 
QuestionAccessing the machine.config file Pin
Przemyslaw Celej19-Oct-09 2:28
Przemyslaw Celej19-Oct-09 2:28 
AnswerRe: Accessing the machine.config file Pin
Not Active19-Oct-09 3:32
mentorNot Active19-Oct-09 3:32 
GeneralRe: Accessing the machine.config file Pin
Przemyslaw Celej19-Oct-09 4:28
Przemyslaw Celej19-Oct-09 4:28 
GeneralRe: Accessing the machine.config file Pin
Not Active19-Oct-09 4:47
mentorNot Active19-Oct-09 4:47 
GeneralRe: Accessing the machine.config file Pin
Przemyslaw Celej19-Oct-09 5:01
Przemyslaw Celej19-Oct-09 5:01 
QuestionHow to measure data usage or Real Time bandwidth usage Pin
Hardik Upadhyay19-Oct-09 1:58
Hardik Upadhyay19-Oct-09 1:58 
AnswerRe: How to measure data usage or Real Time bandwidth usage Pin
Richard MacCutchan19-Oct-09 4:17
mveRichard MacCutchan19-Oct-09 4:17 
QuestionInstalling Windows Service in Windows 7 Pin
#realJSOP19-Oct-09 0:28
professional#realJSOP19-Oct-09 0:28 
AnswerRe: Installing Windows Service in Windows 7 Pin
ovargast19-Oct-09 6:39
ovargast19-Oct-09 6:39 
GeneralRe: Installing Windows Service in Windows 7 Pin
#realJSOP19-Oct-09 7:52
professional#realJSOP19-Oct-09 7:52 
GeneralRe: Installing Windows Service in Windows 7 Pin
ovargast19-Oct-09 8:51
ovargast19-Oct-09 8:51 
QuestionDisconnected Context? Pin
#realJSOP18-Oct-09 8:57
professional#realJSOP18-Oct-09 8:57 

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.