Parcourir la source

没什么实质性改动

张洋 il y a 6 ans
Parent
commit
443d5435c4

BIN
bin/Win32/Debug/zhipuzi_pay_plugin/zhipuzi_pay_plugin.exe


BIN
bin/Win32/Debug/zhipuzi_pay_plugin/zpzDll.dll


BIN
lib/debug/zpzDll.lib


+ 64 - 64
zhipuzi_pay_plugin/helper/CBitmapHelper.cpp

@@ -1,4 +1,4 @@
-#include "CBitmapHelper.h"
+#include "CBitmapHelper.h"
 
 #include "../pch/pch.h"
 
@@ -11,25 +11,25 @@ CBitmapHelper::~CBitmapHelper()
 {
 }
 
-int CBitmapHelper::SaveBitmapToFile(HBITMAP  hBitmap, LPCWSTR  lpFileName)   //hBitmap   为刚才的屏幕位图句柄
+int CBitmapHelper::SaveBitmapToFile(HBITMAP  hBitmap, LPCWSTR  lpFileName)   //hBitmap   涓哄垰鎵嶇殑灞忓箷浣嶅浘鍙ユ焺
 {
-    //lpFileName   为位图文件名
-    WORD   wBitCount;   //位图中每个像素所占字节数
+    //lpFileName   涓轰綅鍥炬枃浠跺悕
+    WORD   wBitCount;   //浣嶅浘涓�瘡涓�儚绱犳墍鍗犲瓧鑺傛暟
 
-    //定义调色板大小,位图中像素字节大小,位图文件大小,写入文件字节数
+    //瀹氫箟璋冭壊鏉垮ぇ灏忥紝浣嶅浘涓�儚绱犲瓧鑺傚ぇ灏忥紝浣嶅浘鏂囦欢澶у皬锛屽啓鍏ユ枃浠跺瓧鑺傛暟
     DWORD   dwPaletteSize = 0, dwBmBitsSize, dwDIBSize, dwWritten;
-    BITMAP   Bitmap; //位图属性结构
-    BITMAPFILEHEADER   bmfHdr;   //位图文件头结构
-    BITMAPINFOHEADER   bi;   //位图信息头结构
-    HANDLE   fh;   //定义文件,分配内存句柄,调色板句柄
+    BITMAP   Bitmap; //位图属性结构
+    BITMAPFILEHEADER   bmfHdr;   //位图文件头结构
+    BITMAPINFOHEADER   bi;   //位图信息头结构
+    HANDLE   fh;   //定义文件,分配内存句柄,调色板句柄
     LPSTR   lpbk, lpmem;
 
     wBitCount = 32;
-    //设置位图信息头结构
+    //设置位图信息头结构
     GetObject(hBitmap, sizeof(BITMAP), (LPSTR)&Bitmap);
     bi.biSize = sizeof(BITMAPINFOHEADER);
     bi.biWidth = Bitmap.bmWidth;
-    bi.biHeight = Bitmap.bmHeight; //为负,正向的位图;为正,倒向的位图
+    bi.biHeight = Bitmap.bmHeight; //为负,正向的位图;为正,倒向的位图
     bi.biPlanes = 1;
     bi.biBitCount = wBitCount;
     bi.biCompression = BI_RGB;
@@ -40,7 +40,7 @@ int CBitmapHelper::SaveBitmapToFile(HBITMAP  hBitmap, LPCWSTR  lpFileName)   //h
     bi.biClrImportant = 0;
     dwBmBitsSize = ((Bitmap.bmWidth * wBitCount + 31) / 32) * 4 * Bitmap.bmHeight;
 
-    //创建位图文件
+    //鍒涘缓浣嶅浘鏂囦欢
     fh = CreateFile(lpFileName, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,
                     FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, NULL);
     if(fh == INVALID_HANDLE_VALUE)
@@ -48,7 +48,7 @@ int CBitmapHelper::SaveBitmapToFile(HBITMAP  hBitmap, LPCWSTR  lpFileName)   //h
         return   FALSE;
     }
 
-    //设置位图文件头
+    //设置位图文件头
     bmfHdr.bfType = 0x4D42;   //   "BM"
     dwDIBSize = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER) + dwBmBitsSize;
     bmfHdr.bfSize = dwDIBSize;
@@ -56,27 +56,27 @@ int CBitmapHelper::SaveBitmapToFile(HBITMAP  hBitmap, LPCWSTR  lpFileName)   //h
     bmfHdr.bfReserved2 = 0;
     bmfHdr.bfOffBits = (DWORD)sizeof(BITMAPFILEHEADER) + (DWORD)sizeof(BITMAPINFOHEADER);
 
-    //写入位图文件头
+    //写入位图文件头
     WriteFile(fh, (LPSTR)&bmfHdr, sizeof(BITMAPFILEHEADER), &dwWritten, NULL);
 
-    //写入位图信息头
+    //写入位图信息头
     WriteFile(fh, (LPSTR)&bi, sizeof(BITMAPINFOHEADER), &dwWritten, NULL);
 
-    //获取位图阵列
+    //鑾峰彇浣嶅浘闃靛垪
     lpmem = new   char[dwBmBitsSize];
     lpbk = (LPSTR)   new   char[dwBmBitsSize];
-    GetBitmapBits(hBitmap, dwBmBitsSize, lpmem);//正向的内存图象数据
+    GetBitmapBits(hBitmap, dwBmBitsSize, lpmem);//正向的内存图象数据
 
-    //转化为倒向数据(仅在bmHeight为正时需要)
+    //转化为倒向数据(仅在bmHeight为正时需要)
     for(int i = 0; i < Bitmap.bmHeight; i++)
     {
         memcpy(lpbk + Bitmap.bmWidth * i * 4, lpmem + Bitmap.bmWidth * (Bitmap.bmHeight - i - 1) * 4, Bitmap.bmWidth * 4);
     }
 
-    //写位图数据
+    //写位图数据
     WriteFile(fh, lpbk, dwBmBitsSize, &dwWritten, NULL);
 
-    //清除
+    //娓呴櫎
     delete[]lpbk;
     delete[]lpmem;
 
@@ -115,10 +115,10 @@ HBITMAP CBitmapHelper::Scale(HBITMAP srcBitmap, int MaxWidth, int MaxHeight)
 
     HDC hMemDC = CreateCompatibleDC(hSrcDC);
 
-    //创建一个与屏幕设备描述表兼容的位图
+    //鍒涘缓涓€涓�笌灞忓箷璁惧�鎻忚堪琛ㄥ吋瀹圭殑浣嶅浘
     HBITMAP hNewBitmap = CreateCompatibleBitmap(hSrcDC, newWidth, newHeight);
 
-    //把新位图选到内存设备描述表中
+    //鎶婃柊浣嶅浘閫夊埌鍐呭瓨璁惧�鎻忚堪琛ㄤ腑
     HBITMAP hOldBitmap = (HBITMAP)SelectObject(hMemDC, hNewBitmap);
 
     ::StretchBlt(hMemDC, 0, 0, newWidth, newHeight, hSrcDC, 0, 0, srcWidth, srcHeight, SRCCOPY);
@@ -128,37 +128,37 @@ HBITMAP CBitmapHelper::Scale(HBITMAP srcBitmap, int MaxWidth, int MaxHeight)
     return hNewBitmap;
 }
 
-HBITMAP CBitmapHelper::CopyScreenToBitmap(LPRECT lpRect)   //lpRect   代表选定区域
+HBITMAP CBitmapHelper::CopyScreenToBitmap(LPRECT lpRect)   //lpRect   浠h〃閫夊畾鍖哄煙
 {
-    HDC   hScrDC, hMemDC; //屏幕和内存设备描述表
-    HBITMAP   hBitmap, hOldBitmap;//位图句柄
-    int   nX, nY, nX2, nY2; //选定区域坐标
-    int   nWidth, nHeight; //位图宽度和高度
-    int   xScrn, yScrn; //屏幕宽度和高度
+    HDC   hScrDC, hMemDC; //灞忓箷鍜屽唴瀛樿�澶囨弿杩拌〃
+    HBITMAP   hBitmap, hOldBitmap;//浣嶅浘鍙ユ焺
+    int   nX, nY, nX2, nY2; //閫夊畾鍖哄煙鍧愭爣
+    int   nWidth, nHeight; //位图宽度和高度
+    int   xScrn, yScrn; //屏幕宽度和高度
 
-    //确保选定区域不为空矩形
+    //确保选定区域不为空矩形
     if(IsRectEmpty(lpRect))
     {
         return  NULL;
     }
 
-    //为屏幕创建设备描述表
+    //涓哄睆骞曞垱寤鸿�澶囨弿杩拌〃
     hScrDC = CreateDC(L"DISPLAY", NULL, NULL, NULL);
 
-    //为屏幕设备描述表创建兼容的内存设备描述表
-    hMemDC = CreateCompatibleDC(hScrDC);   //或者::CreateCompatibleDC(NULL)
+    //涓哄睆骞曡�澶囨弿杩拌〃鍒涘缓鍏煎�鐨勫唴瀛樿�澶囨弿杩拌〃
+    hMemDC = CreateCompatibleDC(hScrDC);   //或者::CreateCompatibleDC(NULL)
 
-    //获得选定区域坐标
+    //鑾峰緱閫夊畾鍖哄煙鍧愭爣
     nX = lpRect->left;
     nY = lpRect->top;
     nX2 = lpRect->right;
     nY2 = lpRect->bottom;
 
-    //获得屏幕宽度和高度
+    //获得屏幕宽度和高度
     xScrn = GetDeviceCaps(hScrDC, HORZRES);
     yScrn = GetDeviceCaps(hScrDC, VERTRES);	
 
-    //确保选定区域是可见的
+    //纭�繚閫夊畾鍖哄煙鏄�彲瑙佺殑
     if(nX < 0)
     {
         nX = 0;
@@ -179,56 +179,56 @@ HBITMAP CBitmapHelper::CopyScreenToBitmap(LPRECT lpRect)   //lpRect   
     nWidth = nX2 - nX;
     nHeight = nY2 - nY;
 
-    //创建一个与屏幕设备描述表兼容的位图
+    //鍒涘缓涓€涓�笌灞忓箷璁惧�鎻忚堪琛ㄥ吋瀹圭殑浣嶅浘
     hBitmap = CreateCompatibleBitmap(hScrDC, nWidth, nHeight);
 
-    //把新位图选到内存设备描述表中
+    //鎶婃柊浣嶅浘閫夊埌鍐呭瓨璁惧�鎻忚堪琛ㄤ腑
     hOldBitmap = (HBITMAP)SelectObject(hMemDC, hBitmap);
 
-    //把屏幕设备描述表拷贝到内存设备描述表中
+    //把屏幕设备描述表拷贝到内存设备描述表中
     BitBlt(hMemDC, 0, 0, nWidth, nHeight, hScrDC, nX, nY, SRCCOPY);
 
-    //得到屏幕位图的句柄
+    //得到屏幕位图的句柄
     hBitmap = (HBITMAP)SelectObject(hMemDC, hOldBitmap);
 
-    //清除
+    //娓呴櫎
     DeleteDC(hScrDC);
     DeleteDC(hMemDC);
 
-    return hBitmap;   //返回位图句柄
+    return hBitmap;   //杩斿洖浣嶅浘鍙ユ焺
 }
 
 bool CBitmapHelper::OcrRect(tesseract::TessBaseAPI& tess, LPRECT lpRect, std::string& result)
 {
-    HDC   hScrDC, hMemDC; //屏幕和内存设备描述表
-    HBITMAP   hBitmap, hOldBitmap;//位图句柄
-    int   nX, nY, nX2, nY2; //选定区域坐标
-    int   nWidth, nHeight; //位图宽度和高度
-    int   xScrn, yScrn; //屏幕宽度和高度
+    HDC   hScrDC, hMemDC; //灞忓箷鍜屽唴瀛樿�澶囨弿杩拌〃
+    HBITMAP   hBitmap, hOldBitmap;//浣嶅浘鍙ユ焺
+    int   nX, nY, nX2, nY2; //閫夊畾鍖哄煙鍧愭爣
+    int   nWidth, nHeight; //位图宽度和高度
+    int   xScrn, yScrn; //屏幕宽度和高度
 
-    //确保选定区域不为空矩形
+    //确保选定区域不为空矩形
     if(IsRectEmpty(lpRect))
     {
         return  false;
     }
 
-    //为屏幕创建设备描述表
+    //涓哄睆骞曞垱寤鸿�澶囨弿杩拌〃
     hScrDC = CreateDC(L"DISPLAY", NULL, NULL, NULL);
 
-    //为屏幕设备描述表创建兼容的内存设备描述表
-    hMemDC = CreateCompatibleDC(hScrDC);   //或者::CreateCompatibleDC(NULL)
+    //涓哄睆骞曡�澶囨弿杩拌〃鍒涘缓鍏煎�鐨勫唴瀛樿�澶囨弿杩拌〃
+    hMemDC = CreateCompatibleDC(hScrDC);   //或者::CreateCompatibleDC(NULL)
 
-    //获得选定区域坐标
+    //鑾峰緱閫夊畾鍖哄煙鍧愭爣
     nX = lpRect->left;
     nY = lpRect->top;
     nX2 = lpRect->right;
     nY2 = lpRect->bottom;
 
-    //获得屏幕宽度和高度
+    //获得屏幕宽度和高度
     xScrn = GetDeviceCaps(hScrDC, HORZRES);
     yScrn = GetDeviceCaps(hScrDC, VERTRES);
 
-    //确保选定区域是可见的
+    //纭�繚閫夊畾鍖哄煙鏄�彲瑙佺殑
     if(nX < 0)
     {
         nX = 0;
@@ -249,10 +249,10 @@ bool CBitmapHelper::OcrRect(tesseract::TessBaseAPI& tess, LPRECT lpRect, std::st
     nWidth = nX2 - nX;
     nHeight = nY2 - nY;
 
-    //创建一个与屏幕设备描述表兼容的位图
+    //鍒涘缓涓€涓�笌灞忓箷璁惧�鎻忚堪琛ㄥ吋瀹圭殑浣嶅浘
     hBitmap = CreateCompatibleBitmap(hScrDC, nWidth, nHeight);
 
-    //把新位图选到内存设备描述表中
+    //鎶婃柊浣嶅浘閫夊埌鍐呭瓨璁惧�鎻忚堪琛ㄤ腑
     hOldBitmap = (HBITMAP)SelectObject(hMemDC, hBitmap);
 
     BITMAP bm;
@@ -267,19 +267,19 @@ bool CBitmapHelper::OcrRect(tesseract::TessBaseAPI& tess, LPRECT lpRect, std::st
     bi.biCompression = BI_RGB;
     bi.biSizeImage = bm.bmHeight * bm.bmWidthBytes;
 
-    //把屏幕设备描述表拷贝到内存设备描述表中
+    //把屏幕设备描述表拷贝到内存设备描述表中
     BitBlt(hMemDC, 0, 0, nWidth, nHeight, hScrDC, nX, nY, SRCCOPY);
 
     char* lpmem = new   char[bi.biSizeImage];
 
-    //正向的内存图象数据
+    //正向的内存图象数据
     GetBitmapBits(hBitmap, bi.biSizeImage, lpmem);
 
-    //清除
+    //娓呴櫎
     DeleteDC(hScrDC);
     DeleteDC(hMemDC);
 
-    //开始测试ocr
+    //寮€濮嬫祴璇昽cr
     tess.SetImage((const unsigned char*)lpmem, bm.bmWidth, bm.bmHeight, 4, bm.bmWidthBytes);
     tess.Recognize(0);
 
@@ -292,13 +292,13 @@ bool CBitmapHelper::OcrRect(tesseract::TessBaseAPI& tess, LPRECT lpRect, std::st
 	{
 		if ((utf8_ret[i] >= '0' && utf8_ret[i] <= '9') || utf8_ret[i] == '.')
 		{
-			//是有效的数字,就保存下来
+			//鏄�湁鏁堢殑鏁板瓧锛屽氨淇濆瓨涓嬫潵
 			szRes[j] = utf8_ret[i];
 			j++;
 
 			if (j == 11)
 			{
-				//已经装了11个了
+				//宸茬粡瑁呬簡11涓�簡
 				result = szRes;
 
 				break;
@@ -306,18 +306,18 @@ bool CBitmapHelper::OcrRect(tesseract::TessBaseAPI& tess, LPRECT lpRect, std::st
 		}
 		else if (utf8_ret[i] == 32)
 		{
-			//如果是空格,直接忽略
+			//濡傛灉鏄�┖鏍硷紝鐩存帴蹇界暐
 		}
 		else if (utf8_ret[i] == '\n')
 		{
-			//换行键,到了末尾了
+			//换行键,到了末尾了
 			result = szRes;
 
 			break;
 		}
 		else
 		{
-			//既不是有效数字,也不是空格和换行,那么就是出现了非法字符
+			//鏃�笉鏄�湁鏁堟暟瀛楋紝涔熶笉鏄�┖鏍煎拰鎹㈣�锛岄偅涔堝氨鏄�嚭鐜颁簡闈炴硶瀛楃�
 			result = "0.00";
 
 			break;

+ 11 - 9
zhipuzi_pay_plugin/wnd/CDingweiInfoWnd.cpp

@@ -1,4 +1,4 @@
-#include "../pch/pch.h"
+#include "../pch/pch.h"
 #include "CDingweiInfoWnd.h"
 
 #include "CValueWnd.h"
@@ -32,7 +32,7 @@ void CDingweiInfoWnd::Notify(TNotifyUI& msg)
 	}
 	else if (msg.sType == L"itemclick")
 	{
-		//响应菜单事件
+		//鍝嶅簲鑿滃崟浜嬩欢
 		::MessageBox(NULL, name.GetData(), L"hello", MB_OK);
 		this->ShowWindow(false);
 	}
@@ -44,7 +44,7 @@ LRESULT CDingweiInfoWnd::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL&
 	styleValue &= ~WS_CAPTION;
 	::SetWindowLong(*this, GWL_STYLE, styleValue | WS_CLIPSIBLINGS | WS_CLIPCHILDREN);
 
-	// 把自己的窗口句柄与窗口绘制管理器挂接在一起
+	// 把自己的窗口句柄与窗口绘制管理器挂接在一起
 	m_pm.Init(m_hWnd);
 
 	m_pm.AddPreMessageFilter(this);
@@ -54,10 +54,10 @@ LRESULT CDingweiInfoWnd::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL&
 	CControlUI* pRoot = builder.Create(_T("dingweiinfo_wnd.xml"), (UINT)0, NULL, &m_pm);
 	ASSERT(pRoot && "Failed to parse XML");
 
-	// 把这些控件绘制到本窗口上
+	// 鎶婅繖浜涙帶浠剁粯鍒跺埌鏈�獥鍙d笂
 	m_pm.AttachDialog(pRoot);
 
-	// 把自己加入到CPaintManagerUI的m_aNotifiers数组中,用于处理Notify函数
+	// 鎶婅嚜宸卞姞鍏ュ埌CPaintManagerUI鐨刴_aNotifiers鏁扮粍涓�紝鐢ㄤ簬澶勭悊Notify鍑芥暟
 	m_pm.AddNotifier(this);
 
 	Init();
@@ -72,7 +72,7 @@ LRESULT CDingweiInfoWnd::OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL&
 }
 
 /*
- *这个是窗口被销毁的时候调用的
+ *杩欎釜鏄�獥鍙h�閿€姣佺殑鏃跺€欒皟鐢ㄧ殑
  **/
 LRESULT CDingweiInfoWnd::OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
 {
@@ -155,7 +155,7 @@ LRESULT CDingweiInfoWnd::OnLButtonDown(UINT uMsg, WPARAM wParam, LPARAM lParam,
 
 LRESULT CDingweiInfoWnd::OnRButtonDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
 {
-	//点击邮件,取消截取
+	//点击邮件,取消截取
 	m_valueWnd->CancalDingweiWnd();
 
 	return 0;
@@ -232,6 +232,8 @@ LRESULT CDingweiInfoWnd::MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam,
 
 void CDingweiInfoWnd::UpdateInfo(std::wstring value, HWND hwnd)
 {
+	CLewaimaiString::Replace(value, L"楼", L"");
+
 	m_findValue = value;
 	m_FindWnd = hwnd;
 
@@ -240,11 +242,11 @@ void CDingweiInfoWnd::UpdateInfo(std::wstring value, HWND hwnd)
 	CLabelUI* valueLabel = static_cast<CLabelUI*>(m_pm.FindControl(_T("dingweiinfo_wnd_info")));
 	if (s_value == "" || !atof(s_value.c_str()))
 	{
-		valueLabel->SetText(L"无有效金额");
+		valueLabel->SetText(L"无有效金额");
 	}
 	else
 	{
-		std::wstring info = L"有效金额:" + value + L" 元";
+		std::wstring info = L"有效金额:" + value + L" 元";
 		valueLabel->SetText(info.c_str());
 	}
 }

+ 62 - 60
zhipuzi_pay_plugin/wnd/CSystemSettingWnd.cpp

@@ -1,4 +1,4 @@
-#include "../pch/pch.h"
+#include "../pch/pch.h"
 #include "CSystemSettingWnd.h"
 
 #include "../control/ControlEx.h"
@@ -21,11 +21,11 @@ void CSystemSettingWnd::Init()
 
 	if (m_nType == 1)
 	{
-		//选中串口抓取
+		//閫変腑涓插彛鎶撳彇
 		CCheckBoxUI* zhuaquTypeOption = static_cast<CCheckBoxUI*>(m_pm.FindControl(L"jinezhuaqu_setting_chuankou"));
 		zhuaquTypeOption->Selected(true, false);
 
-		//显示串口设置
+		//鏄剧ず涓插彛璁剧疆
 		com_layout->SetVisible(true);
 		xuni_com_layout->SetVisible(false);
 		chuangkou_layout->SetVisible(false);
@@ -33,11 +33,11 @@ void CSystemSettingWnd::Init()
 	}
 	else if (m_nType == 2)
 	{
-		//选中虚拟串口抓取
+		//閫変腑铏氭嫙涓插彛鎶撳彇
 		CCheckBoxUI* zhuaquTypeOption = static_cast<CCheckBoxUI*>(m_pm.FindControl(L"jinezhuaqu_setting_xunichuankou"));
 		zhuaquTypeOption->Selected(true, false);
 
-		//显示虚拟串口设置
+		//鏄剧ず铏氭嫙涓插彛璁剧疆
 		com_layout->SetVisible(false);
 		xuni_com_layout->SetVisible(true);
 		chuangkou_layout->SetVisible(false);
@@ -48,7 +48,7 @@ void CSystemSettingWnd::Init()
 		CCheckBoxUI* zhuaquTypeOption = static_cast<CCheckBoxUI*>(m_pm.FindControl(L"jinezhuaqu_setting_chuangkou"));
 		zhuaquTypeOption->Selected(true, false);
 
-		//显示窗口截取的设置
+		//显示窗口截取的设置
 		com_layout->SetVisible(false);
 		xuni_com_layout->SetVisible(false);
 		chuangkou_layout->SetVisible(true);
@@ -59,18 +59,18 @@ void CSystemSettingWnd::Init()
 		CCheckBoxUI* zhuaquTypeOption = static_cast<CCheckBoxUI*>(m_pm.FindControl(L"jinezhuaqu_setting_ocr"));
 		zhuaquTypeOption->Selected(true, false);
 
-		//显示OCR的设置
+		//显示OCR的设置
 		com_layout->SetVisible(false);
 		xuni_com_layout->SetVisible(false);
 		chuangkou_layout->SetVisible(false);
 		ocr_layout->SetVisible(true);
 	}
 
-	//串口模式设置的初始化
+	//涓插彛妯″紡璁剧疆鐨勫垵濮嬪寲
 	CComboUI* com_com = static_cast<CComboUI*>(m_pm.FindControl(_T("jinezhuaqu_setting_chuankou_num")));
 	com_com->RemoveAll();
 
-	//数据库中保存的之前的设置
+	//鏁版嵁搴撲腑淇濆瓨鐨勪箣鍓嶇殑璁剧疆
 	std::string s_jinezhuaqu_setting_chuankou_num = CSetting::GetParam("system_setting_jinezhuaqu_setting_chuankou_num");
 	std::wstring ws_jinezhuaqu_setting_chuankou_num = CLewaimaiString::UTF8ToUnicode(s_jinezhuaqu_setting_chuankou_num);
 
@@ -98,7 +98,7 @@ void CSystemSettingWnd::Init()
 	com_com->SelectItem(nSelect, false, false);
 	com_com->SetText(CLewaimaiString::UTF8ToUnicode(s_jinezhuaqu_setting_chuankou_num).c_str());
 
-	//虚拟串口模式设置的初始化
+	//铏氭嫙涓插彛妯″紡璁剧疆鐨勫垵濮嬪寲
 	CComboUI* xuni_com_1 = static_cast<CComboUI*>(m_pm.FindControl(_T("jinezhuaqu_setting_xunichuankou_num_1")));
 	xuni_com_1->RemoveAll();
 
@@ -107,7 +107,7 @@ void CSystemSettingWnd::Init()
 
 	CComboUI* xuni_com_botelv = static_cast<CComboUI*>(m_pm.FindControl(_T("jinezhuaqu_setting_xunichuankou_botelv")));
 
-	//数据库中保存的之前的设置
+	//鏁版嵁搴撲腑淇濆瓨鐨勪箣鍓嶇殑璁剧疆
 	std::string s_system_setting_jinezhuaqu_setting_xunichuankou_num_1 = CSetting::GetParam("system_setting_jinezhuaqu_setting_xunichuankou_num_1");
 	std::wstring ws_system_setting_jinezhuaqu_setting_xunichuankou_num_1 = CLewaimaiString::UTF8ToUnicode(s_system_setting_jinezhuaqu_setting_xunichuankou_num_1);
 
@@ -193,7 +193,7 @@ void CSystemSettingWnd::Init()
 
 	xuni_com_botelv->SetText(CLewaimaiString::UTF8ToUnicode(s_system_setting_jinezhuaqu_setting_xunichuankou_botelv).c_str());
 
-	//窗口模式设置的初始化
+	//绐楀彛妯″紡璁剧疆鐨勫垵濮嬪寲
 	CComboUI* find_wnd_type = static_cast<CComboUI*>(m_pm.FindControl(_T("jinezhuaqu_setting_chuangkou_model")));
 	find_wnd_type->SetInternVisible(true);
 
@@ -203,12 +203,12 @@ void CSystemSettingWnd::Init()
 	std::string system_setting_jinezhuaqu_setting_chuangkou_model = CSetting::GetParam("system_setting_jinezhuaqu_setting_chuangkou_model");
 	if (system_setting_jinezhuaqu_setting_chuangkou_model == "1")
 	{
-		//查找金额模式
+		//鏌ユ壘閲戦�妯″紡
 		chazhao_layout->SetVisible(true);
 		dingwei_layout->SetVisible(false);
 
 		find_wnd_type->SelectItem(0, false, false);
-		find_wnd_type->SetText(L"查找金额模式");
+		find_wnd_type->SetText(L"鏌ユ壘閲戦�妯″紡");
 	}
 	else
 	{
@@ -216,10 +216,10 @@ void CSystemSettingWnd::Init()
 		dingwei_layout->SetVisible(true);
 
 		find_wnd_type->SelectItem(1, false, false);
-		find_wnd_type->SetText(L"定位金额模式");
+		find_wnd_type->SetText(L"瀹氫綅閲戦�妯″紡");
 	}
 
-	//初始化快捷键的展示
+	//初始化快捷键的展示
 	UINT shoukuan_mod = (UINT)atoi(CSetting::GetParam("system_setting_kuaijiejian_shoukuan_mod").c_str());
 	UINT shoukuan_vk = (UINT)atoi(CSetting::GetParam("system_setting_kuaijiejian_shoukuan_vk").c_str());
 
@@ -247,21 +247,21 @@ LRESULT CSystemSettingWnd::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOO
 	styleValue &= ~WS_CAPTION;
 	::SetWindowLong(*this, GWL_STYLE, styleValue | WS_CLIPSIBLINGS | WS_CLIPCHILDREN);
 
-	// 把自己的窗口句柄与窗口绘制管理器挂接在一起
+	// 把自己的窗口句柄与窗口绘制管理器挂接在一起
 	m_pm.Init(m_hWnd);
 	m_pm.AddPreMessageFilter(this);
 
-	//页面内有自定义控件的,必须要加这2个
+	//页面内有自定义控件的,必须要加这2个
 	CDialogBuilder builder;
 	CDialogBuilderCallbackEx cb;
 
 	CControlUI* pRoot = builder.Create(_T("system_setting.xml"), (UINT)0, &cb, &m_pm);
 	ASSERT(pRoot && "Failed to parse XML");
 
-	// 把这些控件绘制到本窗口上
+	// 鎶婅繖浜涙帶浠剁粯鍒跺埌鏈�獥鍙d笂
 	m_pm.AttachDialog(pRoot);
 
-	// 把自己加入到CPaintManagerUI的m_aNotifiers数组中,用于处理Notify函数
+	// 鎶婅嚜宸卞姞鍏ュ埌CPaintManagerUI鐨刴_aNotifiers鏁扮粍涓�紝鐢ㄤ簬澶勭悊Notify鍑芥暟
 	m_pm.AddNotifier(this);
 
 	Init();
@@ -314,19 +314,19 @@ LRESULT CSystemSettingWnd::OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL&
 
 LRESULT CSystemSettingWnd::OnKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
 {
-	//先按控制键
+	//先按控制键
 	if (m_is_kuaijiepan_page)
 	{
 		if (uMsg == WM_KEYDOWN || uMsg == WM_SYSKEYDOWN)
 		{
 			if (wParam != VK_CONTROL && wParam != VK_MENU && wParam != VK_SHIFT)
 			{
-				//这个情况,按的是字母键之类的
+				//杩欎釜鎯呭喌锛屾寜鐨勬槸瀛楁瘝閿�箣绫荤殑
 				CDuiString duiText;
 
 				if (VK_F1 <= wParam && wParam <= VK_F12)
 				{
-					//快捷键就是F1到F12,不需要搭配ctrl之类的
+					//快捷键就是F1到F12,不需要搭配ctrl之类的
 					m_mod = 0;
 					duiText.Format(_T("F%d"), wParam - VK_F1 + 1);
 				}
@@ -344,7 +344,7 @@ LRESULT CSystemSettingWnd::OnKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BO
 				}
 				else if(m_mod == 0)
 				{
-					//直接按的字母键,无效
+					//鐩存帴鎸夌殑瀛楁瘝閿�紝鏃犳晥
 					m_mod = 0;
 					m_vk = 0;
 					m_isSet = false;
@@ -353,7 +353,7 @@ LRESULT CSystemSettingWnd::OnKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BO
 					return 0;
 				}
 
-				//到这里来设置成功了,做展示
+				//到这里来设置成功了,做展示
 				if (m_kuaijiejian_type == 1)
 				{
 					CEditUI* focusEdit = static_cast<CEditUI*>(m_pm.FindControl(_T("kuaijiejian_setting_jiesuan_btn")));
@@ -365,7 +365,7 @@ LRESULT CSystemSettingWnd::OnKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BO
 			}
 			else
 			{
-				//按的是控制键,这里只支持3选1,不能更多组合
+				//按的是控制键,这里只支持3选1,不能更多组合
 				if (wParam == VK_CONTROL)
 				{
 					m_mod = MOD_CONTROL;
@@ -384,7 +384,7 @@ LRESULT CSystemSettingWnd::OnKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BO
 		}
 		else if(uMsg == WM_KEYUP || uMsg == WM_SYSKEYUP)
 		{
-			//这个是只按了控制键,没有按其他的键
+			//这个是只按了控制键,没有按其他的键
 			if (!m_isSet)
 			{
 				if (wParam == VK_CONTROL)
@@ -402,10 +402,10 @@ LRESULT CSystemSettingWnd::OnKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BO
 			}
 			else
 			{
-				//这里表示已经设置好了,等后面保存
+				//杩欓噷琛ㄧず宸茬粡璁剧疆濂戒簡锛岀瓑鍚庨潰淇濆瓨
 				if (wParam != VK_CONTROL && wParam != VK_MENU && wParam != VK_SHIFT)
 				{
-					//准备开始注册热键了
+					//鍑嗗�寮€濮嬫敞鍐岀儹閿�簡
 					CSetting::SetParam("system_setting_kuaijiejian_shoukuan_mod", to_string(m_mod));
 					CSetting::SetParam("system_setting_kuaijiejian_shoukuan_vk", to_string(m_vk));
 
@@ -544,22 +544,22 @@ void CSystemSettingWnd::HandleClickMsg(TNotifyUI& msg)
 	}
 	else if (senderName == _T("jinezhuaqu_setting_chuangkou_dingwei_value_btn"))
 	{
-		//点这个按钮之后,开始搜索窗口
+		//点这个按钮之后,开始搜索窗口
 		m_valueWnd->StartDingweiWnd();
 	}
 	else if (senderName == _T("jinezhuaqu_setting_ocr_select_value_search"))
 	{
-		//点了这个之后,开始截取屏幕
+		//点了这个之后,开始截取屏幕
 		m_valueWnd->StartOcrWnd();
 	}
 	else if (senderName == _T("jinezhuaqu_setting_save"))
 	{
-		//首先保存截取模式
+		//棣栧厛淇濆瓨鎴�彇妯″紡
 		CSetting::SetParam("system_setting_jinezhuaqu_setting_type", to_string(m_nType).c_str(), false);
 
 		if (m_nType == 1)
 		{
-			//保存串口参数
+			//淇濆瓨涓插彛鍙傛暟
 			CComboUI* com = static_cast<CComboUI*>(m_pm.FindControl(_T("jinezhuaqu_setting_chuankou_num")));
 			wstring com_name = com->GetText();
 
@@ -567,7 +567,7 @@ void CSystemSettingWnd::HandleClickMsg(TNotifyUI& msg)
 		}
 		else if (m_nType == 2)
 		{
-			//保存虚拟串口参数
+			//淇濆瓨铏氭嫙涓插彛鍙傛暟
 			CComboUI* com_1 = static_cast<CComboUI*>(m_pm.FindControl(_T("jinezhuaqu_setting_xunichuankou_num_1")));
 			wstring com_name_1 = com_1->GetText();
 
@@ -585,16 +585,16 @@ void CSystemSettingWnd::HandleClickMsg(TNotifyUI& msg)
 		}
 		else if (m_nType == 3)
 		{
-			//保存窗口监听的参数
+			//保存窗口监听的参数
 			if (g_valuewnd_vector.size() == 0)
 			{
-				//没有合适的窗口
-				MessageBox(m_hWnd, _T("没有找到合适的窗口,无法保存"), _T("提示"), MB_OK);
+				//娌℃湁鍚堥€傜殑绐楀彛
+				MessageBox(m_hWnd, _T("没有找到合适的窗口,无法保存"), _T("提示"), MB_OK);
 				return;
 			}
 			else
 			{
-				//找到合适的窗口了
+				//找到合适的窗口了
 				ValueWnd newWnd = g_valuewnd_vector[0];
 
 				CSetting::SetParam("system_setting_jinezhuaqu_setting_chuangkou_process_name", CLewaimaiString::UnicodeToUTF8(newWnd.processName));
@@ -616,7 +616,7 @@ void CSystemSettingWnd::HandleClickMsg(TNotifyUI& msg)
 		{
 			if (IsRectEmpty(&m_ocrRect))
 			{
-				MessageBox(m_hWnd, _T("没有设置OCR区域,无法保存"), _T("提示"), MB_OK);
+				MessageBox(m_hWnd, _T("没有设置OCR区域,无法保存"), _T("提示"), MB_OK);
 				return;
 			}
 			else
@@ -628,7 +628,7 @@ void CSystemSettingWnd::HandleClickMsg(TNotifyUI& msg)
 			}
 		}
 
-		//给监视窗口发个消息
+		//给监视窗口发个消息
 		m_valueWnd->RestartWatch();
 	}
 	else if (senderName == _T("kuaijiejian_setting_jiesuan_btn"))
@@ -645,7 +645,7 @@ void CSystemSettingWnd::HandleSelectChangeMsg(TNotifyUI& msg)
 {
 	CDuiString name = msg.pSender->GetName();
 
-	//先判断主页面的tab
+	//鍏堝垽鏂�富椤甸潰鐨則ab
 	if (name == _T("system_setting_option_zhuaqu"))
 	{
 		CTabLayoutUI* pControl = static_cast<CTabLayoutUI*>(m_pm.FindControl(_T("switch")));
@@ -747,7 +747,7 @@ void CSystemSettingWnd::HandleItemSelectMsg(TNotifyUI& msg)
 		CComboUI* com = static_cast<CComboUI*>(m_pm.FindControl(_T("jinezhuaqu_setting_chuangkou_model")));
 		if (com->GetCurSel() == 0)
 		{
-			//查找金额模式
+			//鏌ユ壘閲戦�妯″紡
 			chazhao_layout->SetVisible(true);
 			dingwei_layout->SetVisible(false);
 
@@ -768,17 +768,17 @@ void CSystemSettingWnd::FindValueWnd(std::wstring value)
 {
 	g_valuewnd_vector.clear();
 
-	//先查找子窗口
+	//鍏堟煡鎵惧瓙绐楀彛
 	EnumWindows(EnumWindowsProc, (LPARAM)(&value));
 
-	//展示查找结果
+	//灞曠ず鏌ユ壘缁撴灉
 	int nCount = (int)g_valuewnd_vector.size();
 
 	CHorizontalLayoutUI* result_layout = static_cast<CHorizontalLayoutUI*>(m_pm.FindControl(_T("jinezhuaqu_setting_chuangkou_select_value_search_result_layout")));
 	result_layout->SetVisible(true);
 
 	CLabelUI* result_label = static_cast<CLabelUI*>(m_pm.FindControl(_T("jinezhuaqu_setting_chuangkou_select_value_search_result")));
-	std::wstring result = L"共找到 " + to_wstring(nCount) + L" 个窗口";
+	std::wstring result = L"共找到 " + to_wstring(nCount) + L" 个窗口";
 	result_label->SetText(result.c_str());
 }
 
@@ -786,17 +786,19 @@ void CSystemSettingWnd::FindDingweiWnd(HWND hWnd)
 {
 	g_valuewnd_vector.clear();
 
-	//先查找子窗口
+	//鍏堟煡鎵惧瓙绐楀彛
 	EnumWindows(EnumWindowsDingweiProc, (LPARAM)(hWnd));
 }
 
 void CSystemSettingWnd::SetDingweiWnd(std::wstring value, HWND hWnd)
 {
+	CLewaimaiString::Replace(value, L"楼", L"");
+
 	std::string s_value = CLewaimaiString::UnicodeToUTF8(value);
 	if (s_value == "" || !atof(s_value.c_str()))
 	{
 		CEditUI* dingwei_value_edit = static_cast<CEditUI*>(m_pm.FindControl(_T("jinezhuaqu_setting_chuangkou_dingwei_value")));
-		dingwei_value_edit->SetText(L"无有效金额");
+		dingwei_value_edit->SetText(L"无有效金额");
 
 		hWnd = NULL;
 	}
@@ -804,7 +806,7 @@ void CSystemSettingWnd::SetDingweiWnd(std::wstring value, HWND hWnd)
 	{
 		CEditUI* dingwei_value_edit = static_cast<CEditUI*>(m_pm.FindControl(_T("jinezhuaqu_setting_chuangkou_dingwei_value")));
 		
-		std::wstring info = L"有效金额:" + value + L" 元";
+		std::wstring info = L"有效金额:" + value + L" 元";
 		dingwei_value_edit->SetText(info.c_str());
 	}
 
@@ -815,13 +817,13 @@ void CSystemSettingWnd::SetDingweiWnd(std::wstring value, HWND hWnd)
 		return;
 	}
 
-	//找到定位的窗口的位置信息
+	//鎵惧埌瀹氫綅鐨勭獥鍙g殑浣嶇疆淇℃伅
 	FindDingweiWnd(m_DingweiWnd);
 }
 
 void CSystemSettingWnd::SetOcrWnd(RECT rect)
 {
-	//先把确认的区域保存下来
+	//先把确认的区域保存下来
 	m_ocrRect = rect;
 
 	if (IsRectEmpty(&rect))
@@ -829,32 +831,32 @@ void CSystemSettingWnd::SetOcrWnd(RECT rect)
 		return;
 	}
 
-	//开始识别;
+	//开始识别;
 	CBitmapHelper helper;
 	
-	//先截屏
+	//先截屏
 	HBITMAP h_bitmap = helper.CopyScreenToBitmap(&m_ocrRect);
 
-	//将被截图的进行缩放,用于预览展示
+	//灏嗚�鎴�浘鐨勮繘琛岀缉鏀撅紝鐢ㄤ簬棰勮�灞曠ず
 	HBITMAP h_show_bitmap = helper.Scale(h_bitmap, 320, 200);
 
 	DeleteObject(h_bitmap);
 
-	//获得缩放后的图像的信息
+	//获得缩放后的图像的信息
 	BITMAP  Bitmap;
 	GetObject(h_show_bitmap, sizeof(BITMAP), (LPSTR)&Bitmap);	
 
 	CControlUI* preview = static_cast<CControlUI*>(m_pm.FindControl(_T("jinezhuaqu_setting_ocr_select_value_search_result_img")));
 
-	//先删除旧的图片
+	//先删除旧的图片
 	std::wstring oldImage = preview->GetBkImage();
 	m_pm.RemoveImage(oldImage.c_str());
 
-	//准备替换新的图片
+	//鍑嗗�鏇挎崲鏂扮殑鍥剧墖
 	std::srand((unsigned int)time(NULL));
 	std::wstring image_name = to_wstring(std::rand());
 
-	//图片名字一定要每次不一样,不然不会更新
+	//鍥剧墖鍚嶅瓧涓€瀹氳�姣忔�涓嶄竴鏍凤紝涓嶇劧涓嶄細鏇存柊
 	std::wstring newImage = _T("jinezhuaqu_setting_ocr_select_value_search_result_img_") + image_name;
 	m_pm.AddImage(newImage.c_str(), h_show_bitmap, Bitmap.bmWidth, Bitmap.bmHeight, false);
 	
@@ -876,13 +878,13 @@ void CSystemSettingWnd::SetOcrWnd(RECT rect)
 
 	bool ret = helper.OcrRect(tess, &m_ocrRect, ocr_result);
 
-	//更新识别结果
+	//鏇存柊璇嗗埆缁撴灉
 	CEditUI* ocr_value_edit = static_cast<CEditUI*>(m_pm.FindControl(_T("jinezhuaqu_setting_ocr_select_value")));
 
 	if (!atof(ocr_result.c_str()))
 	{
-		//识别结果不是有效的数字
-		ocr_value_edit->SetText(L"未识别到有效金额");
+		//识别结果不是有效的数字
+		ocr_value_edit->SetText(L"鏈�瘑鍒�埌鏈夋晥閲戦�");
 	}
 	else
 	{

+ 3 - 0
zhipuzi_pay_plugin/wnd/CValueWnd.cpp

@@ -223,6 +223,9 @@ void CValueWnd::WatchWnd()
                 value = lpWindowName;
             }
 
+			//先对获取到的值做一下处理,删除掉人民币符号
+			CLewaimaiString::Replace(CLewaimaiString::UTF8ToUnicode(value), L"¥", L"");
+
             if(value != m_watchValue)
             {
 				//保存下来窗口获取到的值