diff --git a/Compare.c b/Compare.c index 78664cb..4882a95 100644 --- a/Compare.c +++ b/Compare.c @@ -245,9 +245,13 @@ static BOOL CALLBACK enum_wnd_proc(HWND hwnd, LPARAM lParam) { static void CALLBACK TimerUpdate(UINT wTimerID, UINT msg, DWORD dwUser, DWORD dwl, DWORD dw2) { - tCompareStruct* compareStruct = (tCompareStruct*)dwUser; + wchar_t captionWindow[_MAX_PATH]; - HWND hwnd = FindWindowW(NULL, compareStruct->captionWindow); + //tCompareStruct* compareStruct = (tCompareStruct*)dwUser; + GetFullPathNameW(L"Sound-Similar-Free.exe", _MAX_PATH, captionWindow, NULL); + + + HWND hwnd = FindWindowW(NULL, captionWindow); if (hwnd != NULL) { PostMessage(hwnd, WM_CLOSE, 0, 0); @@ -281,13 +285,14 @@ int wmain(int argc, wchar_t* argv[], wchar_t* envp[]) { if (hwnd == NULL) { WinExec("Sound-Similar-Free.exe", SW_SHOWNORMAL); - for (int i = 0; i < 500; ++i) { + Sleep(1); + + for (int i = 0; i < 5000; ++i) { hwnd = FindWindowW(NULL, captionWindow); if (IsWindowVisible(hwnd) == TRUE) { ShowWindow(hwnd, SW_HIDE); - Sleep(1000); break; } @@ -308,7 +313,16 @@ int wmain(int argc, wchar_t* argv[], wchar_t* envp[]) { GetFullPathNameW(L"Sound-Similar-Free.exe", _MAX_PATH, compareStruct.captionWindow, NULL); - timerUpdate = timeSetEvent(10, 0, (LPTIMECALLBACK)TimerUpdate, (DWORD_PTR)&compareStruct, TIME_PERIODIC); + +// *wcsrchr(compareStruct.captionWindow, L'\\') = '\0'; + +// for (int i = 0; i < wcslen(compareStruct.captionWindow); ++i) { +// compareStruct.captionWindow[i] = towlower(compareStruct.captionWindow[i]); +// } + +// wcscat_s(compareStruct.captionWindow, _MAX_PATH, L"\\Sound-Similar-Free.exe"); + + timerUpdate = timeSetEvent(100, 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 6c2a50e..9cba1b9 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 0e93f2d..adb9453 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 bf75d8c..5cdd7ec 100644 --- a/Compare/Release/Compare.log +++ b/Compare/Release/Compare.log @@ -1,7 +1,7 @@  Compare.c Создание кода Создание кода завершено - 1 of 8 functions (12.5%) were compiled, the rest were copied from previous compilation. + 1 of 7 functions (14.3%) 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 + 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 index 0d63aaf..029c84b 100644 Binary files a/Compare/Release/Compare.obj and b/Compare/Release/Compare.obj differ diff --git a/Compare/Release/vc143.pdb b/Compare/Release/vc143.pdb index 801d358..cdc8df8 100644 Binary files a/Compare/Release/vc143.pdb and b/Compare/Release/vc143.pdb differ diff --git a/x64/Release/Compare.exe b/x64/Release/Compare.exe index 8cf5e99..7fd035c 100644 Binary files a/x64/Release/Compare.exe and b/x64/Release/Compare.exe differ diff --git a/x64/Release/Compare.pdb b/x64/Release/Compare.pdb index ace575c..f024307 100644 Binary files a/x64/Release/Compare.pdb and b/x64/Release/Compare.pdb differ