commit ceec022b4f01bd83c1021423da08d6e83fec4d39 Author: cfif Date: Thu Apr 17 10:09:03 2025 +0300 Init diff --git a/Compare.c b/Compare.c new file mode 100644 index 0000000..a543f41 --- /dev/null +++ b/Compare.c @@ -0,0 +1,216 @@ +// Compare.cpp : Этот файл содержит функцию "main". Здесь начинается и заканчивается выполнение программы. +// + + +#include +#include +#include +#include +#include + +#pragma comment(lib, "Winmm.lib") + +//#define DEBUG_PRINTF 1 + +typedef enum { + REGIM_INIT = 0, + REGIM_COMPARE = 1, + REGIM_RESULT = 2 +} eRegim; + +typedef struct { + RECT winRect; + eRegim regim; + wchar_t captionWindow[_MAX_PATH]; + wchar_t pathWav1[_MAX_PATH]; + wchar_t pathWav2[_MAX_PATH]; +} tCompareStruct; + +static BOOL CALLBACK enum_wnd_proc(HWND hwnd, LPARAM lParam) { + tCompareStruct* compareStruct = (tCompareStruct*)lParam; + + wchar_t classText[_MAX_PATH]; + RECT Rect; + + GetClassName(hwnd, classText, _MAX_PATH); + GetWindowRect(hwnd, &Rect); + + LONG LocalTop = Rect.top - compareStruct->winRect.top; + +#ifdef DEBUG_PRINTF + printf("HWND = %u, CLASS = %ls, GlobalTop = %d LocallTop = %d\n", hwnd, classText, Rect.top, LocalTop); +#endif + + if (compareStruct->regim == REGIM_INIT) { + + if ((wcscmp(classText, L"Edit") == 0) && (LocalTop == 37)) { + +#ifdef DEBUG_PRINTF + printf("Edit1 found!\n"); +#endif + SendMessage(hwnd, WM_SETTEXT, 0, (LPARAM)compareStruct->pathWav1); + + } + + if ((wcscmp(classText, L"Edit") == 0) && (LocalTop == 73)) { +#ifdef DEBUG_PRINTF + printf("Edit2 found!\n"); +#endif + SendMessage(hwnd, WM_SETTEXT, 0, (LPARAM)compareStruct->pathWav2); + + } + + if ((wcscmp(classText, L"ComboBox") == 0) && (LocalTop == 109)) { +#ifdef DEBUG_PRINTF + printf("ComboBox1 found!\n"); +#endif + ComboBox_SetCurSel(hwnd, 1); + + } + + if ((wcscmp(classText, L"ComboBox") == 0) && (LocalTop == 184)) { +#ifdef DEBUG_PRINTF + printf("ComboBox2 found!\n"); +#endif + ComboBox_SetCurSel(hwnd, 1); + + } + + if ((wcscmp(classText, L"Static") == 0) && (LocalTop == 218)) { +#ifdef DEBUG_PRINTF + printf("Static found!\n"); +#endif + char text[] = "-200.0%"; + SetWindowTextA(hwnd, (LPSTR)text); + + } + } + + if (compareStruct->regim == REGIM_COMPARE) { + + if ((wcscmp(classText, L"Button") == 0) && (LocalTop == 221)) { +#ifdef DEBUG_PRINTF + printf("Button found!\n"); +#endif + LONG lParam = MAKELONG(243, 28); + SendMessage(hwnd, WM_LBUTTONDOWN, MK_LBUTTON, lParam); + SendMessage(hwnd, WM_LBUTTONDOWN, MK_LBUTTON, lParam); + SendMessage(hwnd, WM_LBUTTONDOWN, MK_LBUTTON, lParam); + Sleep(100); + SendMessage(hwnd, WM_LBUTTONUP, MK_LBUTTON, lParam); + SendMessage(hwnd, WM_LBUTTONUP, MK_LBUTTON, lParam); + SendMessage(hwnd, WM_LBUTTONUP, MK_LBUTTON, lParam); + } + } + + + if (compareStruct->regim == REGIM_RESULT) { + if ((wcscmp(classText, L"Static") == 0) && (LocalTop == 218)) { +#ifdef DEBUG_PRINTF + printf("Static found!\n"); +#endif + char text[_MAX_PATH]; + GetWindowTextA(hwnd, (LPSTR)text, _MAX_PATH); + printf("Similarity Score:%s\n", text); + + } + } + + return TRUE; +} + +static void CALLBACK TimerUpdate(UINT wTimerID, UINT msg, DWORD dwUser, DWORD dwl, DWORD dw2) { + + tCompareStruct* compareStruct = (tCompareStruct*)dwUser; + + HWND hwnd = FindWindowW(NULL, compareStruct->captionWindow); + + if (hwnd != NULL) { + PostMessage(hwnd, WM_CLOSE, 0, 0); + } + + return; +} + +int wmain(int argc, wchar_t* argv[], wchar_t* envp[]) { + + tCompareStruct compareStruct; + + wchar_t captionWindow[_MAX_PATH]; + wcscpy_s(captionWindow, _MAX_PATH, L"Sound-Similar 1.1 (Free Version) by Virtins Technology"); + + UINT timerUpdate = 0; + + if (argc != 3) { + printf("Error: Invalid parameters\n"); + return 1; + } + + wcscpy_s(compareStruct.pathWav1, _MAX_PATH, argv[1]); + wcscpy_s(compareStruct.pathWav2, _MAX_PATH, argv[2]); + + HWND hwnd = FindWindowW(NULL, captionWindow); + + if (hwnd == NULL) { + WinExec("Sound-Similar-Free.exe", SW_SHOWNORMAL); + + for (int i = 0; i < 500; ++i) { + + hwnd = FindWindowW(NULL, captionWindow); + + if (IsWindowVisible(hwnd) == TRUE) { + ShowWindow(hwnd, SW_HIDE); + break; + } + + Sleep(1); + } + + } + + if (hwnd != NULL) { + + DWORD hprocessId = 0; + GetWindowThreadProcessId(hwnd, &hprocessId); + + HANDLE processHandle = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, hprocessId); + + GetModuleFileNameExW(processHandle, NULL, compareStruct.captionWindow, _MAX_PATH); + + timerUpdate = timeSetEvent(50, 0, (LPTIMECALLBACK)TimerUpdate, (DWORD_PTR)&compareStruct, TIME_PERIODIC); + + GetWindowRect(hwnd, &compareStruct.winRect); + compareStruct.regim = REGIM_INIT; + EnumChildWindows(hwnd, enum_wnd_proc, (LPARAM)(&compareStruct)); + + Sleep(200); + + compareStruct.regim = REGIM_COMPARE; + EnumChildWindows(hwnd, enum_wnd_proc, (LPARAM)(&compareStruct)); + + Sleep(600); + + compareStruct.regim = REGIM_RESULT; + EnumChildWindows(hwnd, enum_wnd_proc, (LPARAM)(&compareStruct)); + + timeKillEvent(timerUpdate); + + //PostMessage(hwnd, WM_CLOSE, 0, 0); + } + else { + printf("Error: Window not found\n"); + return 2; + } + +} + +// Запуск программы: CTRL+F5 или меню "Отладка" > "Запуск без отладки" +// Отладка программы: F5 или меню "Отладка" > "Запустить отладку" + +// Советы по началу работы +// 1. В окне обозревателя решений можно добавлять файлы и управлять ими. +// 2. В окне Team Explorer можно подключиться к системе управления версиями. +// 3. В окне "Выходные данные" можно просматривать выходные данные сборки и другие сообщения. +// 4. В окне "Список ошибок" можно просматривать ошибки. +// 5. Последовательно выберите пункты меню "Проект" > "Добавить новый элемент", чтобы создать файлы кода, или "Проект" > "Добавить существующий элемент", чтобы добавить в проект существующие файлы кода. +// 6. Чтобы снова открыть этот проект позже, выберите пункты меню "Файл" > "Открыть" > "Проект" и выберите SLN-файл. diff --git a/Compare.sln b/Compare.sln new file mode 100644 index 0000000..f975e15 --- /dev/null +++ b/Compare.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.9.34728.123 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Compare", "Compare.vcxproj", "{DE5D254B-2AB3-40E7-AF5A-92C05E2C61A5}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {DE5D254B-2AB3-40E7-AF5A-92C05E2C61A5}.Debug|x64.ActiveCfg = Debug|x64 + {DE5D254B-2AB3-40E7-AF5A-92C05E2C61A5}.Debug|x64.Build.0 = Debug|x64 + {DE5D254B-2AB3-40E7-AF5A-92C05E2C61A5}.Debug|x86.ActiveCfg = Debug|Win32 + {DE5D254B-2AB3-40E7-AF5A-92C05E2C61A5}.Debug|x86.Build.0 = Debug|Win32 + {DE5D254B-2AB3-40E7-AF5A-92C05E2C61A5}.Release|x64.ActiveCfg = Release|x64 + {DE5D254B-2AB3-40E7-AF5A-92C05E2C61A5}.Release|x64.Build.0 = Release|x64 + {DE5D254B-2AB3-40E7-AF5A-92C05E2C61A5}.Release|x86.ActiveCfg = Release|Win32 + {DE5D254B-2AB3-40E7-AF5A-92C05E2C61A5}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {4D5EE1FF-03F9-4DF1-8EBB-27E715156027} + EndGlobalSection +EndGlobal diff --git a/Compare.vcxproj b/Compare.vcxproj new file mode 100644 index 0000000..e6fd0fe --- /dev/null +++ b/Compare.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {de5d254b-2ab3-40e7-af5a-92c05e2c61a5} + Compare + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + \ No newline at end of file diff --git a/Compare.vcxproj.filters b/Compare.vcxproj.filters new file mode 100644 index 0000000..b6d3220 --- /dev/null +++ b/Compare.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Исходные файлы + + + \ No newline at end of file diff --git a/Compare.vcxproj.user b/Compare.vcxproj.user new file mode 100644 index 0000000..88a5509 --- /dev/null +++ b/Compare.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Compare/Release/Compare.exe.recipe b/Compare/Release/Compare.exe.recipe new file mode 100644 index 0000000..ca3cb84 --- /dev/null +++ b/Compare/Release/Compare.exe.recipe @@ -0,0 +1,11 @@ + + + + + C:\VC\Compare\Release\Compare.exe + + + + + + \ No newline at end of file diff --git a/Compare/Release/Compare.iobj b/Compare/Release/Compare.iobj new file mode 100644 index 0000000..381db94 Binary files /dev/null and b/Compare/Release/Compare.iobj differ diff --git a/Compare/Release/Compare.ipdb b/Compare/Release/Compare.ipdb new file mode 100644 index 0000000..898d6ff Binary files /dev/null and b/Compare/Release/Compare.ipdb differ diff --git a/Compare/Release/Compare.log b/Compare/Release/Compare.log new file mode 100644 index 0000000..02067c0 --- /dev/null +++ b/Compare/Release/Compare.log @@ -0,0 +1,7 @@ + Compare.c + Создание кода + Создание кода завершено + 2 of 6 functions (33.3%) were compiled, the rest were copied from previous compilation. + 0 functions were new in current compilation + 0 functions had inline decision re-evaluated but remain unchanged + Compare.vcxproj -> C:\VC\Compare\Release\Compare.exe diff --git a/Compare/Release/Compare.obj b/Compare/Release/Compare.obj new file mode 100644 index 0000000..3c280d0 Binary files /dev/null and b/Compare/Release/Compare.obj differ diff --git a/Compare/Release/Compare.tlog/CL.command.1.tlog b/Compare/Release/Compare.tlog/CL.command.1.tlog new file mode 100644 index 0000000..ba99f4a Binary files /dev/null and b/Compare/Release/Compare.tlog/CL.command.1.tlog differ diff --git a/Compare/Release/Compare.tlog/CL.read.1.tlog b/Compare/Release/Compare.tlog/CL.read.1.tlog new file mode 100644 index 0000000..d2af009 Binary files /dev/null and b/Compare/Release/Compare.tlog/CL.read.1.tlog differ diff --git a/Compare/Release/Compare.tlog/CL.write.1.tlog b/Compare/Release/Compare.tlog/CL.write.1.tlog new file mode 100644 index 0000000..141d75c Binary files /dev/null and b/Compare/Release/Compare.tlog/CL.write.1.tlog differ diff --git a/Compare/Release/Compare.tlog/Cl.items.tlog b/Compare/Release/Compare.tlog/Cl.items.tlog new file mode 100644 index 0000000..2c10a56 --- /dev/null +++ b/Compare/Release/Compare.tlog/Cl.items.tlog @@ -0,0 +1 @@ +C:\VC\Compare\Compare.c;C:\VC\Compare\Compare\Release\Compare.obj diff --git a/Compare/Release/Compare.tlog/Compare.lastbuildstate b/Compare/Release/Compare.tlog/Compare.lastbuildstate new file mode 100644 index 0000000..1bef5ac --- /dev/null +++ b/Compare/Release/Compare.tlog/Compare.lastbuildstate @@ -0,0 +1,2 @@ +PlatformToolSet=v143:VCToolArchitecture=Native32Bit:VCToolsVersion=14.39.33519:TargetPlatformVersion=10.0.22621.0: +Release|Win32|C:\VC\Compare\| diff --git a/Compare/Release/Compare.tlog/link.command.1.tlog b/Compare/Release/Compare.tlog/link.command.1.tlog new file mode 100644 index 0000000..d64e951 Binary files /dev/null and b/Compare/Release/Compare.tlog/link.command.1.tlog differ diff --git a/Compare/Release/Compare.tlog/link.read.1.tlog b/Compare/Release/Compare.tlog/link.read.1.tlog new file mode 100644 index 0000000..76a7825 Binary files /dev/null and b/Compare/Release/Compare.tlog/link.read.1.tlog differ diff --git a/Compare/Release/Compare.tlog/link.secondary.1.tlog b/Compare/Release/Compare.tlog/link.secondary.1.tlog new file mode 100644 index 0000000..135e9b2 --- /dev/null +++ b/Compare/Release/Compare.tlog/link.secondary.1.tlog @@ -0,0 +1,3 @@ +^C:\VC\COMPARE\COMPARE\RELEASE\COMPARE.OBJ +C:\VC\Compare\Compare\Release\Compare.IPDB +C:\VC\Compare\Compare\Release\Compare.iobj diff --git a/Compare/Release/Compare.tlog/link.write.1.tlog b/Compare/Release/Compare.tlog/link.write.1.tlog new file mode 100644 index 0000000..85ba406 Binary files /dev/null and b/Compare/Release/Compare.tlog/link.write.1.tlog differ diff --git a/Compare/Release/vc143.pdb b/Compare/Release/vc143.pdb new file mode 100644 index 0000000..60e1b70 Binary files /dev/null and b/Compare/Release/vc143.pdb differ diff --git a/Release/Compare.exe b/Release/Compare.exe new file mode 100644 index 0000000..ab8f5f6 Binary files /dev/null and b/Release/Compare.exe differ diff --git a/Release/Compare.pdb b/Release/Compare.pdb new file mode 100644 index 0000000..133c34b Binary files /dev/null and b/Release/Compare.pdb differ diff --git a/Release/SLABHIDDevice.dll b/Release/SLABHIDDevice.dll new file mode 100644 index 0000000..ed4f31c Binary files /dev/null and b/Release/SLABHIDDevice.dll differ diff --git a/Release/SLABHIDtoUART.dll b/Release/SLABHIDtoUART.dll new file mode 100644 index 0000000..44abca1 Binary files /dev/null and b/Release/SLABHIDtoUART.dll differ diff --git a/Release/SMM.dll b/Release/SMM.dll new file mode 100644 index 0000000..5adec10 Binary files /dev/null and b/Release/SMM.dll differ diff --git a/Release/SMMpro.dll b/Release/SMMpro.dll new file mode 100644 index 0000000..c8a78b0 Binary files /dev/null and b/Release/SMMpro.dll differ diff --git a/Release/Sound-Similar-Free.exe b/Release/Sound-Similar-Free.exe new file mode 100644 index 0000000..4d89c7f Binary files /dev/null and b/Release/Sound-Similar-Free.exe differ diff --git a/Release/SoundCardASIODAQO.dll b/Release/SoundCardASIODAQO.dll new file mode 100644 index 0000000..b6dca3b Binary files /dev/null and b/Release/SoundCardASIODAQO.dll differ diff --git a/Release/SoundCardMMEDAQ.dll b/Release/SoundCardMMEDAQ.dll new file mode 100644 index 0000000..640ecc0 Binary files /dev/null and b/Release/SoundCardMMEDAQ.dll differ diff --git a/Release/VTDSOF1.dll b/Release/VTDSOF1.dll new file mode 100644 index 0000000..62e5bdd Binary files /dev/null and b/Release/VTDSOF1.dll differ diff --git a/Release/VTDSOF1drv.dll b/Release/VTDSOF1drv.dll new file mode 100644 index 0000000..4e6989e Binary files /dev/null and b/Release/VTDSOF1drv.dll differ diff --git a/Release/VTSPA.dll b/Release/VTSPA.dll new file mode 100644 index 0000000..7fcb839 Binary files /dev/null and b/Release/VTSPA.dll differ