【VC开源代码栏目提醒】:以下是网学会员为您推荐的VC开源代码-WINRWPM32.CPP,希望本篇文章对您学习有所帮助。
// WINRWPM32.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "ExMultiDocTemplate.h"
#include "MIDIGenerator.h"
#include "MainFrm.h"
#include "ChildFrm.h"
#include "IpFrame.h"
#include "WINRWPM32Doc.h"
#include "WINRWPM32View.h"
#include "Splash.h"
#include "MathStr.h"
#include "Hyperlink.h"
#include <locale.h>
#include <dos.h>
#include <direct.h>
#include <regstr.h>
#include <mmsystem.h>
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CWinRWPM32App
BEGIN_MESSAGE_MAP(CWinRWPM32App, CWinApp)
ON_COMMAND(CG_IDS_TIPOFTHEDAY, ShowTipOfTheDay)
//{{AFX_MSG_MAP(CWinRWPM32App)
ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
// Standard file based document commands
ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
// Standard print setup command
ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CWinRWPM32App construction
CWinRWPM32App::CWinRWPM32App()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CWinRWPM32App object
CWinRWPM32App theApp;
// This identifier was generated to be statistically unique for your app.
// You may change it if you prefer to choose a specific identifier.
// {848F16E0-749A-11D0-B74E-444553540000}
static const CLSID clsid =
{ 0x848f16e0, 0x749a, 0x11d0, { 0xb7, 0x4e, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0 } };
/////////////////////////////////////////////////////////////////////////////
// CWinRWPM32App initialization
void CWinRWPM32App::Registry_Uninstall(bool install)
{
char keystr[255];
strcpy(keystr, REGSTR_PATH_UNINSTALL);
strcat(keystr, _T("\\") );
strcat(keystr, m_pszAppName);
if (install)
{
HKEY hkey;
char uninststr[255];
::GetModuleFileName(m_hInstance, uninststr, sizeof(uninststr)-1);
strcat(uninststr, _T(" /uninstall"));
::RegCreateKey(HKEY_LOCAL_MACHINE, keystr, &hkey);
::RegSetValueEx(hkey, REGSTR_VAL_UNINSTALLER_DISPLAYNAME, 0, REG_SZ, (BYTE*)_T("WIN-RWPM 32-Bit Application (only remove registry entries)"), 0);
::RegSetValueEx(hkey, REGSTR_VAL_UNINSTALLER_COMMANDLINE, 0, REG_SZ, (BYTE*)uninststr, 0);
strcat(uninststr, _T("quiet"));
::RegSetValueEx(hkey, "QuietUninstallString", 0, REG_SZ, (BYTE*)uninststr, 0);
::RegCloseKey(hkey);
}
else
{
DelRegTree(HKEY_LOCAL_MACHINE, keystr);
}
}
void CWinRWPM32App::Registry_Software(bool install)
{
char keystr[255];
char enumkeystr[255];
HKEY hkey;
strcpy(keystr, _T("Software\\Andreas Jaeger\\"));
strcat(keystr, m_pszAppName);
if (install)
{
strcat(keystr, _T("\\1.0"));
::RegCreateKey(HKEY_LOCAL_MACHINE, keystr, &hkey);
::RegCloseKey(hkey);
}
else
{
DelRegTree(HKEY_CURRENT_USER, keystr);
strcat(keystr, _T("\\1.0"));
DelRegTree(HKEY_LOCAL_MACHINE, keystr);
// 黚ergeordnete Schl黶sel l鰏chen, sofern keine weiteren Eintr鋑e
// in HKEY_CURRENT_USER
strcpy(keystr, _T("Software\\Andreas Jaeger"));
::RegOpenKey(HKEY_CURRENT_USER, keystr, &hkey);
int ret = ::RegEnumKey(hkey, 0, enumkeystr, sizeof(enumkeystr)-1);
::RegCloseKey(hkey);
if (ret==ERROR_NO_MOR