Обновление

This commit is contained in:
cfif 2025-07-07 18:04:40 +03:00
parent 8eba0f7564
commit aa1dcb1a59
8 changed files with 21 additions and 7 deletions

View File

@ -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;

Binary file not shown.

Binary file not shown.

View File

@ -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

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.