Просмотр исходного кода

先存一个版本,再看另外一个版本

张洋 6 лет назад
Родитель
Сommit
a8a45a4f46
26 измененных файлов с 294 добавлено и 28 удалено
  1. BIN
      bin/Win32/Debug/zhipuzi_pay_plugin/skin/button_down.bmp
  2. BIN
      bin/Win32/Debug/zhipuzi_pay_plugin/skin/button_nor.bmp
  3. BIN
      bin/Win32/Debug/zhipuzi_pay_plugin/skin/button_over.bmp
  4. BIN
      bin/Win32/Debug/zhipuzi_pay_plugin/skin/close_hover.png
  5. BIN
      bin/Win32/Debug/zhipuzi_pay_plugin/skin/close_normal.png
  6. 1 1
      bin/Win32/Debug/zhipuzi_pay_plugin/skin/jinezhuaqu_setting.xml
  7. 10 0
      bin/Win32/Debug/zhipuzi_pay_plugin/skin/kuaijiejian_setting.xml
  8. 1 1
      bin/Win32/Debug/zhipuzi_pay_plugin/skin/menu.xml
  9. BIN
      bin/Win32/Debug/zhipuzi_pay_plugin/skin/setting_tab_bkg.png
  10. 8 6
      bin/Win32/Debug/zhipuzi_pay_plugin/skin/shoukuan_wnd.xml
  11. 19 13
      bin/Win32/Debug/zhipuzi_pay_plugin/skin/system_setting.xml
  12. BIN
      bin/Win32/Debug/zhipuzi_pay_plugin/ucrtbase.dll
  13. BIN
      bin/Win32/Debug/zhipuzi_pay_plugin/ucrtbased.dll
  14. BIN
      bin/Win32/Debug/zhipuzi_pay_plugin/vcruntime140.dll
  15. BIN
      bin/Win32/Debug/zhipuzi_pay_plugin/zhipuzi_pay_plugin.exe
  16. BIN
      bin/Win32/Debug/zhipuzi_pay_plugin/zpzDll.dll
  17. BIN
      dll/debug/ucrtbase.dll
  18. BIN
      dll/debug/ucrtbased.dll
  19. BIN
      dll/debug/vcruntime140.dll
  20. 13 0
      zhipuzi_pay_plugin/wnd/CMenuWnd.cpp
  21. 2 0
      zhipuzi_pay_plugin/wnd/CMenuWnd.h
  22. 15 1
      zhipuzi_pay_plugin/wnd/CShoukuanWnd.cpp
  23. 149 1
      zhipuzi_pay_plugin/wnd/CSystemSettingWnd.cpp
  24. 13 0
      zhipuzi_pay_plugin/wnd/CSystemSettingWnd.h
  25. 55 3
      zhipuzi_pay_plugin/wnd/CValueWnd.cpp
  26. 8 2
      zhipuzi_pay_plugin/wnd/CValueWnd.h

BIN
bin/Win32/Debug/zhipuzi_pay_plugin/skin/button_down.bmp


BIN
bin/Win32/Debug/zhipuzi_pay_plugin/skin/button_nor.bmp


BIN
bin/Win32/Debug/zhipuzi_pay_plugin/skin/button_over.bmp


BIN
bin/Win32/Debug/zhipuzi_pay_plugin/skin/close_hover.png


BIN
bin/Win32/Debug/zhipuzi_pay_plugin/skin/close_normal.png


+ 1 - 1
bin/Win32/Debug/zhipuzi_pay_plugin/skin/jinezhuaqu_setting.xml

@@ -111,6 +111,6 @@
 			</HorizontalLayout>
 			</HorizontalLayout>
 		</VerticalLayout>
 		</VerticalLayout>
 		
 		
-		<Button name="jinezhuaqu_setting_save" width="150" height="42" padding="30,30,0,0" text="保存" textcolor="#FFFFFFFF" normalimage="file='Btn_Red.png' corner='5,5,5,5'" hotimage="file='Btn_Red_Hover.png' corner='5,5,5,5'" pushedimage="file='Btn_Red_Click.png' corner='5,5,5,5'" />
+		<Button name="jinezhuaqu_setting_save" width="150" height="42" padding="30,30,0,0" text="保存" textcolor="#FFFFFFFF" normalimage="file='Btn_Green.png' corner='5,5,5,5'" hotimage="file='Btn_Green_Hover.png' corner='5,5,5,5'" pushedimage="file='Btn_Green_Click.png' corner='5,5,5,5'" />
 	</ZhuaquSetting>
 	</ZhuaquSetting>
 </Window>
 </Window>

