Click here to Skip to main content
Click here to Skip to main content
Articles » Multimedia » GDI » General » Downloads
 
Add your own
alternative version

Barry's Screen Capture

, 11 Jan 2003
An article showing methods of screen capture
capit_demo.zip
CapIT.exe
capit_src.zip
CapIT.dsp
CapIT.dsw
RES
CapITDoc.ico
CapIT.ico
Toolbar.bmp
Camera.ico
Thumbs.db
// CapITDoc.h : interface of the CCapITDoc class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_CAPITDOC_H__CA8E7EC0_8563_488F_80D7_04DA78F3C8BA__INCLUDED_)
#define AFX_CAPITDOC_H__CA8E7EC0_8563_488F_80D7_04DA78F3C8BA__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000


#define PW_WINDOW        1 
#define PW_CLIENT        2 

#define HDIB HANDLE 

#define DIB_HEADER_MARKER   ((WORD) ('M' << 8) | 'B') 

#define WIDTHBYTES(bits)    (((bits) + 31) / 32 * 4) 

#define RECTWIDTH(lpRect)     ((lpRect)->right - (lpRect)->left) 
#define RECTHEIGHT(lpRect)    ((lpRect)->bottom - (lpRect)->top) 

 /* Error constants */ 
 enum {       
 ERR_MIN = 0,                     // All error #s >= this value       
 ERR_NOT_DIB = 0,                 // Tried to load a file, NOT a DIB!       
 ERR_MEMORY,                      // Not enough memory!       
 ERR_READ,                        // Error reading file!       
 ERR_LOCK,                        // Error on a GlobalLock()!       
 ERR_OPEN,                        // Error opening a file!       
 ERR_CREATEPAL,                   // Error creating palette.       
 ERR_GETDC,                       // Couldn't get a DC.       
 ERR_CREATEDDB,                   // Error create a DDB.       
 ERR_STRETCHBLT,                  // StretchBlt() returned failure.       
 ERR_STRETCHDIBITS,               // StretchDIBits() returned failure.       
 ERR_SETDIBITSTODEVICE,           // SetDIBitsToDevice() failed.       
 ERR_STARTDOC,                    // Error calling StartDoc().       
 ERR_NOGDIMODULE,                 // Couldn't find GDI module in memory.       
 ERR_SETABORTPROC,                // Error calling SetAbortProc().       
 ERR_STARTPAGE,                   // Error calling StartPage().       
 ERR_NEWFRAME,                    // Error calling NEWFRAME escape.       
 ERR_ENDPAGE,                     // Error calling EndPage().       
 ERR_ENDDOC,                      // Error calling EndDoc().       
 ERR_SETDIBITS,                   // Error calling SetDIBits().       
 ERR_FILENOTFOUND,                // Error opening file in GetDib()       
 ERR_INVALIDHANDLE,               // Invalid Handle       
 ERR_DIBFUNCTION,                 // Error on call to DIB function       
 ERR_MAX                          // All error #s < this value      
 
 };   

class CCapITDoc : public CDocument
{
protected: // create from serialization only
	CCapITDoc();
	DECLARE_DYNCREATE(CCapITDoc)

// Attributes
public:

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CCapITDoc)
	public:
	virtual BOOL OnNewDocument();
	virtual void Serialize(CArchive& ar);
	//}}AFX_VIRTUAL

// Implementation
public:

	virtual ~CCapITDoc();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	//{{AFX_MSG(CCapITDoc)
		// NOTE - the ClassWizard will add and remove member functions here.
		//    DO NOT EDIT what you see in these blocks of generated code !
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_CAPITDOC_H__CA8E7EC0_8563_488F_80D7_04DA78F3C8BA__INCLUDED_)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Barretto VN

India India
Nothing to boast about

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.141216.1 | Last Updated 12 Jan 2003
Article Copyright 2003 by Barretto VN
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid