📄 cs.cpp
字号:
//中文大观主程序
#include "stdafx.h"
#include "resource.h"
//#include "ctl3d.h"
#include "welcome.h"
#include "basicwin.h"
#include "basicbut.h"
#include "systemse.h"
#include "menubutt.h"
#include "activebu.h"
#include "cswin.h"
#include "inputbar.h"
#include "hintwin.h"
#include "cs.h"
#include "cspublic.h"
#include "cskernel.h"
#include "csinput.h"
#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif
CCsApp NEAR csApp ;
CCsApp::CCsApp( void )
{
m_nCount =0 ;
m_pCsWin =NULL ;
}
BOOL CCsApp::InitInstance()
{
m_nCount++ ;
if( m_hPrevInstance )
{
/* int n =GetMainWinStatus() ; //得到主窗口状态
if( !n ) //原来是隐藏的
SwitchMainWin() ;
else if( n==1 ) //为退化显示
{
SetMainWinStatus( 2 ) ; //状态设为正常显示
m_pMainWnd->ShowWindow( SW_SHOWNOACTIVATE ) ;
m_pMainWnd->UpdateWindow() ;
}
*/
return FALSE ;
}
CSplashWnd splash ;
if(!WelcomeToYou( splash ,"welcome.bmp"))
return FALSE ;
//---------------------------------------------------------------------//
//挂上汉字系统
if( GetPrivateProfileInt( "输出" , "缺省输出代码" , 0 , INI_FILE_NAME )
<5 || //需要显示汉字
GetPrivateProfileInt( "指取翻译" , "是否进行指取翻译" ,
1 , INI_FILE_NAME ) ) //需要指取翻译
ToChinese() ;
else
LoadZk() ; //装入显示字库
//得到是否进行指取翻译
if( GetPrivateProfileInt( "指取翻译" , "是否进行指取翻译" ,
1 , INI_FILE_NAME ) )
HookFingerOn() ; //挂上指取模块
//挂上所有钩子
HookOnAllHooks() ;
//--------------------------------------------------------------------//
//设置背景颜色
SetDialogBkColor(); // Set dialog background color to gray
/* DWORD dwVersion ;
dwVersion = GetVersion() ;
BYTE verOfWin = HIBYTE(LOWORD( dwVersion ) );
if( verOfWin != 95 )
{
Ctl3dRegister(m_hInstance);
Ctl3dAutoSubclass(m_hInstance);
}
*/
m_pCsWin =new CCsWin ;
m_pMainWnd =m_pCsWin ;
ASSERT( m_pMainWnd ) ;
m_pMainWnd->ShowWindow( SW_SHOWNOACTIVATE ) ;
m_pMainWnd->UpdateWindow() ;
//判断浮动条的初始状态
m_pCsWin->JudgeInitStatus() ;
//将主窗口句柄放到公用DLL中
SetMainWinHandle( m_pMainWnd->m_hWnd ) ;
//创建输入板
if( GetPrivateProfileInt( "输入板参数" , "输入板状态" , 1 ,
INI_FILE_NAME )!=2 ) //可以进行中文输入
HookOnInput() ;
//创建hint窗口
m_pHintWin =new CHintWin( "HintWnd" ) ;
//设置hint或临时窗口
SetHintHwnd( m_pHintWin->m_hWnd ) ;
return TRUE ;
}
int CCsApp::ExitInstance()
{
m_nCount-- ;
if( m_nCount )
return 0 ;
if( m_pHintWin )
{
delete m_pHintWin ;
m_pHintWin =NULL ;
}
if( GetInputBarStatus()!=2 )
HookOffInput() ;
if( m_pCsWin )
{
delete m_pCsWin ;
m_pCsWin =NULL ;
}
/* DWORD dwVersion ;
dwVersion = GetVersion() ;
BYTE verOfWin = HIBYTE(LOWORD( dwVersion ) );
if( verOfWin != 95 )
Ctl3dUnregister(m_hInstance);
*/
return 0 ; //表示没有错误
}
//挂上输入法
void CCsApp::HookOnInput( void )
{
m_pInputBar =new CInputBar ;
ASSERT( m_pInputBar ) ;
m_pInputBar->InitInputBar() ;
}
//卸掉输入法
void CCsApp::HookOffInput( void )
{
//卸掉输入法库
UnloadInputLib() ;
if( m_pInputBar )
{
delete m_pInputBar ;
m_pInputBar =NULL ;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -