Przeglądaj źródła

完成的窗口截取的模式一

张洋 6 lat temu
rodzic
commit
9b074e313d

BIN
bin/Win32/Debug/zhipuzi_pay_plugin/db/pos.db


+ 216 - 0
bin/Win32/Debug/zhipuzi_pay_plugin/log/pos.log

@@ -7665,3 +7665,219 @@
 2019-08-16 14:43:42[INFO] - [Parent window] window handle: 0001018C window name:  class name EdgeUiInputTopWndClass [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\helper\wndhelper.cpp:66]
 2019-08-16 14:43:42[INFO] - [Parent window] window handle: 00030284 window name:  class name Internet Explorer_Hidden [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\helper\wndhelper.cpp:66]
 2019-08-16 14:43:42[INFO] - [Parent window] window handle: 00020142 window name: Program Manager class name Progman [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\helper\wndhelper.cpp:66]
+2019-08-16 18:16:17[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:16:17[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:16:17[INFO] - save params fail [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:396]
+2019-08-16 18:16:17[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:16:17[INFO] - save params fail [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:396]
+2019-08-16 18:16:17[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:16:17[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:331]
+2019-08-16 18:16:17[INFO] - postString:nonce=123456&timestamp=1565950577&url=https://pf-api.zhipuzi.com/pos/userlogin/userlogin&username=zhangyang [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:192]
+2019-08-16 18:16:17[INFO] - sign:654344E46A28E701E5CF0E0EDB63DCA1 [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:202]
+2019-08-16 18:16:17[INFO] - postString:nonce=123456&sign=654344E46A28E701E5CF0E0EDB63DCA1&timestamp=1565950577&username=zhangyang [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:222]
+2019-08-16 18:16:17[INFO] - response:{"errcode":0,"errmsg":"","data":{"lwm_sess_token":"gvo7qedpaur4pmhff75dmsd236","version_type":"1"}} [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:227]
+2019-08-16 18:16:17[INFO] - response:{"errcode":0,"errmsg":"","data":{"lwm_sess_token":"gvo7qedpaur4pmhff75dmsd236","version_type":"1"}} [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:40]
+2019-08-16 18:16:17[INFO] - login success! [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:91]
+2019-08-16 18:16:17[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:16:17[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:392]
+2019-08-16 18:16:17[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:16:17[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:331]
+2019-08-16 18:36:20[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:36:20[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:36:20[INFO] - save params fail [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:396]
+2019-08-16 18:36:20[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:36:20[INFO] - save params fail [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:396]
+2019-08-16 18:36:20[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:36:20[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:331]
+2019-08-16 18:36:20[INFO] - postString:nonce=123456&timestamp=1565951780&url=https://pf-api.zhipuzi.com/pos/userlogin/userlogin&username=zhangyang [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:192]
+2019-08-16 18:36:20[INFO] - sign:2E1CBF1C2B05049199D367A13F95BDBE [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:202]
+2019-08-16 18:36:20[INFO] - postString:nonce=123456&sign=2E1CBF1C2B05049199D367A13F95BDBE&timestamp=1565951780&username=zhangyang [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:222]
+2019-08-16 18:36:21[INFO] - response:{"errcode":0,"errmsg":"","data":{"lwm_sess_token":"o2htuleq70r04g8kjm7k28e694","version_type":"1"}} [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:227]
+2019-08-16 18:36:21[INFO] - response:{"errcode":0,"errmsg":"","data":{"lwm_sess_token":"o2htuleq70r04g8kjm7k28e694","version_type":"1"}} [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:40]
+2019-08-16 18:36:21[INFO] - login success! [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:91]
+2019-08-16 18:36:21[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:36:21[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:392]
+2019-08-16 18:36:21[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:36:21[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:331]
+2019-08-16 18:37:50[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:37:50[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:37:50[INFO] - save params fail [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:396]
+2019-08-16 18:37:50[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:37:50[INFO] - save params fail [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:396]
+2019-08-16 18:37:50[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:37:50[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:331]
+2019-08-16 18:37:50[INFO] - postString:nonce=123456&timestamp=1565951870&url=https://pf-api.zhipuzi.com/pos/userlogin/userlogin&username=zhangyang [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:192]
+2019-08-16 18:37:50[INFO] - sign:1168054243F8E6F2CAE200E4CE314867 [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:202]
+2019-08-16 18:37:50[INFO] - postString:nonce=123456&sign=1168054243F8E6F2CAE200E4CE314867&timestamp=1565951870&username=zhangyang [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:222]
+2019-08-16 18:37:51[INFO] - response:{"errcode":0,"errmsg":"","data":{"lwm_sess_token":"ji2ituiavk3m9pl3mdn17cblv1","version_type":"1"}} [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:227]
+2019-08-16 18:37:51[INFO] - response:{"errcode":0,"errmsg":"","data":{"lwm_sess_token":"ji2ituiavk3m9pl3mdn17cblv1","version_type":"1"}} [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:40]
+2019-08-16 18:37:51[INFO] - login success! [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:91]
+2019-08-16 18:37:51[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:37:51[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:392]
+2019-08-16 18:37:51[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:37:51[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:331]
+2019-08-16 18:38:39[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:38:39[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:38:39[INFO] - save params fail [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:396]
+2019-08-16 18:38:39[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:38:39[INFO] - save params fail [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:396]
+2019-08-16 18:38:39[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:38:39[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:331]
+2019-08-16 18:38:39[INFO] - postString:nonce=123456&timestamp=1565951919&url=https://pf-api.zhipuzi.com/pos/userlogin/userlogin&username=zhangyang [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:192]
+2019-08-16 18:38:39[INFO] - sign:9C0C89B5548EE54BEF36BB6FDCC3E72D [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:202]
+2019-08-16 18:38:39[INFO] - postString:nonce=123456&sign=9C0C89B5548EE54BEF36BB6FDCC3E72D&timestamp=1565951919&username=zhangyang [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:222]
+2019-08-16 18:38:39[INFO] - response:{"errcode":0,"errmsg":"","data":{"lwm_sess_token":"bqaecl15qd0lfuel5tlsphev27","version_type":"1"}} [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:227]
+2019-08-16 18:38:39[INFO] - response:{"errcode":0,"errmsg":"","data":{"lwm_sess_token":"bqaecl15qd0lfuel5tlsphev27","version_type":"1"}} [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:40]
+2019-08-16 18:38:39[INFO] - login success! [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:91]
+2019-08-16 18:38:39[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:38:39[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:392]
+2019-08-16 18:38:39[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:38:39[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:331]
+2019-08-16 18:43:00[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:43:00[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:43:00[INFO] - save params fail [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:396]
+2019-08-16 18:43:00[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:43:00[INFO] - save params fail [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:396]
+2019-08-16 18:43:00[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:43:00[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:331]
+2019-08-16 18:43:00[INFO] - postString:nonce=123456&timestamp=1565952180&url=https://pf-api.zhipuzi.com/pos/userlogin/userlogin&username=zhangyang [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:192]
+2019-08-16 18:43:00[INFO] - sign:D60DBB071E170FA67487FB4858B6C38E [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:202]
+2019-08-16 18:43:00[INFO] - postString:nonce=123456&sign=D60DBB071E170FA67487FB4858B6C38E&timestamp=1565952180&username=zhangyang [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:222]
+2019-08-16 18:43:01[INFO] - response:{"errcode":0,"errmsg":"","data":{"lwm_sess_token":"ug5kc7g1mgo15n4mtgmvb6p387","version_type":"1"}} [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:227]
+2019-08-16 18:43:01[INFO] - response:{"errcode":0,"errmsg":"","data":{"lwm_sess_token":"ug5kc7g1mgo15n4mtgmvb6p387","version_type":"1"}} [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:40]
+2019-08-16 18:43:01[INFO] - login success! [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:91]
+2019-08-16 18:43:01[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:43:01[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:392]
+2019-08-16 18:43:01[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:43:01[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:331]
+2019-08-16 18:43:13[INFO] - [Parent window] window handle: 00180D36 window name:  class name UISystemSettingFrame [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\helper\wndhelper.cpp:66]
+2019-08-16 18:43:13[INFO] - [Parent window] window handle: 000100E0 window name:  class name Shell_TrayWnd [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\helper\wndhelper.cpp:66]
+2019-08-16 18:43:13[INFO] - [Parent window] window handle: 000D0A5C window name: 智铺子收银插件金额 class name UIValueFrame [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\helper\wndhelper.cpp:66]
+2019-08-16 18:43:13[INFO] - [Parent window] window handle: 00040986 window name: 收款 class name WindowsForms10.Window.8.app.0.3a48e15_r9_ad1 [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\helper\wndhelper.cpp:66]
+2019-08-16 18:43:13[INFO] - [Child window] window handle: 000406E0 window name: 89 class name WindowsForms10.EDIT.app.0.3a48e15_r9_ad1 [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\helper\wndhelper.cpp:38]
+2019-08-16 18:43:13[INFO] - [Parent window] window handle: 00100832 window name: 收银系统 class name WindowsForms10.Window.8.app.0.3a48e15_r9_ad1 [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\helper\wndhelper.cpp:66]
+2019-08-16 18:43:13[INFO] - [Parent window] window handle: 00020EA0 window name: zhipuzi_pay_plugin - Microsoft Visual Studio (管理员) class name HwndWrapper[DefaultDomain;;c0b83b66-9200-4655-a0b5-ce8cfcbf5c23] [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\helper\wndhelper.cpp:66]
+2019-08-16 18:43:13[INFO] - [Parent window] window handle: 0004085A window name: SQLiteStudio (3.2.1) - [pos_config (pos)] class name Qt5QWindowIcon [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\helper\wndhelper.cpp:66]
+2019-08-16 18:43:13[INFO] - [Parent window] window handle: 009208CC window name: db class name CabinetWClass [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\helper\wndhelper.cpp:66]
+2019-08-16 18:43:13[INFO] - [Parent window] window handle: 00040938 window name: 任务 - Worktile - Google Chrome class name Chrome_WidgetWin_1 [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\helper\wndhelper.cpp:66]
+2019-08-16 18:43:13[INFO] - [Parent window] window handle: 000508D4 window name: 计算器 class name ApplicationFrameWindow [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\helper\wndhelper.cpp:66]
+2019-08-16 18:43:13[INFO] - [Parent window] window handle: 00040CFA window name: Office class name ApplicationFrameWindow [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\helper\wndhelper.cpp:66]
+2019-08-16 18:43:13[INFO] - [Parent window] window handle: 00020A20 window name: skin class name CabinetWClass [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\helper\wndhelper.cpp:66]
+2019-08-16 18:43:13[INFO] - [Parent window] window handle: 00010AB6 window name: CN=Microsoft Windows, O=Microsoft Corporation, L=Redmond, S=Washington, C=US class name Windows.UI.Core.CoreWindow [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\helper\wndhelper.cpp:66]
+2019-08-16 18:43:13[INFO] - [Parent window] window handle: 0003078C window name: 设置 class name ApplicationFrameWindow [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\helper\wndhelper.cpp:66]
+2019-08-16 18:43:13[INFO] - [Parent window] window handle: 00020918 window name: 计算器 class name Windows.UI.Core.CoreWindow [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\helper\wndhelper.cpp:66]
+2019-08-16 18:43:13[INFO] - [Parent window] window handle: 00090978 window name: Office class name Windows.UI.Core.CoreWindow [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\helper\wndhelper.cpp:66]
+2019-08-16 18:43:13[INFO] - [Parent window] window handle: 001809AA window name:  class name ApplicationFrameWindow [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\helper\wndhelper.cpp:66]
+2019-08-16 18:43:13[INFO] - [Parent window] window handle: 00010192 window name:  class name DummyDWMListenerWindow [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\helper\wndhelper.cpp:66]
+2019-08-16 18:43:13[INFO] - [Parent window] window handle: 0001018C window name:  class name EdgeUiInputTopWndClass [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\helper\wndhelper.cpp:66]
+2019-08-16 18:43:13[INFO] - [Parent window] window handle: 00020142 window name: Program Manager class name Progman [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\helper\wndhelper.cpp:66]
+2019-08-16 18:43:14[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:43:30[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:43:30[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:44:02[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:44:02[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:44:02[INFO] - save params fail [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:396]
+2019-08-16 18:44:02[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:44:02[INFO] - save params fail [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:396]
+2019-08-16 18:44:02[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:44:02[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:331]
+2019-08-16 18:44:02[INFO] - postString:nonce=123456&timestamp=1565952242&url=https://pf-api.zhipuzi.com/pos/userlogin/userlogin&username=zhangyang [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:192]
+2019-08-16 18:44:02[INFO] - sign:5A4CAB213A87FAA75A3B4E5FB4EAB69B [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:202]
+2019-08-16 18:44:02[INFO] - postString:nonce=123456&sign=5A4CAB213A87FAA75A3B4E5FB4EAB69B&timestamp=1565952242&username=zhangyang [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:222]
+2019-08-16 18:44:03[INFO] - response:{"errcode":0,"errmsg":"","data":{"lwm_sess_token":"m8tia9e4ug601d762voqbj3il3","version_type":"1"}} [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:227]
+2019-08-16 18:44:03[INFO] - response:{"errcode":0,"errmsg":"","data":{"lwm_sess_token":"m8tia9e4ug601d762voqbj3il3","version_type":"1"}} [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:40]
+2019-08-16 18:44:03[INFO] - login success! [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:91]
+2019-08-16 18:44:03[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:44:03[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:392]
+2019-08-16 18:44:03[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:44:03[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:331]
+2019-08-16 18:44:44[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:44:44[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:45:08[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:45:08[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:45:08[INFO] - save params fail [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:396]
+2019-08-16 18:45:08[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:45:08[INFO] - save params fail [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:396]
+2019-08-16 18:45:08[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:45:08[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:331]
+2019-08-16 18:45:08[INFO] - postString:nonce=123456&timestamp=1565952308&url=https://pf-api.zhipuzi.com/pos/userlogin/userlogin&username=zhangyang [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:192]
+2019-08-16 18:45:08[INFO] - sign:E0FE4089CFAEA62170CF54E85620B990 [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:202]
+2019-08-16 18:45:08[INFO] - postString:nonce=123456&sign=E0FE4089CFAEA62170CF54E85620B990&timestamp=1565952308&username=zhangyang [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:222]
+2019-08-16 18:45:09[INFO] - response:{"errcode":0,"errmsg":"","data":{"lwm_sess_token":"i4msk7jmes6a6d2lh0q793e8k3","version_type":"1"}} [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:227]
+2019-08-16 18:45:09[INFO] - response:{"errcode":0,"errmsg":"","data":{"lwm_sess_token":"i4msk7jmes6a6d2lh0q793e8k3","version_type":"1"}} [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:40]
+2019-08-16 18:45:09[INFO] - login success! [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:91]
+2019-08-16 18:45:09[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:45:09[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:392]
+2019-08-16 18:45:09[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:45:09[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:331]
+2019-08-16 18:50:03[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:50:03[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:51:16[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:51:16[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:52:41[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:52:41[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:54:34[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:54:34[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:55:41[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 18:55:41[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 19:05:10[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 19:10:18[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 19:10:23[INFO] - save params fail [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:396]
+2019-08-16 19:10:23[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 19:10:26[INFO] - save params fail [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:396]
+2019-08-16 19:10:27[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 19:10:32[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:331]
+2019-08-16 19:10:32[INFO] - postString:nonce=123456&timestamp=1565953832&url=https://pf-api.zhipuzi.com/pos/userlogin/userlogin&username=zhangyang [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:192]
+2019-08-16 19:10:32[INFO] - sign:DEB1C41207BED1C218813FA2DA079D10 [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:202]
+2019-08-16 19:10:32[INFO] - postString:nonce=123456&sign=DEB1C41207BED1C218813FA2DA079D10&timestamp=1565953832&username=zhangyang [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:222]
+2019-08-16 19:10:32[INFO] - response:{"errcode":0,"errmsg":"","data":{"lwm_sess_token":"b60u9sc93p41c0kd8c4pslc7b3","version_type":"1"}} [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:227]
+2019-08-16 19:10:32[INFO] - response:{"errcode":0,"errmsg":"","data":{"lwm_sess_token":"b60u9sc93p41c0kd8c4pslc7b3","version_type":"1"}} [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:40]
+2019-08-16 19:10:32[INFO] - login success! [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:91]
+2019-08-16 19:10:32[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 19:10:32[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:392]
+2019-08-16 19:10:32[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 19:10:32[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:331]
+2019-08-16 19:12:59[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 19:13:24[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 19:13:24[INFO] - save params fail [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:396]
+2019-08-16 19:13:24[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 19:13:24[INFO] - save params fail [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:396]
+2019-08-16 19:13:24[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 19:13:24[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:331]
+2019-08-16 19:13:24[INFO] - postString:nonce=123456&timestamp=1565954004&url=https://pf-api.zhipuzi.com/pos/userlogin/userlogin&username=zhangyang [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:192]
+2019-08-16 19:13:24[INFO] - sign:F1B2C69D88A28E031A694CE05E29E8F0 [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:202]
+2019-08-16 19:13:24[INFO] - postString:nonce=123456&sign=F1B2C69D88A28E031A694CE05E29E8F0&timestamp=1565954004&username=zhangyang [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:222]
+2019-08-16 19:13:25[INFO] - response:{"errcode":0,"errmsg":"","data":{"lwm_sess_token":"rup21c6furkk2vtcqr0p7pjq66","version_type":"1"}} [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:227]
+2019-08-16 19:13:25[INFO] - response:{"errcode":0,"errmsg":"","data":{"lwm_sess_token":"rup21c6furkk2vtcqr0p7pjq66","version_type":"1"}} [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:40]
+2019-08-16 19:13:25[INFO] - login success! [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:91]
+2019-08-16 19:13:25[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 19:13:25[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:392]
+2019-08-16 19:13:25[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 19:13:25[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:331]
+2019-08-16 19:14:18[INFO] - [Parent window] window handle: 0003098A window name:  class name UISystemSettingFrame [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\helper\wndhelper.cpp:66]
+2019-08-16 19:14:18[INFO] - [Parent window] window handle: 00050914 window name: 智铺子收银插件金额 class name UIValueFrame [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\helper\wndhelper.cpp:66]
+2019-08-16 19:14:18[INFO] - [Parent window] window handle: 000100C6 window name:  class name Shell_TrayWnd [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\helper\wndhelper.cpp:66]
+2019-08-16 19:14:18[INFO] - [Parent window] window handle: 001706E2 window name:  class name HwndWrapper[DefaultDomain;;fa84cb3d-fbae-46d3-aec9-e3981ecc90f0] [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\helper\wndhelper.cpp:66]
+2019-08-16 19:14:18[INFO] - [Parent window] window handle: 00010708 window name: zhipuzi_pay_plugin (正在运行) - Microsoft Visual Studio (管理员) class name HwndWrapper[DefaultDomain;;0a2e471d-069c-4d43-8562-4f89f44e3ee6] [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\helper\wndhelper.cpp:66]
+2019-08-16 19:14:18[INFO] - [Parent window] window handle: 00010AE8 window name: 收款 class name WindowsForms10.Window.8.app.0.3a48e15_r9_ad1 [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\helper\wndhelper.cpp:66]
+2019-08-16 19:14:18[INFO] - [Child window] window handle: 00030AB0 window name: 99 class name WindowsForms10.EDIT.app.0.3a48e15_r9_ad1 [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\helper\wndhelper.cpp:38]
+2019-08-16 19:14:18[INFO] - [Parent window] window handle: 0008019E window name: 收银系统 class name WindowsForms10.Window.8.app.0.3a48e15_r9_ad1 [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\helper\wndhelper.cpp:66]
+2019-08-16 19:14:18[INFO] - [Parent window] window handle: 00040046 window name: CN=Microsoft Windows, O=Microsoft Corporation, L=Redmond, S=Washington, C=US class name Windows.UI.Core.CoreWindow [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\helper\wndhelper.cpp:66]
+2019-08-16 19:14:18[INFO] - [Parent window] window handle: 000308AE window name: 计算器 class name ApplicationFrameWindow [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\helper\wndhelper.cpp:66]
+2019-08-16 19:14:18[INFO] - [Parent window] window handle: 000C077A window name: 设置 class name ApplicationFrameWindow [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\helper\wndhelper.cpp:66]
+2019-08-16 19:14:18[INFO] - [Parent window] window handle: 000206A2 window name: Microsoft Store class name ApplicationFrameWindow [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\helper\wndhelper.cpp:66]
+2019-08-16 19:14:18[INFO] - [Parent window] window handle: 000108D0 window name: 计算器 class name Windows.UI.Core.CoreWindow [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\helper\wndhelper.cpp:66]
+2019-08-16 19:14:18[INFO] - [Parent window] window handle: 00030278 window name: Microsoft Store class name Windows.UI.Core.CoreWindow [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\helper\wndhelper.cpp:66]
+2019-08-16 19:14:18[INFO] - [Parent window] window handle: 000201DE window name:  class name popupshadow [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\helper\wndhelper.cpp:66]
+2019-08-16 19:14:18[INFO] - [Parent window] window handle: 00030288 window name:  class name popupshadow [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\helper\wndhelper.cpp:66]
+2019-08-16 19:14:18[INFO] - [Parent window] window handle: 00130030 window name: ChatContactMenu class name ChatContactMenu [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\helper\wndhelper.cpp:66]
+2019-08-16 19:14:18[INFO] - [Parent window] window handle: 0001017C window name:  class name DummyDWMListenerWindow [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\helper\wndhelper.cpp:66]
+2019-08-16 19:14:18[INFO] - [Parent window] window handle: 00010176 window name:  class name EdgeUiInputTopWndClass [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\helper\wndhelper.cpp:66]
+2019-08-16 19:14:18[INFO] - [Parent window] window handle: 0004083E window name:  class name Internet Explorer_Hidden [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\helper\wndhelper.cpp:66]
+2019-08-16 19:14:18[INFO] - [Parent window] window handle: 00020126 window name: Program Manager class name Progman [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\helper\wndhelper.cpp:66]
+2019-08-16 19:14:30[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 19:14:30[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:331]
+2019-08-16 19:14:31[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 19:14:31[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:331]
+2019-08-16 19:14:34[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-16 19:14:34[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:331]

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


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


+ 0 - 1
include/zpzDll/zpzDll.h

@@ -13,7 +13,6 @@
 HOOKAPI_API BOOL InstallHook();
 HOOKAPI_API void UninstallHook();
 
-HOOKAPI_API void SetHookStatus(bool isWork);
 HOOKAPI_API void SetHwnd(HWND hWnd);
 HOOKAPI_API void SetComNum(const char* s_comNum, const wchar_t* ws_comNum, size_t nLength);
 

BIN
lib/debug/zpzDll.lib


+ 18 - 0
zhipuzi_pay_plugin/tool/CSetting.cpp

@@ -329,6 +329,24 @@ void CSetting::Init()
 		m_paramsMap[system_setting_jinezhuaqu_setting_chuangkou_model] = "1";
 	}
 
+	std::string system_setting_jinezhuaqu_setting_chuangkou_process_name = "system_setting_jinezhuaqu_setting_chuangkou_process_name";
+	if (m_paramsMap.find(system_setting_jinezhuaqu_setting_chuangkou_process_name) == m_paramsMap.end())
+	{
+		m_paramsMap[system_setting_jinezhuaqu_setting_chuangkou_process_name] = "";
+	}
+
+	std::string system_setting_jinezhuaqu_setting_chuangkou_title = "system_setting_jinezhuaqu_setting_chuangkou_title";
+	if (m_paramsMap.find(system_setting_jinezhuaqu_setting_chuangkou_title) == m_paramsMap.end())
+	{
+		m_paramsMap[system_setting_jinezhuaqu_setting_chuangkou_title] = "";
+	}
+
+	std::string system_setting_jinezhuaqu_setting_chuangkou_zorder = "system_setting_jinezhuaqu_setting_chuangkou_zorder";
+	if (m_paramsMap.find(system_setting_jinezhuaqu_setting_chuangkou_zorder) == m_paramsMap.end())
+	{
+		m_paramsMap[system_setting_jinezhuaqu_setting_chuangkou_zorder] = "0";
+	}
+
     m_mutex.unlock();
 
     //设置好默认参数之后,将默认参数写回到数据库

+ 20 - 1
zhipuzi_pay_plugin/wnd/CSystemSettingWnd.cpp

@@ -404,12 +404,31 @@ void CSystemSettingWnd::HandleClickMsg(TNotifyUI& msg)
 
 			CSetting::SetParam("system_setting_jinezhuaqu_setting_xunichuankou_botelv", CLewaimaiString::UnicodeToUTF8(com_name_botelv));
 		}
+		else if (m_nType == 3)
+		{
+			//保存窗口监听的参数
+			if (g_valuewnd_vector.size() == 0)
+			{
+				//没有合适的窗口
+				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));
+				CSetting::SetParam("system_setting_jinezhuaqu_setting_chuangkou_title", newWnd.wndTitle);
+				CSetting::SetParam("system_setting_jinezhuaqu_setting_chuangkou_zorder", to_string(newWnd.z_order));
+			}
+		}
 
 		//给监视窗口发个消息
 		m_valueWnd->RestartWatch();
 	}
-
 }
+
 void CSystemSettingWnd::HandleSelectChangeMsg(TNotifyUI& msg)
 {
 	CDuiString name = msg.pSender->GetName();

+ 266 - 265
zhipuzi_pay_plugin/wnd/CValueWnd.cpp

@@ -19,107 +19,114 @@ void CValueWnd::Notify(TNotifyUI& msg)
 
 void CValueWnd::Init()
 {
-	//初始化窗口位置
+    //初始化窗口位置
     InitWndPos();
 
-	//添加托盘图标
-	AddTrayIcon();
+    //添加托盘图标
+    AddTrayIcon();
 
-	//初始化菜单窗口
-	pMenu = new CMenuWnd();
-	pMenu->Create(m_hWnd, L"智铺子收银插件菜单", WS_POPUP, WS_EX_TOOLWINDOW);
-	pMenu->ShowWindow(false);
+    //初始化菜单窗口
+    pMenu = new CMenuWnd();
+    pMenu->Create(m_hWnd, L"智铺子收银插件菜单", WS_POPUP, WS_EX_TOOLWINDOW);
+    pMenu->ShowWindow(false);
 
-	//先暂停Hook工作(因为不一定是串口模式)
-	::SetHookStatus(false);
+    //再安装钩子
+    //BOOL ret = InstallHook();
 
-	//再安装钩子
-    BOOL ret = InstallHook();
+    //开始启动监听
+    RestartWatch();
 
-	//开始启动监听
-	RestartWatch();
+    /*
+        std::thread(&CValueWnd::WatchWnd, this).detach();
 
-/*
-    std::thread(&CValueWnd::WatchWnd, this).detach();
-
-    //开始测试ocr
-    tesseract::TessBaseAPI tess;
+        //开始测试ocr
+        tesseract::TessBaseAPI tess;
 
-    if(tess.Init("./tessdata", "eng"))
-    {
-        std::cout << "OCRTesseract: Could not initialize tesseract." << std::endl;
-        return ;
-    }
+        if(tess.Init("./tessdata", "eng"))
+        {
+            std::cout << "OCRTesseract: Could not initialize tesseract." << std::endl;
+            return ;
+        }
 
-    // setup
-    tess.SetPageSegMode(tesseract::PageSegMode::PSM_AUTO);
-    tess.SetVariable("save_best_choices", "T");
+        // setup
+        tess.SetPageSegMode(tesseract::PageSegMode::PSM_AUTO);
+        tess.SetVariable("save_best_choices", "T");
 
-    // read image
-    auto pixs = pixRead("D:\\3.png");
-    if(!pixs)
-    {
-        std::cout << "Cannot open input file: " << "D:\1.png" << std::endl;
-        return ;
-    }
+        // read image
+        auto pixs = pixRead("D:\\3.png");
+        if(!pixs)
+        {
+            std::cout << "Cannot open input file: " << "D:\1.png" << std::endl;
+            return ;
+        }
 
-    // recognize
-    tess.SetImage(pixs);
-    tess.Recognize(0);
+        // recognize
+        tess.SetImage(pixs);
+        tess.Recognize(0);
 
-    // get result and delete[] returned char* string
-    std::string aaa = tess.GetUTF8Text();
+        // get result and delete[] returned char* string
+        std::string aaa = tess.GetUTF8Text();
 
-    // cleanup
-    tess.Clear();
-    pixDestroy(&pixs);*/
+        // cleanup
+        tess.Clear();
+        pixDestroy(&pixs);*/
 }
 
 void CValueWnd::RestartWatch()
 {
-	std::string system_setting_jinezhuaqu_setting_type = CSetting::GetParam("system_setting_jinezhuaqu_setting_type");
-
-	m_nWatchType = atoi(system_setting_jinezhuaqu_setting_type.c_str());
-
-	if (m_nWatchType == 1)
-	{
-		//更新监听的端口号
-		std::string system_setting_jinezhuaqu_setting_chuankou_num = CSetting::GetParam("system_setting_jinezhuaqu_setting_chuankou_num");
-		if (system_setting_jinezhuaqu_setting_chuankou_num == "")
-		{
-			//参数错误
-			return;
-		}
-
-		std::wstring ws_system_setting_jinezhuaqu_setting_chuankou_num = CLewaimaiString::UTF8ToUnicode(system_setting_jinezhuaqu_setting_chuankou_num);
-
-		//设置窗口句柄
-		::SetHwnd(m_hWnd);
-
-		//设置串口端口号
-		std::transform(system_setting_jinezhuaqu_setting_chuankou_num.begin(), system_setting_jinezhuaqu_setting_chuankou_num.end(), system_setting_jinezhuaqu_setting_chuankou_num.begin(), ::toupper);
-		std::transform(ws_system_setting_jinezhuaqu_setting_chuankou_num.begin(), ws_system_setting_jinezhuaqu_setting_chuankou_num.end(), ws_system_setting_jinezhuaqu_setting_chuankou_num.begin(), ::toupper);
-
-		::SetComNum(system_setting_jinezhuaqu_setting_chuankou_num.c_str(), ws_system_setting_jinezhuaqu_setting_chuankou_num.c_str(), system_setting_jinezhuaqu_setting_chuankou_num.size());
-
-		//开始监听工作
-		::SetHookStatus(true);
-
-		//暂停其他模式
-	}
-	else if (m_nWatchType == 2)
-	{
-		//虚拟串口的模式
-		std::thread(&CValueWnd::ReadXunichuankouValue, this).detach();
-
-		//暂停其他模式
-		::SetHookStatus(false);
-	}
-	else if (m_nWatchType == 3)
-	{
-		//窗口模式
-		
-	}
+	std::thread(&CValueWnd::StartWatchWork, this).detach();
+}
+
+/*
+ *根据当前数据库的设置,重启监听
+ **/
+void CValueWnd::StartWatchWork()
+{
+	//先暂停已有的监控
+	m_isWatchWork = false;
+
+	//等待1秒,这1秒就是等已有的监控线程自动退出
+	Sleep(1000);
+
+	//然后开始工作
+	m_isWatchWork = true;
+
+    std::string system_setting_jinezhuaqu_setting_type = CSetting::GetParam("system_setting_jinezhuaqu_setting_type");
+
+    m_nWatchType = atoi(system_setting_jinezhuaqu_setting_type.c_str());
+
+    if(m_nWatchType == 1)
+    {
+        //更新监听的端口号
+        std::string system_setting_jinezhuaqu_setting_chuankou_num = CSetting::GetParam("system_setting_jinezhuaqu_setting_chuankou_num");
+
+        if(system_setting_jinezhuaqu_setting_chuankou_num == "")
+        {
+            //参数错误
+            return;
+        }
+
+        std::wstring ws_system_setting_jinezhuaqu_setting_chuankou_num = CLewaimaiString::UTF8ToUnicode(system_setting_jinezhuaqu_setting_chuankou_num);
+
+        //设置窗口句柄
+        ::SetHwnd(m_hWnd);
+
+        //设置串口端口号
+        std::transform(system_setting_jinezhuaqu_setting_chuankou_num.begin(), system_setting_jinezhuaqu_setting_chuankou_num.end(), system_setting_jinezhuaqu_setting_chuankou_num.begin(), ::toupper);
+        std::transform(ws_system_setting_jinezhuaqu_setting_chuankou_num.begin(), ws_system_setting_jinezhuaqu_setting_chuankou_num.end(), ws_system_setting_jinezhuaqu_setting_chuankou_num.begin(), ::toupper);
+
+        ::SetComNum(system_setting_jinezhuaqu_setting_chuankou_num.c_str(), ws_system_setting_jinezhuaqu_setting_chuankou_num.c_str(), system_setting_jinezhuaqu_setting_chuankou_num.size());
+    }
+    else if(m_nWatchType == 2)
+    {
+        //虚拟串口的模式
+        std::thread(&CValueWnd::ReadXunichuankouValue, this).detach();
+    }
+    else if(m_nWatchType == 3)
+    {
+        //窗口模式
+        std::thread(&CValueWnd::WatchWnd, this).detach();
+    }
 }
 
 /*
@@ -127,36 +134,38 @@ void CValueWnd::RestartWatch()
  **/
 void CValueWnd::ReadXunichuankouValue()
 {
-    //读取串口的模式
-	std::string system_setting_jinezhuaqu_setting_xunichuankou_num_2 = CSetting::GetParam("system_setting_jinezhuaqu_setting_xunichuankou_num_2");
-	std::string system_setting_jinezhuaqu_setting_xunichuankou_botelv = CSetting::GetParam("system_setting_jinezhuaqu_setting_xunichuankou_botelv");
+    //读取虚拟串口的模式
+    std::string system_setting_jinezhuaqu_setting_xunichuankou_num_2 = CSetting::GetParam("system_setting_jinezhuaqu_setting_xunichuankou_num_2");
+    std::string system_setting_jinezhuaqu_setting_xunichuankou_botelv = CSetting::GetParam("system_setting_jinezhuaqu_setting_xunichuankou_botelv");
 
-	CSerialPort serial(CLewaimaiString::UTF8ToUnicode(system_setting_jinezhuaqu_setting_xunichuankou_num_2), atoi(system_setting_jinezhuaqu_setting_xunichuankou_botelv.c_str()));
+    CSerialPort serial(CLewaimaiString::UTF8ToUnicode(system_setting_jinezhuaqu_setting_xunichuankou_num_2), atoi(system_setting_jinezhuaqu_setting_xunichuankou_botelv.c_str()));
 
     bool ret = serial.openComm();
-    if (!ret)
+
+    if(!ret)
     {
-    	LOG_INFO("open com failed!");
-    	return;
+        LOG_INFO("open com failed!");
+        return;
     }
 
-	char a[1024] = { 0 };
+    char a[1024] = { 0 };
 
-    while (m_nWatchType == 2)
+	//检查监控模式和波特率,如果变了就关闭掉
+    while(m_nWatchType == 2 && m_isWatchWork)
     {
-		memset(a, 0, 1024);
+        memset(a, 0, 1024);
 
-    	//开始读取串口的数据
-		DWORD nReaded = 0;
+        //开始读取串口的数据
+        DWORD nReaded = 0;
 
-    	serial.readFromComm(a, 1024, &nReaded);
+        serial.readFromComm(a, 1024, &nReaded);
 
-		if (nReaded > 0)
-		{
-			UpdateKexian(a, nReaded);
-		}
+        if(nReaded > 0)
+        {
+            UpdateKexian(a, nReaded);
+        }
 
-    	Sleep(200);
+        Sleep(200);
     }
 
     serial.closeComm();
@@ -164,7 +173,12 @@ void CValueWnd::ReadXunichuankouValue()
 
 void CValueWnd::WatchWnd()
 {
-    while(true)
+	std::string system_setting_jinezhuaqu_setting_chuangkou_process_name = CSetting::GetParam("system_setting_jinezhuaqu_setting_chuangkou_process_name");
+	std::string system_setting_jinezhuaqu_setting_chuangkou_title = CSetting::GetParam("system_setting_jinezhuaqu_setting_chuangkou_title");
+	std::string system_setting_jinezhuaqu_setting_chuangkou_zorder = CSetting::GetParam("system_setting_jinezhuaqu_setting_chuangkou_zorder");
+
+	//如果模式变了,或者参数变了,就退出(因为会重新启动一个新的监控)
+    while(m_nWatchType == 3 && m_isWatchWork)
     {
         if(m_watchWnd != NULL)
         {
@@ -197,56 +211,35 @@ void CValueWnd::WatchWnd()
         }
         else
         {
-            //根据上次保存的记录,来查找符合条件的窗口
-            if(g_valuewnd_vector.size() > 0)
+            //获得进程名字
+            std::wstring processName = CLewaimaiString::UTF8ToUnicode(system_setting_jinezhuaqu_setting_chuangkou_process_name);
+
+            //根据进程名字,找到对应的主窗口
+            HWND mainWnd = GetWndHwnd(processName.c_str(), system_setting_jinezhuaqu_setting_chuangkou_title);
+
+            if(mainWnd ==  NULL)
+            {
+                //说明这个进程还没有启动
+                m_watchWnd = NULL;
+            }
+            else
             {
-                ValueWnd lastWnd = g_valuewnd_vector[0];
+                //根据Z序查找目标窗口               
+                ValueWnd newWnd;
+                newWnd.wndTitle = system_setting_jinezhuaqu_setting_chuangkou_title;
+                newWnd.TopWnd = mainWnd;
+                newWnd.z_order = atoi(system_setting_jinezhuaqu_setting_chuangkou_zorder.c_str());
+                newWnd.processName = processName;
+                newWnd.selfWnd = NULL;
 
-                //获得进程名字
-                std::wstring processName = lastWnd.processName;
+                g_zorder = 0;
 
-                //根据进程名字,找到对应的主窗口
-                HWND mainWnd = GetWndHwnd(processName.c_str(), lastWnd.wndTitle);
+                EnumChildWindows(mainWnd, EnumMainwndChildProc, (LPARAM)(&newWnd));
 
-                if(mainWnd ==  NULL)
-                {
-                    //说明这个进程还没有启动
-                    m_watchWnd = NULL;
-                }
-                else
+                if(newWnd.selfWnd != NULL)
                 {
-                    //根据Z序查找目标窗口
-                    char szTitle[MAX_PATH] = { 0 };
-                    int nMaxCount = MAX_PATH;
-
-                    LPSTR lpWindowName = szTitle;
-
-                    GetWindowTextA(mainWnd, lpWindowName, nMaxCount);
-
-                    if(string(lpWindowName) != lastWnd.wndTitle)
-                    {
-                        //这次根据进程名字找到的主窗口,窗口名字和上次的不一样,无效
-                        m_watchWnd = NULL;
-                    }
-                    else
-                    {
-                        ValueWnd newWnd;
-                        newWnd.wndTitle = lpWindowName;
-                        newWnd.TopWnd = mainWnd;
-                        newWnd.z_order = lastWnd.z_order;
-                        newWnd.processName = lastWnd.processName;
-                        newWnd.selfWnd = NULL;
-
-                        g_zorder = 0;
-
-                        EnumChildWindows(mainWnd, EnumMainwndChildProc, (LPARAM)(&newWnd));
-
-                        if(newWnd.selfWnd != NULL)
-                        {
-                            //找到了
-                            m_watchWnd = newWnd.selfWnd;
-                        }
-                    }
+                    //找到了
+                    m_watchWnd = newWnd.selfWnd;
                 }
             }
         }
@@ -277,7 +270,7 @@ LRESULT CValueWnd::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHand
     // 把自己加入到CPaintManagerUI的m_aNotifiers数组中,用于处理Notify函数
     //m_pm.AddNotifier(this);
 
-	//进行一些初始化工作
+    //进行一些初始化工作
     Init();
 
     return 0;
@@ -354,63 +347,63 @@ LRESULT CValueWnd::OnNcHitTest(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bH
 
 LRESULT CValueWnd::OnLButtonDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
 {
-/*
-	//获取鼠标点击位置
-	int xPos = LOWORD(lParam);
-	int yPos = HIWORD(lParam);
+    /*
+    	//获取鼠标点击位置
+    	int xPos = LOWORD(lParam);
+    	int yPos = HIWORD(lParam);
 
-	//將位置转换为屏幕坐标
-	POINT pt = { xPos,yPos };
-	ClientToScreen(m_hWnd, &pt);
+    	//將位置转换为屏幕坐标
+    	POINT pt = { xPos,yPos };
+    	ClientToScreen(m_hWnd, &pt);
 
-	RECT menuWndRect = { 0 };
-	::GetWindowRect(pMenu->GetHWND(), &menuWndRect);
+    	RECT menuWndRect = { 0 };
+    	::GetWindowRect(pMenu->GetHWND(), &menuWndRect);
 
-	if (pt.x <= menuWndRect.left || pt.x >= menuWndRect.right
-		|| pt.y <= menuWndRect.top || pt.y >= menuWndRect.bottom)
-	{
-		pMenu->ShowWindow(false);
-	}
+    	if (pt.x <= menuWndRect.left || pt.x >= menuWndRect.right
+    		|| pt.y <= menuWndRect.top || pt.y >= menuWndRect.bottom)
+    	{
+    		pMenu->ShowWindow(false);
+    	}
 
-	bHandled = FALSE;
-	return 0;*/
+    	bHandled = FALSE;
+    	return 0;*/
 
-	bHandled = FALSE;
-	return 0;
+    bHandled = FALSE;
+    return 0;
 }
 
 LRESULT CValueWnd::OnRButtonDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
 {
-/*
-	int xPos = LOWORD(lParam);
-	int yPos = HIWORD(lParam);
+    /*
+    	int xPos = LOWORD(lParam);
+    	int yPos = HIWORD(lParam);
 
-	POINT pt = { xPos,yPos };
+    	POINT pt = { xPos,yPos };
 
-	//可能是因为整个窗口都是标题区域,这里不需要做转换
-	//ClientToScreen(m_hWnd, &pt);
+    	//可能是因为整个窗口都是标题区域,这里不需要做转换
+    	//ClientToScreen(m_hWnd, &pt);
 
-	pMenu->ShowWindow(true);
+    	pMenu->ShowWindow(true);
 
-	::SetWindowPos(pMenu->GetHWND(), NULL, pt.x, pt.y, 0, 0, SWP_NOSIZE | SWP_NOACTIVATE);
+    	::SetWindowPos(pMenu->GetHWND(), NULL, pt.x, pt.y, 0, 0, SWP_NOSIZE | SWP_NOACTIVATE);
 
-	bHandled = FALSE;
-	return 0;*/
+    	bHandled = FALSE;
+    	return 0;*/
 
-	ShowMenu();
+    ShowMenu();
 
-	bHandled = true;
-	return 0;
+    bHandled = true;
+    return 0;
 }
 
 LRESULT CValueWnd::OnKexianUpdate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
 {
-	//如果当前不是串口模式,直接忽略
-	if (m_nWatchType != 1)
-	{
-		bHandled = TRUE;
-		return true;
-	}
+    //如果当前不是串口模式,直接忽略
+    if(m_nWatchType != 1)
+    {
+        bHandled = TRUE;
+        return true;
+    }
 
     //收到了客显数据消息,读取客显数据
     char data[MAX_DATA_LENGTH] = { 0 };
@@ -420,13 +413,13 @@ LRESULT CValueWnd::OnKexianUpdate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL&
 
     if(data_length == 0)
     {
-		bHandled = TRUE;
+        bHandled = TRUE;
         return true;
     }
 
     UpdateKexian(data, data_length);
 
-	bHandled = TRUE;
+    bHandled = TRUE;
     return true;
 }
 
@@ -462,12 +455,15 @@ LRESULT CValueWnd::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
     case WM_NCACTIVATE:
         lRes = OnNcActivate(uMsg, wParam, lParam, bHandled);
         break;
-	case WM_NCLBUTTONDOWN:
-		lRes = OnLButtonDown(uMsg, wParam, lParam, bHandled);
-		break;
-	case WM_NCRBUTTONDOWN:
-		lRes = OnRButtonDown(uMsg, wParam, lParam, bHandled);
-		break;
+
+    case WM_NCLBUTTONDOWN:
+        lRes = OnLButtonDown(uMsg, wParam, lParam, bHandled);
+        break;
+
+    case WM_NCRBUTTONDOWN:
+        lRes = OnRButtonDown(uMsg, wParam, lParam, bHandled);
+        break;
+
     case WM_NCCALCSIZE:
         lRes = OnNcCalcSize(uMsg, wParam, lParam, bHandled);
         break;
@@ -479,9 +475,11 @@ LRESULT CValueWnd::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
     case WM_NCHITTEST:
         lRes = OnNcHitTest(uMsg, wParam, lParam, bHandled);
         break;
+
     case WM_SHOWTASK:
         lRes = OnTrayIcon(uMsg, wParam, lParam, bHandled);
         break;
+
     case WM_HOOK_MESSAGE:
         lRes = OnKexianUpdate(uMsg, wParam, lParam, bHandled);
         break;
@@ -537,7 +535,7 @@ LRESULT CValueWnd::OnTrayIcon(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHa
     //如果在图标中单击右键则弹出声明式菜单
     if(lParam == WM_RBUTTONDOWN)
     {
-		ShowMenu();
+        ShowMenu();
     }
 
     bHandled = true;
@@ -548,28 +546,28 @@ void CValueWnd::UpdateKexian(const char* data, int length)
 {
     std::string new_data = data;
 
-	//清屏命令
-	std::string clear_command = "\f";
+    //清屏命令
+    std::string clear_command = "\f";
 
-	//4个信号灯全灭
-	std::string quanmie_command = "\x1bs0";
+    //4个信号灯全灭
+    std::string quanmie_command = "\x1bs0";
 
 
     std::string show_command = "\x1bQA";
     std::string type_command = "\x1bs";
 
-	if (new_data == clear_command || new_data == quanmie_command)
-	{
-		//清屏命令,或者是熄灭灯的命令
-		return;
-	}
+    if(new_data == clear_command || new_data == quanmie_command)
+    {
+        //清屏命令,或者是熄灭灯的命令
+        return;
+    }
 
     if(new_data.find(show_command) == new_data.npos)
     {
         return;
     }
 
-	std::string money;
+    std::string money;
 
     int nPos = new_data.find(show_command);
 
@@ -606,10 +604,10 @@ void CValueWnd::UpdateKexian(const char* data, int length)
             std::string money_show = CLewaimaiString::DoubleToString(atof(money.c_str()), 2);
             valueLabel->SetText(CLewaimaiString::UTF8ToUnicode(money_show).c_str());
         }
-		else
-		{
-			//这种情况传输的是一些找零、单价之类的信息,不更新客显金额
-		}
+        else
+        {
+            //这种情况传输的是一些找零、单价之类的信息,不更新客显金额
+        }
     }
 
     return;
@@ -626,6 +624,7 @@ void CValueWnd::InitWndPos()
     HWND hWnd = *this;
     HWND hWndParent = ::GetParent(m_hWnd);
     HWND hWndCenter = ::GetWindowOwner(m_hWnd);
+
     if(hWndCenter != NULL)
     {
         hWnd = hWndCenter;
@@ -662,6 +661,7 @@ void CValueWnd::InitWndPos()
     {
         xLeft = rcArea.right - DlgWidth;
     }
+
     if(yTop < rcArea.top)
     {
         yTop = rcArea.top;
@@ -676,60 +676,61 @@ void CValueWnd::InitWndPos()
 
 void CValueWnd::ShowMenu()
 {
-	//获取鼠标坐标
-	POINT pt;
-	GetCursorPos(&pt);
-
-	//右击后点别地可以清除“右击出来的菜单”
-	SetForegroundWindow(m_hWnd);
-
-	//托盘菜单,win32程序使用的是HMENU,如果是MFC程序可以使用CMenu
-	HMENU hMenu;
-
-	//生成托盘菜单
-	hMenu = CreatePopupMenu();
-
-	//添加菜单,关键在于设置的一个标识符  WM_ONCLOSE 点击后会用到
-	AppendMenu(hMenu, MF_STRING, WM_MENU_SYSTEM_SETTING, _T("系统设置"));
-	AppendMenu(hMenu, MF_STRING, WM_ONCLOSE, _T("退出"));
-
-	//弹出菜单,并把用户所选菜单项的标识符返回
-	int cmd = TrackPopupMenu(hMenu, TPM_RETURNCMD, pt.x, pt.y, NULL, m_hWnd, NULL);
-
-	//如果标识符是WM_ONCLOSE则关闭
-	if (cmd == WM_ONCLOSE)
-	{
-		//退出程序
-		::PostQuitMessage(0);
-	}
-	if (cmd == WM_MENU_SYSTEM_SETTING)
-	{
-		if (m_is_show_setting == true)
-		{
-			return;
-		}
-
-		CSystemSettingWnd* pSystemSettingFrame = new CSystemSettingWnd(this);
-
-		if (pSystemSettingFrame != NULL)
-		{
-			m_is_show_setting = true;
-
-			pSystemSettingFrame->Create(NULL, _T(""), UI_WNDSTYLE_DIALOG, WS_EX_TOOLWINDOW);
-			pSystemSettingFrame->SetIcon(IDI_ICON_DUILIB);
-			pSystemSettingFrame->CenterWindow();
-			UINT ret = pSystemSettingFrame->ShowModal();
-
-			m_is_show_setting = false;
-
-			if (ret == IDOK)
-			{
-				
-			}
-			else if (ret == IDCANCEL)
-			{
-
-			}
-		}
-	}
+    //获取鼠标坐标
+    POINT pt;
+    GetCursorPos(&pt);
+
+    //右击后点别地可以清除“右击出来的菜单”
+    SetForegroundWindow(m_hWnd);
+
+    //托盘菜单,win32程序使用的是HMENU,如果是MFC程序可以使用CMenu
+    HMENU hMenu;
+
+    //生成托盘菜单
+    hMenu = CreatePopupMenu();
+
+    //添加菜单,关键在于设置的一个标识符  WM_ONCLOSE 点击后会用到
+    AppendMenu(hMenu, MF_STRING, WM_MENU_SYSTEM_SETTING, _T("系统设置"));
+    AppendMenu(hMenu, MF_STRING, WM_ONCLOSE, _T("退出"));
+
+    //弹出菜单,并把用户所选菜单项的标识符返回
+    int cmd = TrackPopupMenu(hMenu, TPM_RETURNCMD, pt.x, pt.y, NULL, m_hWnd, NULL);
+
+    //如果标识符是WM_ONCLOSE则关闭
+    if(cmd == WM_ONCLOSE)
+    {
+        //退出程序
+        ::PostQuitMessage(0);
+    }
+
+    if(cmd == WM_MENU_SYSTEM_SETTING)
+    {
+        if(m_is_show_setting == true)
+        {
+            return;
+        }
+
+        CSystemSettingWnd* pSystemSettingFrame = new CSystemSettingWnd(this);
+
+        if(pSystemSettingFrame != NULL)
+        {
+            m_is_show_setting = true;
+
+            pSystemSettingFrame->Create(NULL, _T(""), UI_WNDSTYLE_DIALOG, WS_EX_TOOLWINDOW);
+            pSystemSettingFrame->SetIcon(IDI_ICON_DUILIB);
+            pSystemSettingFrame->CenterWindow();
+            UINT ret = pSystemSettingFrame->ShowModal();
+
+            m_is_show_setting = false;
+
+            if(ret == IDOK)
+            {
+
+            }
+            else if(ret == IDCANCEL)
+            {
+
+            }
+        }
+    }
 }

+ 10 - 3
zhipuzi_pay_plugin/wnd/CValueWnd.h

@@ -64,6 +64,8 @@ public:
 
 	void RestartWatch();
 
+	void StartWatchWork();
+
 	void ReadXunichuankouValue();
 
 	void WatchWnd();
@@ -77,18 +79,23 @@ public:
 	CPaintManagerUI m_pm;
 
 private:
-	HWND m_watchWnd = NULL;
-	string m_watchValue;
-
 	//定义托盘图标对象
 	NOTIFYICONDATA m_trayIcon;
 
 	//菜单窗口
 	CMenuWnd* pMenu;
 
+	//设置窗口是否已经展示
 	bool m_is_show_setting = false;
 
 	//默认串口监听的模式
 	int m_nWatchType = -1;
+
+	//监听是否进行
+	bool m_isWatchWork = false;
+
+	//窗口监听模式的参数
+	HWND m_watchWnd = NULL;
+	std::string m_watchValue;
 };
 

+ 16 - 16
zpzDll/Hook.cpp

@@ -20,6 +20,10 @@ extern int data_length;
 //这个是打开COM1的hport
 HANDLE g_hPort = NULL;
 
+//把这个被hook进程的工作的端口号保存下来
+std::string g_sworkComNum;
+std::wstring g_wsworkComNum;
+
 static HANDLE (WINAPI * Real_CreateFileW)(
 	__in     LPCWSTR lpFileName,
 	__in     DWORD dwDesiredAccess,
@@ -59,22 +63,21 @@ HANDLE WINAPI Mine_CreateFileW(
 )
 {
 	HANDLE hPort = Real_CreateFileW(lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile);
-	if (g_isWork == false)
-	{
-		return hPort;
-	}
-
 
 	std::wstring wsFileName = lpFileName;
 	std::transform(wsFileName.begin(), wsFileName.end(), wsFileName.begin(), ::toupper);
 
-	if (wsFileName.find(g_wsComNum) != wsFileName.npos)
+	std::wstring wsComNum = g_wsComNum;
+	if (wsComNum != L"" && wsFileName.find(g_wsComNum) != wsFileName.npos)
 	{
 		//打开的是目标端口
 		if (hPort != INVALID_HANDLE_VALUE)
 		{
 			//成功打开端口,保存端口句柄,开始监听
 			g_hPort = hPort;
+
+			//把这个进程监听的端口号,存起来;
+			g_wsworkComNum = g_wsComNum;
 		}
 	}
 
@@ -92,21 +95,21 @@ HANDLE WINAPI Mine_CreateFileA(
 )
 {
 	HANDLE hPort = Real_CreateFileA(lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile);
-	if (g_isWork == false)
-	{
-		return hPort;
-	}
 
 	std::string FileName = lpFileName;
 	std::transform(FileName.begin(), FileName.end(), FileName.begin(), ::toupper);
 
-	if (FileName.find(g_sComNum) != FileName.npos)
+	std::string sComNum = g_sComNum;
+	if (sComNum != "" && FileName.find(g_sComNum) != FileName.npos)
 	{
 		//打开的是目标端口
 		if (hPort != INVALID_HANDLE_VALUE)
 		{
 			//成功打开端口,保存端口句柄,开始监听
 			g_hPort = hPort;
+
+			//把这个进程监听的端口号,存起来;
+			g_sworkComNum = g_sComNum;
 		}
 	}
 
@@ -122,12 +125,9 @@ BOOL WINAPI Mine_WriteFile(
 )
 {
 	BOOL ret = Real_WriteFile(hFile, lpBuffer, nNumberOfBytesToWrite, lpNumberOfBytesWritten, lpOverlapped);
-	if (g_isWork == false)
-	{
-		return ret;
-	}
 
-	if (hFile == g_hPort)
+	//同时满足发送数据的句柄和创建目标端口时候的句柄相等,以及工作的端口号等于最新的端口号,才进行监听
+	if (hFile == g_hPort && g_sworkComNum == g_sComNum)
 	{
 		//捕捉到一条客显消息,先把消息内容截取下来
 		DWORD nWirten = nNumberOfBytesToWrite;

+ 0 - 6
zpzDll/zpzDll.cpp

@@ -9,7 +9,6 @@
 
 //共享数据
 #pragma data_seg("shared")
-bool g_isWork = false;
 HWND g_hWnd = NULL;
 char g_sComNum[MAX_PATH] = { 0 };
 wchar_t g_wsComNum[MAX_PATH] = { 0 };
@@ -59,11 +58,6 @@ void UninstallHook()
 	}
 }
 
-void SetHookStatus(bool isWork)
-{
-	g_isWork = isWork;
-}
-
 void SetHwnd(HWND hWnd)
 {
 	g_hWnd = hWnd;

+ 0 - 1
zpzDll/zpzDll.h

@@ -13,7 +13,6 @@
 HOOKAPI_API BOOL InstallHook();
 HOOKAPI_API void UninstallHook();
 
-HOOKAPI_API void SetHookStatus(bool isWork);
 HOOKAPI_API void SetHwnd(HWND hWnd);
 HOOKAPI_API void SetComNum(const char* s_comNum, const wchar_t* ws_comNum, size_t nLength);