+ 10 - 0
bin/Win32/Debug/zhipuzi_pay_plugin/skin/kuaijiejian_setting.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Window>
+	<Font id="0" name="微软雅黑" size="16" />
+	<VerticalLayout vscrollbar="true">
+		<HorizontalLayout height="48" padding="20,30,0,0">
+			<Label text="抓取金额结算:" font="0" width="120" padding="30,0,0,0"/>
+			<Button name="kuaijiejian_setting_jiesuan_btn" width="150" height="34" padding="0,5,0,5" normalimage="file='Chat_InputBox_BG.png' corner='4,4,4,4'" hotimage="file='Chat_InputBox_BG_Hover.png' corner='4,4,4,4'" />
+		</HorizontalLayout>
+	</VerticalLayout>
+</Window>

+ 1 - 1
bin/Win32/Debug/zhipuzi_pay_plugin/skin/menu.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
 <?xml version="1.0" encoding="utf-8"?>
-<Window size="220,380" caption="0,0,0,0" layeredimage="file='value_bkg.png' corner='5,5,5,5'" layeredopacity="255">
+<Window size="220,300" caption="0,0,0,0" layeredimage="file='value_bkg.png' corner='5,5,5,5'" layeredopacity="255">
  <Font id="0" name="微软雅黑" size="16"/>
  <Font id="0" name="微软雅黑" size="16"/>
  <Font id="1" name="微软雅黑" size="20"/>
  <Font id="1" name="微软雅黑" size="20"/>
 <VerticalLayout bkimage="file='value_bkg.png' corner='5,5,5,5'">
 <VerticalLayout bkimage="file='value_bkg.png' corner='5,5,5,5'">

BIN
bin/Win32/Debug/zhipuzi_pay_plugin/skin/setting_tab_bkg.png


+ 8 - 6
bin/Win32/Debug/zhipuzi_pay_plugin/skin/shoukuan_wnd.xml

@@ -6,15 +6,17 @@
 	<Font id="3" name="微软雅黑" size="32" />
 	<Font id="3" name="微软雅黑" size="32" />
 	<VerticalLayout bkimage="shoukuan_bkg.png" >
 	<VerticalLayout bkimage="shoukuan_bkg.png" >
 		<HorizontalLayout name="shoukuan_title_bkg" height="44" bkcolor="0xFF3CB371">
 		<HorizontalLayout name="shoukuan_title_bkg" height="44" bkcolor="0xFF3CB371">
-			<Label name="shoukuan_version" text="收款" height="44" align="center" valign="center" padding="0,0,0,0" textcolor="#FFFFFFFF" font="0"/>
+			<Label name="shoukuan_version" text="收款" height="44" align="center" valign="center" padding="0,0,0,0" textcolor="#FFFFFFFF" font="2"/>
 		</HorizontalLayout>
 		</HorizontalLayout>
 		
 		
 		<VerticalLayout visible="true" name="shoukuan_before_pay_layout" height="290" padding="0,20,0,0">
 		<VerticalLayout visible="true" name="shoukuan_before_pay_layout" height="290" padding="0,20,0,0">
-			<HorizontalLayout name="shoukuan_money_input_layout" height="50" padding="0,15,0,0">
-				<Label text="金额:" font="2" float="true" pos="100,12,180,40"/>
-				<Edit name="money_edit" float="true" pos="183,12,400,48" normalimage="file='Chat_InputBox_BG.png' corner='4,4,4,4'" hotimage="file='Chat_InputBox_BG_Hover.png' corner='4,4,4,4'" />
+			<HorizontalLayout name="shoukuan_money_input_layout" height="60" padding="0,15,0,0">
+				<Label height="40" padding="190,20,0,10" name="shoukuan_before_pay_huobi" text="¥" font="0" textcolor="0xFF3CB371"></Label>
+				<Edit name="money_edit" float="true" pos="223,0,400,60" font="1" textcolor="0xFF3CB371" bkcolor="0xFFFCFCFC" nativebkcolor="0xFFFCFCFC"/>
 			</HorizontalLayout>
 			</HorizontalLayout>
 			
 			
+			<Control height="1" padding="120,5,120,0" bkcolor="0xFF3CB371"></Control>
+			
 			<HorizontalLayout name="shoukuan_money_show_layout" height="50" padding="0,15,0,15" visible="false">
 			<HorizontalLayout name="shoukuan_money_show_layout" height="50" padding="0,15,0,15" visible="false">
 				<Label text="¥" font="0" textcolor="0xFF3CB371" float="true" pos="200,24,215,50"/>
 				<Label text="¥" font="0" textcolor="0xFF3CB371" float="true" pos="200,24,215,50"/>
 				<Label name="shoukuan_money_show_money" font="1" textcolor="0xFF3CB371" float="true" pos="225,12,500,48"/>
 				<Label name="shoukuan_money_show_money" font="1" textcolor="0xFF3CB371" float="true" pos="225,12,500,48"/>
