Click here to Skip to main content
15,894,017 members
Articles / Desktop Programming / MFC

Adding high score capability to MS Solitaire

Rate me:
Please Sign up or sign in to vote.
4.70/5 (16 votes)
25 Jul 2007CPOL14 min read 44.1K   713   18  
An application that manages MS Solitaire high scores by reading and writing Solitaire memory
#ifndef _HIGHSCOREDLG_H
#define _HIGHSCOREDLG_H

// Includes
#include "stdafx.h"
#include "resource.h"       // main symbols
#include "SortListCtrl.h"
#include "label.h"
#include "events.h"

// definitions
typedef Event<void, long>  LoadHighscoreEvent; 

///////////////////////////////////////////////////////////////////////////////////
// Class CHighscoreDlg
// A UI class that shows the highscore list.
// It also provides a way to load and delete highscores.
//
// Author: Asa Meltzer
// Date: 07/2007
class CHighscoreDlg : public CDialog
{
public:
// construction
	CHighscoreDlg();

// Dialog Data
	//{{AFX_DATA(CHighscoreDlg)
	enum { IDD = IDD_HIGHSCOREDLG };
	CStatic       m_picHolder;
	CSortListCtrl m_lst;
	CLabel        m_lblTitle;
	//}}AFX_DATA

// events
	LoadHighscoreEvent OnLoadHighScoreEvent;

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CHighscoreDlg)
protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// button events
	afx_msg void OnBnClickedBtnDelete();
	afx_msg void OnBnClickedBtnClearall();
	afx_msg void OnBnClickedBtnLoad();
// Variables
	HICON m_hIcon;
	CBitmap m_image;
	//{{AFX_MSG(CHighscoreDlg)
	virtual BOOL OnInitDialog();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()

// helper functions
	void UpdateScores();
};

#endif

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)


Written By
Software Developer
Israel Israel
Software designer and programmer.
Programming languages:
MFC, C++, Java , C#, VB and sometimes C and assembly.

Comments and Discussions