#ifndef __V41_H__
#define __V41_H__

#if _MSC_VER >= 1000
#pragma once
#endif

#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif

#include"HP41.h"
#include"Resource.h"
#include"MainWindow.h"
#include"Dialogs.h"
#include"WFile.h"
#include"HP41Sound.h"
#include"..\MODFile\MODFile.h"

// registry keys
#define APP_KEY "SOFTWARE\\V41"
#define APP_SINGLE "SingleInstance"
#define APP_LASTSESSION "LastSession"
#define APP_LASTFOLDER_LOD "LastFolderLod"
#define APP_LASTFOLDER_RAW "LastFolderRaw"
#define APP_MRU_FILECOUNT "FileCount"
#define APP_LEFT "Left"
#define APP_TOP "Top"
#define APP_MCODE_LEFT "MCodeLeft"
#define APP_MCODE_TOP "MCodeTop"
#define APP_RAMVIEW_LEFT "RamViewLeft"
#define APP_RAMVIEW_TOP "RamViewTop"
#define APP_RAMVIEW_RIGHT "RamViewRight"
#define APP_RAMVIEW_BOTTOM "RamViewBottom"
#define APP_RAMVIEW_LOCKWINPDATE "RamViewLockWinUpdate"
#define APP_RAMVIEW_SHOWEMPTYREG "RamViewShowEmptyReg"
#define APP_RAMVIEW_SHOWFLAGS "RamViewShowFlags"
#define APP_RAMVIEW_BUFFERNAME "RamViewBufferName"
#define APP_BREAKPTS_LEFT "BreakPtsLeft"
#define APP_BREAKPTS_TOP "BreakPtsTop"
#define APP_CONTRAST "Contrast"
#define APP_FONTCOLOR "FontColor"
#define APP_KEYBOARD "Keyboard"
#define APP_PROC_INTERVAL "ProcessorInterval"
#define APP_PROC_CYCLES "ProcessorCycles"
#define APP_TURBO_FACTOR "TurboFactor"
#define APP_WAVE_VOLUME "WaveVolume"
#define APP_AUTOSAVE "AutoSave"
#define APP_ALWAYSONTOP "AlwaysOnTop"
#define APP_JUMPTOFOREGROUND "JumpToForeground"
#define APP_SHOWTITLE "ShowTitle"
#define APP_SHOWMENU "ShowMenu"
#define APP_SOUNDMODE "SoundMode"
#define APP_TRUETYPE "TrueType"
#define APP_INST_SET "InstSet"
#define APP_TRACE_FILENAME "TraceFileName"
#define APP_TRACE_FILEMODE "TraceFileMode"
#define APP_SHOWHPIL_IN_TRACE "ShowHpilInTrace"
#define APP_SHOWREG_IN_TRACE "ShowRegInTrace"
#define APP_SHOWOPC_IN_TRACE "ShowOpcInTrace"
#define APP_SHOWOCTALDISASM "ShowOctalDisasm"
#define APP_INDICATOR "Indicator"
#define APP_CONNECTTIMEOUT "ConnectTimeout"
#define APP_ENABLEAUTOIDY "EnableAutoIDY"
#define APP_ENABLERFC "EnableRFC"
#define APP_CLASSICCURSOR "ClassicCursor"

// WM_COPYDATA identifier
#define CDID_FILENAME 1 // send file name

class CApp : public CWinApp
  {
  public:
  CApp();
    
  //{{AFX_VIRTUAL(CApp)
  public:
  virtual BOOL InitInstance();
  virtual int ExitInstance();
  virtual CDocument* OpenDocumentFile(LPCTSTR lpszFileName);
  //}}AFX_VIRTUAL

  //{{AFX_MSG(CApp)
  //}}AFX_MSG
  DECLARE_MESSAGE_MAP()

  void AddToRecentFileList(LPCTSTR lpszPathName);

  public:
  char szAppFullPath[_MAX_PATH];        // full path of application
  char szSessionName[_MAX_PATH];        // session name is full path to .lod file
  static const char szUntitledName[];   // a constant value
  flag fConsole;                        // console command line option
  flag fSingle;                         // limit to single instance
  int nFileCount;                       // max. no. of Recent File List entries
  LOGPALETTE *pPalForeground;           // current foreground palette for the app
  CMainWindow *pMainWnd;                // so we can access functions
  };
extern CApp theApp;

//{{AFX_INSERT_LOCATION}}

#endif // __V41_H__