@@ -27,8 +29,8 @@
 			
 			
 			<HorizontalLayout height="60" padding="0,30,0,0">
 			<HorizontalLayout height="60" padding="0,30,0,0">
 				<Control></Control>
 				<Control></Control>
-				<Button name="shoukuanBtn" text="确认" textcolor="#FFFFFFFF" height="50" width="150" padding="0,0,0,0" tooltip="点击这里确认收款" normalimage="file='Btn_Green.png' corner='5,5,5,5'" hotimage="file='Btn_Green_Hover.png' corner='5,5,5,5'" pushedimage="file='Btn_Green_Click.png' corner='5,5,5,5'" />
-				<Button name="closebtn" text="关闭" textcolor="#FFFFFFFF" height="50" width="150" padding="20,0,0,0" tooltip="点击这里取消收款" normalimage="file='Btn_Red.png' corner='5,5,5,5'" hotimage="file='Btn_Red_Hover.png' corner='5,5,5,5'" pushedimage="file='Btn_Red_Click.png' corner='5,5,5,5'" />
+				<Button name="shoukuanBtn" text="确认" font="2" textcolor="#FFFFFFFF" height="50" width="150" padding="0,0,0,0" tooltip="点击这里确认收款" normalimage="file='Btn_Green.png' corner='5,5,5,5'" hotimage="file='Btn_Green_Hover.png' corner='5,5,5,5'" pushedimage="file='Btn_Green_Click.png' corner='5,5,5,5'" />
+				<Button name="closebtn" text="关闭" font="2" textcolor="#FFFFFFFF" height="50" width="150" padding="20,0,0,0" tooltip="点击这里取消收款" normalimage="file='Btn_Red.png' corner='5,5,5,5'" hotimage="file='Btn_Red_Hover.png' corner='5,5,5,5'" pushedimage="file='Btn_Red_Click.png' corner='5,5,5,5'" />
 				<Control></Control>
 				<Control></Control>
 			</HorizontalLayout>	
 			</HorizontalLayout>	
 
 

+ 19 - 13
bin/Win32/Debug/zhipuzi_pay_plugin/skin/system_setting.xml

@@ -1,19 +1,21 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
-<Window size="800,600" caption="0,0,0,36" roundcorner="4,4" >
-	<VerticalLayout bkimage="file='Dialog_BG1.png' corner='4,50,4,4'">
-		<HorizontalLayout height="40" inset="10,2,10,0">
-			<Label name="system_setting_title" text="系统设置" width="100" />
-			<Control />
-			<Button name="system_setting_closebtn" padding="0,4,0,0" width="22" height="22" tooltip="关闭" normalimage="file='Login_TopBar_Close_Btn.png'" hotimage="file='Login_TopBar_Close_Btn_Hover.png'" pushedimage="file='Login_TopBar_Close_Btn_Click.png'"/>
+<Window size="800,600" caption="0,0,0,44" roundcorner="4,4" >
+	<Font id="0" name="微软雅黑" size="16" />
+	<Font id="1" name="微软雅黑" size="40" />
+	<Font id="2" name="微软雅黑" size="18" />
+	<Font id="3" name="微软雅黑" size="32" />
+	<VerticalLayout bkimage="shoukuan_bkg.png">
+		<HorizontalLayout name="shoukuan_title_bkg" height="44" bkcolor="0xFF3CB371">
+			<Label name="system_setting_title" text="设置" height="44" align="center" valign="center" padding="0,0,0,0" textcolor="#FFFFFFFF" font="2"/>
+			<Button name="system_setting_closebtn" padding="0,13,15,0" width="16" height="16" tooltip="关闭" normalimage="file='close_normal.png'" hotimage="file='close_hover.png'" pushedimage="file='close_normal.png'"/>
 		</HorizontalLayout>
 		</HorizontalLayout>
 		<HorizontalLayout>
 		<HorizontalLayout>
-			<VerticalLayout width="150" bkcolor="0xFFF8F8F8">
-				<VerticalLayout>  			
-					<Control height="120" ></Control>
-    				<Option name="system_setting_option_zhuaqu" text="金额抓取" group="system_setting_item" selected="true" height="22" hotimage="tab_hot.bmp" selectedimage="tab_select.bmp" />
-					<Option name="system_setting_option_about" text="关于" group="system_setting_item" height="22" hotimage="tab_hot.bmp" selectedimage="tab_select.bmp" />
-    			</VerticalLayout>
-			</VerticalLayout>
+			<VerticalLayout width="160" bkcolor="0xFFF8F8F8">			
+				<Control height="150" ></Control>
+				<Option name="system_setting_option_zhuaqu" text="金额抓取" font="0" group="system_setting_item" selected="true" height="40" hotimage="tab_hot.bmp" selectedimage="setting_tab_bkg.png" selectedtextcolor="0xFFFFFFFF"/>
+				<Option name="system_setting_option_kuaijiejian" text="快捷键" font="0" group="system_setting_item" height="40" hotimage="tab_hot.bmp" selectedimage="setting_tab_bkg.png" selectedtextcolor="0XFFFFFFFF"/>
+				<Option name="system_setting_option_about" text="关于" font="0" group="system_setting_item" height="40" hotimage="tab_hot.bmp" selectedimage="setting_tab_bkg.png" selectedtextcolor="0XFFFFFFFF"/>
+   			</VerticalLayout>
 			
 			
 			<TabLayout name="switch">
 			<TabLayout name="switch">
 				<HorizontalLayout vscrollbar="true">
 				<HorizontalLayout vscrollbar="true">
@@ -21,6 +23,10 @@
 				</HorizontalLayout>
 				</HorizontalLayout>
 				
 				
 				<HorizontalLayout vscrollbar="true">
 				<HorizontalLayout vscrollbar="true">
+					<Include source="kuaijiejian_setting.xml" />
+				</HorizontalLayout>
+				
+				<HorizontalLayout vscrollbar="true">
 					<Label text="222"></Label>
 					<Label text="222"></Label>
 				</HorizontalLayout>
 				</HorizontalLayout>
 			</TabLayout>
 			</TabLayout>

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


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


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


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


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


BIN
dll/debug/ucrtbase.dll


BIN
dll/debug/ucrtbased.dll


BIN
dll/debug/vcruntime140.dll


+ 13 - 0
zhipuzi_pay_plugin/wnd/CMenuWnd.cpp

@@ -154,6 +154,14 @@ LRESULT CMenuWnd::OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled
 	return 0;
 	return 0;
 }
 }
 
 
+LRESULT CMenuWnd::OnKillFocus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+{
+	this->ShowWindow(false);
+
+	bHandled = TRUE;
+	return 0;
+}
+
 LRESULT CMenuWnd::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
 LRESULT CMenuWnd::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
 {
 {
 	LRESULT lRes = 0;
 	LRESULT lRes = 0;
@@ -192,6 +200,11 @@ LRESULT CMenuWnd::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
 	case WM_SIZE:
 	case WM_SIZE:
 		lRes = OnSize(uMsg, wParam, lParam, bHandled);
 		lRes = OnSize(uMsg, wParam, lParam, bHandled);
 		break;
 		break;
+
+	case WM_KILLFOCUS:
+		lRes = OnKillFocus(uMsg, wParam, lParam, bHandled);
+		break;
+
 	default:
 	default:
 		bHandled = FALSE;
 		bHandled = FALSE;
 	}
 	}

+ 2 - 0
zhipuzi_pay_plugin/wnd/CMenuWnd.h

@@ -44,6 +44,8 @@ public:
 
 
 	LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
 	LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
 
 
+	LRESULT OnKillFocus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+
 	LRESULT HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);
 	LRESULT HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);
 
 
 	LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, bool& bHandled);
 	LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, bool& bHandled);

+ 15 - 1
zhipuzi_pay_plugin/wnd/CShoukuanWnd.cpp

@@ -333,6 +333,8 @@ LRESULT CShoukuanWnd::OnShoukuanSuccess(UINT uMsg, WPARAM wParam, LPARAM lParam,
 	std::wstring valueInfo = L"成功收款:¥" + m_money;
 	std::wstring valueInfo = L"成功收款:¥" + m_money;
 	pMoneyPaySuccess->SetText(valueInfo.c_str());
 	pMoneyPaySuccess->SetText(valueInfo.c_str());
 
 
+	SetFocus(m_hWnd);
+
 	bHandled = TRUE;
 	bHandled = TRUE;
 	return 0;
 	return 0;
 }
 }
@@ -353,6 +355,8 @@ LRESULT CShoukuanWnd::OnShoukuanFail(UINT uMsg, WPARAM wParam, LPARAM lParam, BO
 	std::wstring ws_fail_message = L"失败信息:" + CLewaimaiString::UTF8ToUnicode(m_fail_message) + L",按任意键关闭窗口";;
 	std::wstring ws_fail_message = L"失败信息:" + CLewaimaiString::UTF8ToUnicode(m_fail_message) + L",按任意键关闭窗口";;
 	pFailMessage->SetText(ws_fail_message.c_str());
 	pFailMessage->SetText(ws_fail_message.c_str());
 
 
+	SetFocus(m_hWnd);
+
 	bHandled = TRUE;
 	bHandled = TRUE;
 	return 0;
 	return 0;
 }
 }
@@ -587,8 +591,18 @@ void CShoukuanWnd::HandleShoukuanPassword()
 
 
 			break;
 			break;
 		}
 		}
-		else
+		else if (s_status == "real_fail")
+		{
+			//表示顾客那边出问题,已经失败了
+			m_shoukuan_status = 4;
+
+			m_fail_message = data["message"].GetString();
+
+			SendMessage(WM_SHOUKUAN_STATUS_FAIL, 0, 0);
+		}
+		else if (s_status == "fail")
 		{
 		{
+			//这个只是表示状态未知
 			Sleep(1000);
 			Sleep(1000);
 		}
 		}
 	}
 	}

+ 149 - 1
zhipuzi_pay_plugin/wnd/CSystemSettingWnd.cpp

@@ -291,6 +291,109 @@ LRESULT CSystemSettingWnd::OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL&
 	return 0;
 	return 0;
 }
 }
 
 
+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之类的
+					m_mod = 0;
+					duiText.Format(_T("F%d"), wParam - VK_F1 + 1);
+				}
+				else if(m_mod == MOD_CONTROL)
+				{
+					duiText.Format(_T("CTRL + %c"), wParam);
+				}
+				else if (m_mod == MOD_ALT)
+				{
+					duiText.Format(_T("ALT + %c"), wParam);
+				}
+				else if(m_mod == MOD_SHIFT)
+				{
+					duiText.Format(_T("SHIFT + %c"), wParam);
+				}
+				else if(m_mod == 0)
+				{
+					//直接按的字母键,无效
+					m_mod = 0;
+					m_vk = 0;
+					m_isSet = false;
+
+					bHandled = TRUE;;
+					return 0;
+				}
+
+				//到这里来设置成功了,做展示
+				if (m_kuaijiejian_type == 1)
+				{
+					CEditUI* focusEdit = static_cast<CEditUI*>(m_pm.FindControl(_T("kuaijiejian_setting_jiesuan_btn")));
+					focusEdit->SetText(duiText);
+				}
+
+				m_vk = wParam;
+
+				m_isSet = true;
+			}
+			else
+			{
+				//按的是控制键,这里只支持3选1,不能更多组合
+				if (wParam == VK_CONTROL)
+				{
+					m_mod = MOD_CONTROL;
+				}
+				else if (wParam == VK_MENU)
+				{
+					m_mod = MOD_ALT;
+				}
+				else if(wParam == VK_SHIFT)
+				{
+					m_mod = MOD_SHIFT;
+				}
+
+				m_isSet = false;
+			}
+		}
+		else if(uMsg == WM_KEYUP || uMsg == WM_SYSKEYUP)
+		{
+			//这个是只按了控制键,没有按其他的键
+			if (!m_isSet)
+			{
+				if (wParam == VK_CONTROL)
+				{
+					m_mod = 0;
+				}
+				else if (wParam == VK_MENU)
+				{
+					m_mod = 0;
+				}
+				else if(wParam == VK_SHIFT)
+				{
+					m_mod = 0;
+				}
+			}
+			else
+			{
+				//这里表示已经设置好了,等后面保存
+
+			}
+
+			return 0;
+		}
+	}
+
+	bHandled = TRUE;
+	return 0;
+}
+
 LRESULT CSystemSettingWnd::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
 LRESULT CSystemSettingWnd::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
 {
 {
 	LRESULT lRes = 0;
 	LRESULT lRes = 0;
@@ -315,6 +418,12 @@ LRESULT CSystemSettingWnd::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam
 	case WM_SIZE:
 	case WM_SIZE:
 		lRes = OnSize(uMsg, wParam, lParam, bHandled);
 		lRes = OnSize(uMsg, wParam, lParam, bHandled);
 		break;
 		break;
+	case WM_KEYDOWN:
+		lRes = OnKeyDown(uMsg, wParam, lParam, bHandled);
+		break;
+	case WM_SYSKEYDOWN:
+		lRes = OnKeyDown(uMsg, wParam, lParam, bHandled);
+		break;
 	default:
 	default:
 		bHandled = FALSE;
 		bHandled = FALSE;
 	}
 	}
@@ -375,6 +484,13 @@ void CSystemSettingWnd::Notify(TNotifyUI& msg)
 	{
 	{
 		HandleItemSelectMsg(msg);
 		HandleItemSelectMsg(msg);
 	}
 	}
+	else if (msg.sType == _T("setfocus"))
+	{
+		if (msg.pSender->GetName() == L"kuaijiejian_setting_jiesuan_edit")
+		{
+			SetFocus(m_hWnd);
+		}
+	}
 }
 }
 
 
 void CSystemSettingWnd::HandleClickMsg(TNotifyUI& msg)
 void CSystemSettingWnd::HandleClickMsg(TNotifyUI& msg)
@@ -482,6 +598,14 @@ void CSystemSettingWnd::HandleClickMsg(TNotifyUI& msg)
 		//给监视窗口发个消息
 		//给监视窗口发个消息
 		m_valueWnd->RestartWatch();
 		m_valueWnd->RestartWatch();
 	}
 	}
+	else if (senderName == _T("kuaijiejian_setting_jiesuan_btn"))
+	{
+		m_kuaijiejian_type = 1;
+
+		m_mod = 0;
+		m_vk = 0;
+		m_isSet = false;
+	}
 }
 }
 
 
 void CSystemSettingWnd::HandleSelectChangeMsg(TNotifyUI& msg)
 void CSystemSettingWnd::HandleSelectChangeMsg(TNotifyUI& msg)
@@ -499,7 +623,7 @@ void CSystemSettingWnd::HandleSelectChangeMsg(TNotifyUI& msg)
 		}
 		}
 	}
 	}
 
 
-	else if (name == _T("system_setting_option_about"))
+	else if (name == _T("system_setting_option_kuaijiejian"))
 	{
 	{
 		CTabLayoutUI* pControl = static_cast<CTabLayoutUI*>(m_pm.FindControl(_T("switch")));
 		CTabLayoutUI* pControl = static_cast<CTabLayoutUI*>(m_pm.FindControl(_T("switch")));
 
 
@@ -507,6 +631,18 @@ void CSystemSettingWnd::HandleSelectChangeMsg(TNotifyUI& msg)
 		{
 		{
 			pControl->SelectItem(1);
 			pControl->SelectItem(1);
 		}
 		}
+
+		m_is_kuaijiepan_page = true;
+	}
+
+	else if (name == _T("system_setting_option_about"))
+	{
+		CTabLayoutUI* pControl = static_cast<CTabLayoutUI*>(m_pm.FindControl(_T("switch")));
+
+		if (pControl && pControl->GetCurSel() != 2)
+		{
+			pControl->SelectItem(2);
+		}
 	}
 	}
 
 
 	else if (name == _T("jinezhuaqu_setting_chuankou"))
 	else if (name == _T("jinezhuaqu_setting_chuankou"))
@@ -723,3 +859,15 @@ void CSystemSettingWnd::SetOcrWnd(RECT rect)
 		ocr_value_edit->SetText(ws_ocr_result.c_str());
 		ocr_value_edit->SetText(ws_ocr_result.c_str());
 	}	
 	}	
 }
 }
+
+CEditUI* CSystemSettingWnd::GetFocusEdit()
+{
+	CEditUI* jiesuan_edit = static_cast<CEditUI*>(m_pm.FindControl(_T("kuaijiejian_setting_jiesuan_edit")));
+
+	if (jiesuan_edit->IsFocused())
+	{
+		return jiesuan_edit;
+	}
+
+	return NULL;
+}

+ 13 - 0
zhipuzi_pay_plugin/wnd/CSystemSettingWnd.h

@@ -69,6 +69,8 @@ public:
 
 
 	LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
 	LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
 
 
+	LRESULT OnKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+
 	LRESULT HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);
 	LRESULT HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);
 
 
 	LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, bool& bHandled);
 	LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, bool& bHandled);
@@ -77,6 +79,8 @@ public:
 
 
 	void SetOcrWnd(RECT rect);
 	void SetOcrWnd(RECT rect);
 
 
+	CEditUI* GetFocusEdit();
+
 private:
 private:
 	void FindValueWnd(std::wstring value);
 	void FindValueWnd(std::wstring value);
 
 
@@ -92,5 +96,14 @@ private:
 	HWND m_DingweiWnd = NULL;
 	HWND m_DingweiWnd = NULL;
 
 
 	RECT m_ocrRect;
 	RECT m_ocrRect;
+
+	//ÉèÖÿì½Ý¼üÏà¹Ø
+	UINT m_mod = 0;
+	UINT m_vk = 0;
+	bool m_isSet = false;
+
+	bool m_is_kuaijiepan_page = false;
+	int m_kuaijiejian_type = 0;
+
 };
 };
 
 

+ 55 - 3
zhipuzi_pay_plugin/wnd/CValueWnd.cpp

@@ -27,6 +27,10 @@ void CValueWnd::Init()
 	//抢焦点
 	//抢焦点
 	std::thread(&CValueWnd::TopMostWnd, this).detach();
 	std::thread(&CValueWnd::TopMostWnd, this).detach();
 
 
+	//注册组合键
+	int nRet = RegisterHotKey(m_hWnd, 1, MOD_CONTROL, 'D');
+	int b = nRet;
+
     //添加托盘图标
     //添加托盘图标
     AddTrayIcon();
     AddTrayIcon();
 
 
@@ -59,7 +63,7 @@ void CValueWnd::Init()
 	m_tess.SetVariable("save_best_choices", "T");
 	m_tess.SetVariable("save_best_choices", "T");
 
 
     //再安装钩子
     //再安装钩子
-    //BOOL ret = InstallHook();
+    BOOL ret = InstallHook();
 
 
     //开始启动监听
     //开始启动监听
     RestartWatch();
     RestartWatch();
@@ -221,6 +225,7 @@ void CValueWnd::WatchWnd()
 
 
             if(value != m_watchValue)
             if(value != m_watchValue)
             {
             {
+				//保存下来窗口获取到的值
                 m_watchValue = value;
                 m_watchValue = value;
 
 
                 SendMessage(WM_WATCH_WND_UPDATE, NULL, NULL);
                 SendMessage(WM_WATCH_WND_UPDATE, NULL, NULL);
@@ -304,6 +309,8 @@ void CValueWnd::StartOcrWork()
 				else
 				else
 				{
 				{
 					std::string format_value = CLewaimaiString::DoubleToString(atof(ocr_result.c_str()), 2);
 					std::string format_value = CLewaimaiString::DoubleToString(atof(ocr_result.c_str()), 2);
+					m_watchValue = format_value;
+
 					std::wstring ws_ocr_result = CLewaimaiString::UTF8ToUnicode(format_value);
 					std::wstring ws_ocr_result = CLewaimaiString::UTF8ToUnicode(format_value);
 
 
 					CLabelUI* valueLabel = static_cast<CLabelUI*>(m_pm.FindControl(_T("value")));
 					CLabelUI* valueLabel = static_cast<CLabelUI*>(m_pm.FindControl(_T("value")));
@@ -429,6 +436,12 @@ LRESULT CValueWnd::OnRButtonDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL&
 	return 0;
 	return 0;
 }
 }
 
 
+LRESULT CValueWnd::OnKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+{
+	bHandled = FALSE;
+	return 0;
+}
+
 LRESULT CValueWnd::OnKexianUpdate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
 LRESULT CValueWnd::OnKexianUpdate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
 {
 {
     //如果当前不是串口模式,直接忽略
     //如果当前不是串口模式,直接忽略
@@ -521,6 +534,14 @@ LRESULT CValueWnd::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
         lRes = OnWatchWndUpdate(uMsg, wParam, lParam, bHandled);
         lRes = OnWatchWndUpdate(uMsg, wParam, lParam, bHandled);
         break;
         break;
 
 
+	case WM_HOTKEY:
+		lRes = OnHotKey(uMsg, wParam, lParam, bHandled);
+		break;
+
+	case WM_KEYDOWN:
+  		lRes = OnKeyDown(uMsg, wParam, lParam, bHandled);
+		break;
+
     default:
     default:
         bHandled = FALSE;
         bHandled = FALSE;
     }
     }
@@ -564,7 +585,11 @@ void CValueWnd::ShowShoukuan()
 		m_shoukuanWnd = pShoukuanWnd;
 		m_shoukuanWnd = pShoukuanWnd;
 		m_shoukuanHWND = pShoukuanWnd->GetHWND();
 		m_shoukuanHWND = pShoukuanWnd->GetHWND();
 
 
-		//pShoukuanWnd->InitMoney(L"0.01");
+		//只要金额不为0,就初始化
+		if (atof(m_watchValue.c_str()) > 0.001)
+		{
+			pShoukuanWnd->InitMoney(CLewaimaiString::UTF8ToUnicode(m_watchValue));
+		}
 
 
 		UINT ret = pShoukuanWnd->ShowModal();
 		UINT ret = pShoukuanWnd->ShowModal();
 
 
@@ -613,6 +638,22 @@ LRESULT CValueWnd::OnTrayIcon(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHa
     return 0;
     return 0;
 }
 }
 
 
+LRESULT CValueWnd::OnHotKey(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+{
+	UINT  fuModifiers = (UINT)LOWORD(lParam);    
+	UINT  uVirtKey = (UINT)HIWORD(lParam);  
+
+	//判断响应了什么热键   
+	if (MOD_CONTROL == fuModifiers && 'D' == uVirtKey)
+	{
+		//按了CTRL + D
+		ShowShoukuan();
+	}
+
+	bHandled = TRUE;
+	return  0;
+}
+
 void CValueWnd::ShowSystemSetting()
 void CValueWnd::ShowSystemSetting()
 {
 {
 	//先隐藏目录
 	//先隐藏目录
@@ -696,6 +737,8 @@ void CValueWnd::UpdateKexian(const char* data, int length)
         CLabelUI* valueLabel = static_cast<CLabelUI*>(m_pm.FindControl(_T("value")));
         CLabelUI* valueLabel = static_cast<CLabelUI*>(m_pm.FindControl(_T("value")));
 
 
         std::string money_show = CLewaimaiString::DoubleToString(atof(money.c_str()), 2);
         std::string money_show = CLewaimaiString::DoubleToString(atof(money.c_str()), 2);
+		m_watchValue = money_show;
+
         valueLabel->SetText(CLewaimaiString::UTF8ToUnicode(money_show).c_str());
         valueLabel->SetText(CLewaimaiString::UTF8ToUnicode(money_show).c_str());
     }
     }
     else
     else
@@ -709,6 +752,8 @@ void CValueWnd::UpdateKexian(const char* data, int length)
             CLabelUI* valueLabel = static_cast<CLabelUI*>(m_pm.FindControl(_T("value")));
             CLabelUI* valueLabel = static_cast<CLabelUI*>(m_pm.FindControl(_T("value")));
 
 
             std::string money_show = CLewaimaiString::DoubleToString(atof(money.c_str()), 2);
             std::string money_show = CLewaimaiString::DoubleToString(atof(money.c_str()), 2);
+			m_watchValue = money_show;
+
             valueLabel->SetText(CLewaimaiString::UTF8ToUnicode(money_show).c_str());
             valueLabel->SetText(CLewaimaiString::UTF8ToUnicode(money_show).c_str());
         }
         }
         else
         else
