📄 bluesky.cpp
字号:
// BlueSky.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "BlueSky.h"
#include "BlueSkyDlg.h"
#include "eci.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
extern ATTRIBUTION attribution;
/////////////////////////////////////////////////////////////////////////////
// CBlueSkyApp
BEGIN_MESSAGE_MAP(CBlueSkyApp, CWinApp)
//{{AFX_MSG_MAP(CBlueSkyApp)
//}}AFX_MSG
ON_COMMAND(ID_HELP, CWinApp::OnHelp)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CBlueSkyApp construction
//##ModelId=43C757560180
CBlueSkyApp::CBlueSkyApp()
{
// SetRegKey((DWORD)1);
// DisableTaskKeys(TRUE, TRUE); //屏蔽系统键(WINDOWS徵标键、ESC键、ALT+F4、Ctrl+Alt+Del)
// ::ShowWindow(::FindWindow("Shell_TrayWnd",NULL),SW_HIDE);//使任务栏不可见
}
//##ModelId=43C757560181
CBlueSkyApp::~CBlueSkyApp()
{
// SetRegKey((DWORD)0);
// DisableTaskKeys(FALSE, FALSE);//恢复系统键
// ::ShowWindow (::FindWindow("Shell_TrayWnd",NULL),SW_SHOW);//使任务栏可见
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CBlueSkyApp object
CBlueSkyApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CBlueSkyApp initialization
//##ModelId=43C757560182
BOOL CBlueSkyApp::InitInstance()
{
// Standard initialization
/*
AfxEnableControlContainer();
GetRegEditKey(); //读取注册表
EsdInitInstance();
int g_nVolume = attribution.nVolume;
int g_nSpeed = attribution.nSpeed;
int g_nMan = attribution.nMan;
if(g_nMan)
EsdSetFemale();
else
EsdSetMale();
EsdSetVolume(g_nVolume);
EsdSetRate(g_nSpeed);
// EsdSetVoiceNumber(attribution.nNumber);
// EsdSetEnglishTextMode(attribution.nLetter);
EsdSpeakVoice("欢迎运行亿时代蓝天语音软件",24);
*/
ECIHand eInstance=eciNew();
eciCopyVoice(eInstance, 3,0);
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
AfxOleInit();
CBlueSkyDlg dlg;
m_pMainWnd = &dlg;
int nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
}
else if (nResponse == IDCANCEL)
{
}
// Since the dialog has been closed, return FALSE so that we exit the
// application, rather than start the application's message pump.
return FALSE;
}
//##ModelId=43C757560170
void CBlueSkyApp::SetRegKey(DWORD val)
{
//设置注册表,启用或系统键屏蔽系统键(val为0启用,为1屏蔽)
LPCSTR KEY_DisableTaskMgr = _T("Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System");
LPCSTR VAL_DisableTaskMgr = _T("DisableTaskMgr");
HKEY hk;
if (RegOpenKey(HKCU, KEY_DisableTaskMgr,&hk)!=ERROR_SUCCESS)
RegCreateKey(HKCU, KEY_DisableTaskMgr, &hk);
RegSetValueEx(hk, VAL_DisableTaskMgr, NULL,
REG_DWORD, (BYTE*)&val, sizeof(val));
}
BOOL CBlueSkyApp::GetRegEditKey()
{
LPCTSTR lpszSubKey = "software\\亿时代数码科技有限公司\\蓝天语音软件\\";
LPCTSTR lpszVolume = "音量";
LPCTSTR lpszSpeed = "音速";
LPCTSTR lpszRead = "符号发音设置";
LPCTSTR lpszMan = "男女声发音设置";
LPCTSTR lpszLetter = "字母发音设置";
LPCTSTR lpszNumber = "数字发音设置";
LPCTSTR lpszShowMainDlg = "是否启动软件封面";
HKEY hEsdKey;
LONG i = (::RegOpenKeyEx(HKEY_LOCAL_MACHINE, lpszSubKey, NULL,
KEY_EXECUTE, &hEsdKey));
if(i != ERROR_SUCCESS)
{
DWORD dwDisposition;
::RegCreateKeyEx(HKEY_LOCAL_MACHINE, lpszSubKey, NULL,
NULL, NULL, KEY_SET_VALUE, NULL, &hEsdKey, &dwDisposition);
int nCopyVolume = 60;
int nCopySpeed = 60;
int nCopyRead = 1;
int nCopyLetter = 0;
int nCopyNumber = 0;
int nCopyMan = 0;
BOOL bShowMainDlg = FALSE;
//将音量写入注册表
::RegSetValueEx(hEsdKey, lpszVolume,NULL, REG_DWORD,
(CONST BYTE *)&nCopyVolume, 4);
//将音速写入注册表
::RegSetValueEx(hEsdKey, lpszSpeed, NULL,REG_DWORD,
(CONST BYTE *)&nCopySpeed, 4);
//将是否读符号写入注册表
::RegSetValueEx(hEsdKey, lpszRead, NULL, REG_DWORD,
(CONST BYTE *)&nCopyRead, 4);
//男女声发音
::RegSetValueEx(hEsdKey, lpszMan, NULL, REG_DWORD,
(CONST BYTE *)&nCopyMan, 4);
//字母发音
::RegSetValueEx(hEsdKey, lpszLetter, NULL, REG_DWORD,
(CONST BYTE *)&nCopyLetter, 4);
//数字发音
::RegSetValueEx(hEsdKey, lpszNumber, NULL, REG_DWORD,
(CONST BYTE *)&nCopyNumber, 4);
::RegSetValueEx(hEsdKey, lpszShowMainDlg, NULL, REG_DWORD,
(CONST BYTE *)&bShowMainDlg, 4);
attribution.nVolume = nCopyVolume;
attribution.nSpeed = nCopySpeed;
attribution.nMan = nCopyMan;
attribution.nRead = nCopyRead;
attribution.nLetter = nCopyLetter;
attribution.nNumber = nCopyNumber;
bShowMainDlg = bShowMainDlg;
//return TRUE;
}else
{
DWORD volume_Get;
DWORD speed_Get;
DWORD man_Get;
DWORD read_Get;
DWORD letter_Get;
DWORD number_Get;
DWORD showmaindlg_Get;
DWORD type_1 = REG_DWORD;
DWORD cbData_1 = 4;
long j = ::RegQueryValueEx(hEsdKey, lpszVolume, NULL,
&type_1, (unsigned char*)&volume_Get, &cbData_1);
::RegQueryValueEx(hEsdKey, lpszSpeed, NULL,
&type_1, (unsigned char*)&speed_Get, &cbData_1);
::RegQueryValueEx(hEsdKey, lpszRead, NULL,
&type_1, (unsigned char*)&read_Get, &cbData_1);
::RegQueryValueEx(hEsdKey, lpszMan, NULL,
&type_1, (unsigned char*)&man_Get, &cbData_1);
::RegQueryValueEx(hEsdKey, lpszLetter, NULL,
&type_1, (unsigned char*)&letter_Get, &cbData_1);
::RegQueryValueEx(hEsdKey, lpszNumber, NULL,
&type_1, (unsigned char*)&number_Get, &cbData_1);
::RegQueryValueEx(hEsdKey, lpszShowMainDlg, NULL,
&type_1, (unsigned char*)&showmaindlg_Get, &cbData_1);
if(j != ERROR_SUCCESS)
{
//MessageBox(NULL, "错误", " 无法查询有关注册表信息!", MB_OK);
return FALSE;
}
attribution.nVolume = (int)volume_Get;
attribution.nSpeed = (int)speed_Get;
attribution.nMan = (int)man_Get;
attribution.nRead = (int)read_Get;
attribution.nLetter = (int)letter_Get;
attribution.nNumber = (int)number_Get;
}
::RegCloseKey(hEsdKey);
return TRUE;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -