From c8ef35de45aa92d6d99ab55a6ee55cc992725652 Mon Sep 17 00:00:00 2001 From: csersoft Date: Sun, 12 Mar 2017 12:11:48 +0800 Subject: [PATCH] 1.0.5 Beta Build 001 --- HWFW_GUI/Dlg_Main.cpp | 17 +++++++++++ HWFW_GUI/HWFW_GUI.rc | Bin 20222 -> 20258 bytes HWFW_GUI/TreeView_Events.cpp | 56 +++++++++++++++++++++++++++++++---- HWFW_GUI/stdafx.h | 4 +-- 4 files changed, 69 insertions(+), 8 deletions(-) diff --git a/HWFW_GUI/Dlg_Main.cpp b/HWFW_GUI/Dlg_Main.cpp index 4a1ee1c..a9e37b2 100644 --- a/HWFW_GUI/Dlg_Main.cpp +++ b/HWFW_GUI/Dlg_Main.cpp @@ -16,9 +16,23 @@ INT_PTR CALLBACK DlgProc_Main(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPa { case WM_INITDIALOG: { + typedef BOOL(WINAPI * lpfnChangeWindowMessageFilter)(__in UINT message, __in DWORD dwFlag); + RECT rcDlg, rcTmp, rcTmp2; + HMODULE hModUser32 = GetModuleHandleA("user32.dll"); LPCH lpStr; + if (hModUser32) + { + lpfnChangeWindowMessageFilter fnChangeWindowMessageFilter = (lpfnChangeWindowMessageFilter)GetProcAddress(hModUser32, "ChangeWindowMessageFilter"); + + if (fnChangeWindowMessageFilter) + { + fnChangeWindowMessageFilter(WM_DROPFILES, MSGFLT_ADD); + fnChangeWindowMessageFilter(0x0049, MSGFLT_ADD); + } + } + hMainDlg = hDlg; hmPop = LoadMenu(hInst, MAKEINTRESOURCE(IDR_MENU_ITEMINFO)); @@ -68,6 +82,9 @@ INT_PTR CALLBACK DlgProc_Main(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPa lpStr++; strcpy_s(lpStr, MAX_PATH - (lpStr - chIniPath), "HWPDB.ini"); } + + + TreeView_SetProc(GetDlgItem(hDlg, IDC_TV)); } return (INT_PTR)TRUE; diff --git a/HWFW_GUI/HWFW_GUI.rc b/HWFW_GUI/HWFW_GUI.rc index 19713f2f9e4c1b647acdaedf2d97bab8a40c0798..52e441dc01421e6d1818c188d003509ad2c533d9 100644 GIT binary patch delta 54 zcmex2mvPZN#tj#Qlyw-w8G;$&8C)46fTSaXGZ4Bm1Tcg!xG{J#_yF0#lLdvWH**Pp Gu?7Hx{0!Fs delta 18 acmZ29kMZAJ#tj#QCJPB!ZPpY1VhsRIl?Q|X diff --git a/HWFW_GUI/TreeView_Events.cpp b/HWFW_GUI/TreeView_Events.cpp index 95abb5e..154afe1 100644 --- a/HWFW_GUI/TreeView_Events.cpp +++ b/HWFW_GUI/TreeView_Events.cpp @@ -106,6 +106,7 @@ static void ListProductInfo(HWND hListView) { int nIndex = 0; LPCH lpProdList, lpStr, lpEndStr, lpTmp; + BOOL blInterface = FALSE; uint16_t u16Size = 0; CHAR chTmp[256], chTmp2[256]; @@ -143,14 +144,44 @@ static void ListProductInfo(HWND hListView) if (lpEndStr == NULL) break; strncpy_s(chTmp, lpStr, lpEndStr - lpStr); - lpTmp = chTmp; - while (*lpTmp == ';') lpTmp++; - - GetPrivateProfileStringA("HW_ProductDatabase", lpTmp, "< N/A >", chTmp2, sizeof(chTmp2), chIniPath); - ListView_AddItemA(hListView, ItemIndex(nIndex), 0, chTmp, LT_MODELINFO, 0, 0, 0); - ListView_AddItemA(hListView, ItemIndexPlus(nIndex), 1, chTmp2, LT_MODELINFO, 0, 0, 0); + if (*lpTmp == ';') + { + lpTmp++; + + if (blInterface == FALSE) + { + blInterface = TRUE; + + ListView_AddItemA(hListView, ItemIndex(nIndex), 0, ";;;", LT_MODELINFO, 0, 0, 0); + ListView_AddItemA(hListView, ItemIndexPlus(nIndex), 1, ";;; WEB Interface [WEB界面] ;;;", LT_MODELINFO, 0, 0, 0); + } + } + + if (blInterface) + { + ListView_AddItemA(hListView, ItemIndex(nIndex), 0, lpTmp, LT_MODELINFO, 0, 0, 0); + + if (strcmp(lpTmp, "E8C") == 0) + ListView_AddItemA(hListView, ItemIndexPlus(nIndex), 1, "中国电信界面 [China Telecom WEB Interface]", LT_MODELINFO, 0, 0, 0); + else if (strcmp(lpTmp, "COMMON") == 0) + ListView_AddItemA(hListView, ItemIndexPlus(nIndex), 1, "华为原厂界面 [HuaWei WEB Interface]", LT_MODELINFO, 0, 0, 0); + else if (strcmp(lpTmp, "CHINA") == 0) + ListView_AddItemA(hListView, ItemIndexPlus(nIndex), 1, "中国联通界面 [China Unicom WEB Interface]", LT_MODELINFO, 0, 0, 0); + else if (strcmp(lpTmp, "CMCC") == 0) + ListView_AddItemA(hListView, ItemIndexPlus(nIndex), 1, "中国移动界面 [China Mobile WEB Interface]", LT_MODELINFO, 0, 0, 0); + else + ListView_AddItemA(hListView, ItemIndexPlus(nIndex), 1, "未知界面 [Unknown Interface]", LT_MODELINFO, 0, 0, 0); + } + else + { + GetPrivateProfileStringA("HW_ProductDatabase", lpTmp, "< N/A >", chTmp2, sizeof(chTmp2), chIniPath); + + ListView_AddItemA(hListView, ItemIndex(nIndex), 0, lpTmp, LT_MODELINFO, 0, 0, 0); + ListView_AddItemA(hListView, ItemIndexPlus(nIndex), 1, chTmp2, LT_MODELINFO, 0, 0, 0); + } + lpStr = lpEndStr + 1; } @@ -312,8 +343,21 @@ static LRESULT CALLBACK TreeView_WndProc(HWND hCtrl, UINT Msg, WPARAM wParam, LP WCHAR wsFile[MAX_PATH]; if (DragQueryFile((HDROP)wParam, 0, wsFile, MAX_PATH)) + { OpenFirmware(wsFile); + LPWSTR lpFileName = wcsrchr(wsFile, '\\'); + WCHAR wsTemp[MAX_PATH]; + + if (lpFileName) + { + lpFileName++; + + swprintf_s(wsTemp, L"%s %s %s Build:%s [%s]", APP_NAME, APP_VER1, APP_VER2, APP_BUILD_VER, lpFileName); + SetWindowTextW(hMainDlg, wsTemp); + } + } + DragFinish((HDROP)wParam); return 0; } diff --git a/HWFW_GUI/stdafx.h b/HWFW_GUI/stdafx.h index e3fdaee..11d6927 100644 --- a/HWFW_GUI/stdafx.h +++ b/HWFW_GUI/stdafx.h @@ -26,9 +26,9 @@ #include #define APP_NAME L"HWFW_GUI" -#define APP_VER1 L"1.0.4" +#define APP_VER1 L"1.0.5" #define APP_VER2 L"Alpha" -#define APP_BUILD_VER L"005" +#define APP_BUILD_VER L"001" #if defined _M_IX86