@@ -785,10 +830,17 @@ void CValueWnd::ShowTrayMenu()
     POINT pt;
     POINT pt;
     GetCursorPos(&pt);
     GetCursorPos(&pt);
 
 
+	CRect rect;
+	GetWindowRect(pMenu->GetHWND(), &rect);
+
+	int height = rect.bottom - rect.top;
+
     //显示目录
     //显示目录
-	::SetWindowPos(pMenu->GetHWND(), HWND_NOTOPMOST, pt.x, pt.y - 15 - 380, 0, 0, SWP_NOSIZE | SWP_NOACTIVATE);
+	::SetWindowPos(pMenu->GetHWND(), HWND_NOTOPMOST, pt.x, pt.y - 15 - height, 0, 0, SWP_NOSIZE | SWP_NOACTIVATE);
 	pMenu->ShowWindow(true);
 	pMenu->ShowWindow(true);
 
 
+	SetFocus(pMenu->GetHWND());
+
 	//右击后点别地可以清除“右击出来的菜单”
 	//右击后点别地可以清除“右击出来的菜单”
 	SetForegroundWindow(pMenu->GetHWND());
 	SetForegroundWindow(pMenu->GetHWND());
 }
 }

+ 8 - 2
zhipuzi_pay_plugin/wnd/CValueWnd.h

@@ -49,6 +49,8 @@ public:
 	LRESULT OnLButtonDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
 	LRESULT OnLButtonDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
 
 
 	LRESULT OnRButtonDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
 	LRESULT OnRButtonDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+	
+	LRESULT OnKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
 
 
 	LRESULT OnKexianUpdate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
 	LRESULT OnKexianUpdate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
 
 
@@ -58,6 +60,7 @@ public:
 
 
 	LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, bool& bHandled);
 	LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, bool& bHandled);
 
 
+	//显示收款界面
 	void ShowShoukuan();
 	void ShowShoukuan();
 
 
 	//添加托盘图标(初始化)
 	//添加托盘图标(初始化)
@@ -66,6 +69,9 @@ public:
 	//处理托盘图标上的事件
 	//处理托盘图标上的事件
 	LRESULT OnTrayIcon(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
 	LRESULT OnTrayIcon(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
 
 
+	//处理热键
+	LRESULT OnHotKey(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+
 	void ShowSystemSetting();
 	void ShowSystemSetting();
 
 
 	void Init();
 	void Init();
@@ -117,7 +123,7 @@ private:
 	bool m_is_show_setting = false;
 	bool m_is_show_setting = false;
 	CSystemSettingWnd* m_settingWnd;
 	CSystemSettingWnd* m_settingWnd;
 
 
-	//默认串口监听的模式
+	//默认监听的模式
 	int m_nWatchType = -1;
 	int m_nWatchType = -1;
 
 
 	//监听是否进行
 	//监听是否进行
@@ -125,7 +131,7 @@ private:
 
 
 	//窗口监听模式的参数
 	//窗口监听模式的参数
 	HWND m_watchWnd = NULL;
 	HWND m_watchWnd = NULL;
-	std::string m_watchValue;
+	std::string m_watchValue = "0.00";
 
 
 	//窗口定位参数
 	//窗口定位参数
 	bool m_is_dingwei_wnd = false;
 	bool m_is_dingwei_wnd = false;