Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Locking shareware functions

, 18 Sep 2003 CPOL
This article describes how to lock some functions in a shareware product. Users can unlock them only after obtaining keyfile
shwcode.zip
shwcode
shwcode.clw
shwcode.dsw
res
shwcodeDoc.ico
shwcode.ico
Toolbar.bmp
shwcode.dsp
Release
1224.bmp
shwcode.exe
1223.bmp
MVC10C0.TMP
// shwcodeView.h : interface of the CShwcodeView class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_SHWCODEVIEW_H__FA6E6F8E_E6F0_11D7_9818_CAEA6E782261__INCLUDED_)
#define AFX_SHWCODEVIEW_H__FA6E6F8E_E6F0_11D7_9818_CAEA6E782261__INCLUDED_

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

#include "memdc.h"

class CTranspBitmap
{
public:

	CTranspBitmap(){};
	CBitmap m_bmpPlmain;
    CBitmap m_bmpMask;

    BOOL LoadFileBitmap(LPCTSTR szFilename);

    void PrepareMask( 
                  COLORREF clrpTransColor,
                  int iTransPixelX = 0,
                  int iTransPixelY = 0 );

    void DrawTransparentBitmap (CDC* pDC,
                            int xStart, int yStart,
                            int wWidth, int wHeight,
                            CDC* pTmpDC,
                            int xSource = 0,
                            int ySource = 0);

	void PaintBitmap(       CDC*pDC,
                            int xStart, int yStart,
                            int wWidth, int wHeight,
                            int xSource = 0,
                            int ySource = 0);





};
class CShwcodeView : public CScrollView
{
protected: // create from serialization only
	CShwcodeView();
	DECLARE_DYNCREATE(CShwcodeView)

// Attributes
public:
	CShwcodeDoc* GetDocument();
	int m_mode;
	bool bAnimation;

	CTranspBitmap m_tbmp,m_tbmp2;

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CShwcodeView)
	public:
	virtual void OnDraw(CDC* pDC);  // overridden to draw this view
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	protected:
	virtual void OnInitialUpdate(); // called first time after construct
	virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
	virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
	//}}AFX_VIRTUAL

// Implementation
public:
	void PaintLockedModel(CDC *pDC);
	void PaintSecondModel(CDC *pDC,int counter=0);
	void SetDrawMode(int mode);
	void PaintFirstModel(CDC*pDC,int counter=0);
	virtual ~CShwcodeView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	//{{AFX_MSG(CShwcodeView)
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

#ifndef _DEBUG  // debug version in shwcodeView.cpp
inline CShwcodeDoc* CShwcodeView::GetDocument()
   { return (CShwcodeDoc*)m_pDocument; }
#endif

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

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

#endif // !defined(AFX_SHWCODEVIEW_H__FA6E6F8E_E6F0_11D7_9818_CAEA6E782261__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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

va_dev
Software Developer
Russian Federation Russian Federation
Professional Windows/Java Mobile/Web-applications developer since 2000.

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.141220.1 | Last Updated 19 Sep 2003
Article Copyright 2003 by va_dev
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid