diff --git a/Compare.c b/Compare.c index c5ef9e1..500d790 100644 --- a/Compare.c +++ b/Compare.c @@ -1,12 +1,11 @@ -// Compare.cpp : Этот файл содержит функцию "main". Здесь начинается и заканчивается выполнение программы. +// Compare.c : Этот файл содержит функцию "main". Здесь начинается и заканчивается выполнение программы. // #include #include #include -#include -#include + #pragma comment(lib, "Winmm.lib") @@ -37,8 +36,8 @@ static BOOL setTextHwnd(HWND hwnd, LPCWSTR text1, int timeout) { for (int i = 0; i < timeout; ++i) { - SendMessage(hwnd, WM_SETTEXT, 0, text1); - SendMessage(hwnd, WM_GETTEXT, _MAX_PATH, text2); + SendMessage(hwnd, WM_SETTEXT, 0, (LPARAM)text1); + SendMessage(hwnd, WM_GETTEXT, _MAX_PATH, (LPARAM)text2); if (wcscmp(text1, text2) == 0) { return FALSE; @@ -180,7 +179,7 @@ static BOOL CALLBACK enum_wnd_proc(HWND hwnd, LPARAM lParam) { wcscpy_s(text, _MAX_PATH, L" "); for (int i = 0; i < 50; ++i) { - SendMessage(hwnd, WM_GETTEXT, _MAX_PATH, text); + SendMessage(hwnd, WM_GETTEXT, _MAX_PATH, (LPARAM)text); if (wcscmp(text, L" -200.0%") == 0) { Sleep(100); @@ -210,10 +209,9 @@ static void CALLBACK TimerUpdate(UINT wTimerID, UINT msg, DWORD dwUser, DWORD dw PostMessage(hwnd, WM_CLOSE, 0, 0); } - return; } -static int wmain(int argc, wchar_t* argv[], wchar_t* envp[]) { +int wmain(int argc, wchar_t* argv[], wchar_t* envp[]) { tCompareStruct compareStruct; @@ -253,14 +251,16 @@ static int wmain(int argc, wchar_t* argv[], wchar_t* envp[]) { if (hwnd != NULL) { - DWORD hprocessId = 0; - GetWindowThreadProcessId(hwnd, &hprocessId); + //DWORD hprocessId = 0; + //GetWindowThreadProcessId(hwnd, &hprocessId); - HANDLE processHandle = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, hprocessId); + //HANDLE processHandle = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, hprocessId); - GetModuleFileNameExW(processHandle, NULL, compareStruct.captionWindow, _MAX_PATH); + //GetModuleFileNameExW(processHandle, NULL, compareStruct.captionWindow, _MAX_PATH); - timerUpdate = timeSetEvent(50, 0, (LPTIMECALLBACK)TimerUpdate, (DWORD_PTR)&compareStruct, TIME_PERIODIC); + GetFullPathNameW(L"Sound-Similar-Free.exe", _MAX_PATH, compareStruct.captionWindow, NULL); + + timerUpdate = timeSetEvent(10, 0, (LPTIMECALLBACK)TimerUpdate, (DWORD_PTR)&compareStruct, TIME_PERIODIC); GetWindowRect(hwnd, &compareStruct.winRect); compareStruct.regim = REGIM_INIT; diff --git a/Compare/Release/Compare.iobj b/Compare/Release/Compare.iobj index 70eca89..845e77a 100644 Binary files a/Compare/Release/Compare.iobj and b/Compare/Release/Compare.iobj differ diff --git a/Compare/Release/Compare.ipdb b/Compare/Release/Compare.ipdb index 1acc0df..8f876f1 100644 Binary files a/Compare/Release/Compare.ipdb and b/Compare/Release/Compare.ipdb differ diff --git a/Compare/Release/Compare.log b/Compare/Release/Compare.log index 04f9641..59819c0 100644 --- a/Compare/Release/Compare.log +++ b/Compare/Release/Compare.log @@ -1,14 +1,6 @@  Compare.c -C:\VC\Compare\Compare.c(40,36): warning C4047: функция: "LPARAM" отличается по уровням косвенного обращения от "LPCWSTR" -C:\VC\Compare\Compare.c(40,36): warning C4024: SendMessageW: различные типы для формального и фактического параметров 4 -C:\VC\Compare\Compare.c(41,44): warning C4047: функция: "LPARAM" отличается по уровням косвенного обращения от "wchar_t [260]" -C:\VC\Compare\Compare.c(41,44): warning C4024: SendMessageW: различные типы для формального и фактического параметров 4 -C:\VC\Compare\Compare.c(183,46): warning C4047: функция: "LPARAM" отличается по уровням косвенного обращения от "wchar_t [260]" -C:\VC\Compare\Compare.c(183,46): warning C4024: SendMessageW: различные типы для формального и фактического параметров 4 -C:\VC\Compare\Compare.c(302,1): warning C4008: wmain: пропуск атрибута "static" Создание кода Создание кода завершено - 1 of 8 functions (12.5%) were compiled, the rest were copied from previous compilation. - 0 functions were new in current compilation - 1 functions had inline decision re-evaluated but remain unchanged + Previous IPDB and IOBJ mismatch, fall back to full compilation. + All 8 functions were compiled because no usable IPDB/IOBJ from previous compilation was found. Compare.vcxproj -> C:\VC\Compare\Release\Compare.exe diff --git a/Compare/Release/Compare.obj b/Compare/Release/Compare.obj index 1100b7e..228b8c6 100644 Binary files a/Compare/Release/Compare.obj and b/Compare/Release/Compare.obj differ diff --git a/Compare/Release/Compare.tlog/CL.read.1.tlog b/Compare/Release/Compare.tlog/CL.read.1.tlog index d2af009..56c8bc0 100644 Binary files a/Compare/Release/Compare.tlog/CL.read.1.tlog and b/Compare/Release/Compare.tlog/CL.read.1.tlog differ diff --git a/Compare/Release/vc143.pdb b/Compare/Release/vc143.pdb index 92443cf..754c5ca 100644 Binary files a/Compare/Release/vc143.pdb and b/Compare/Release/vc143.pdb differ diff --git a/Release/Compare.exe b/Release/Compare.exe index 92ba391..98f0239 100644 Binary files a/Release/Compare.exe and b/Release/Compare.exe differ diff --git a/Release/Compare.pdb b/Release/Compare.pdb index 23082d0..72cacc8 100644 Binary files a/Release/Compare.pdb and b/Release/Compare.pdb differ