Исправлен алгоритм поиска результата

This commit is contained in:
cfif 2025-04-23 11:06:16 +03:00
parent d0d92cb074
commit b15929a0ac
8 changed files with 21 additions and 9 deletions

View File

@ -80,8 +80,10 @@ static BOOL CALLBACK enum_wnd_proc(HWND hwnd, LPARAM lParam) {
#ifdef DEBUG_PRINTF
printf("Static found!\n");
#endif
char text[] = "-200.0%";
SetWindowTextA(hwnd, (LPSTR)text);
wchar_t text[_MAX_PATH];
wcscpy_s(text, _MAX_PATH, L" -200.0%");
SetWindowTextW(hwnd, (LPCWSTR)text);
}
}
@ -109,9 +111,20 @@ static BOOL CALLBACK enum_wnd_proc(HWND hwnd, LPARAM lParam) {
#ifdef DEBUG_PRINTF
printf("Static found!\n");
#endif
char text[_MAX_PATH];
GetWindowTextA(hwnd, (LPSTR)text, _MAX_PATH);
printf("Similarity Score:%s\n", text);
wchar_t text[_MAX_PATH];
for (int i = 0; i < 50; ++i) {
GetWindowTextW(hwnd, (LPCWSTR)text, _MAX_PATH);
if (wcscmp(text, L" -200.0%") == 0) {
Sleep(100);
}
else {
break;
}
}
printf("Similarity Score:%ls\n", text);
}
}
@ -187,9 +200,7 @@ int wmain(int argc, wchar_t* argv[], wchar_t* envp[]) {
compareStruct.regim = REGIM_COMPARE;
EnumChildWindows(hwnd, enum_wnd_proc, (LPARAM)(&compareStruct));
Sleep(600);
compareStruct.regim = REGIM_RESULT;
EnumChildWindows(hwnd, enum_wnd_proc, (LPARAM)(&compareStruct));

Binary file not shown.

Binary file not shown.

View File

@ -1,7 +1,8 @@
 Compare.c
C:\VC\Compare\Compare.c(117,39): warning C4090: функция: разные квалификаторы "const"
Создание кода
Создание кода завершено
2 of 6 functions (33.3%) were compiled, the rest were copied from previous compilation.
0 of 6 functions ( 0.0%) 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

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.