diff --git a/AutoItX3.dll b/AutoItX3.dll index d680244..9e841ba 100755 Binary files a/AutoItX3.dll and b/AutoItX3.dll differ diff --git a/src/autoit_instance_symbols.cpp b/src/autoit_instance_symbols.cpp index d910cbe..05e0dfc 100644 --- a/src/autoit_instance_symbols.cpp +++ b/src/autoit_instance_symbols.cpp @@ -1,6 +1,6 @@ +#include "autoit_instance_symbols.hpp" #include #include -#include "autoit_instance_symbols.hpp" #define AUTOIT_LIBRARY_NAME L"AutoItX3_original.dll" #define countof(xs) (sizeof(xs) / sizeof(*(xs))) @@ -10,25 +10,31 @@ DWORD autoit_path_size = 0; WCHAR autoit_path[MAX_PATH + 1] = {0}; autoit_instance_symbols::autoit_instance_symbols(void) { - if (autoit_loaded) { - GetTempFileNameW(L".", L"ait", 0, this->library_path); - CopyFileW(autoit_path, this->library_path, false); - this->handle = LoadLibraryW(this->library_path); - this->is_library_clone = true; - } else { - this->handle = LoadLibraryW(AUTOIT_LIBRARY_NAME); - autoit_path_size = GetModuleFileNameW(this->handle, autoit_path, countof(autoit_path)); - wcscpy_s(this->library_path, countof(this->library_path), autoit_path); - autoit_loaded = true; - } - void __stdcall (*init)(void) = (void __stdcall (*)(void))GetProcAddress(this->handle, "AU3_Init"); - init(); - #define X(type, name, params...) this->name = (type __stdcall (*)(params))(void*)GetProcAddress(this->handle, #name); - # include "autoit_functions.hpp" - #undef X + if (autoit_loaded) { + GetTempFileNameW(L".", L"ait", 0, this->library_path); + CopyFileW(autoit_path, this->library_path, false); + this->handle = LoadLibraryW(this->library_path); + this->is_library_clone = true; + } else { + this->handle = LoadLibraryW(AUTOIT_LIBRARY_NAME); + autoit_path_size = + GetModuleFileNameW(this->handle, autoit_path, countof(autoit_path)); + wcscpy_s(this->library_path, countof(this->library_path), autoit_path); + autoit_loaded = true; + } + void __stdcall (*init)(void) = + (void __stdcall (*)(void))GetProcAddress(this->handle, "AU3_Init"); + init(); +#define X(type, name, params...) \ + this->name = \ + (type __stdcall(*)(params))(void *)GetProcAddress(this->handle, #name); +#include "autoit_functions.hpp" +#undef X + this->AU3_AutoItSetOption(L"WinSearchChildren", 1); } autoit_instance_symbols::~autoit_instance_symbols(void) { - FreeLibrary(this->handle); - if (this->is_library_clone) DeleteFileW(this->library_path); + FreeLibrary(this->handle); + if (this->is_library_clone) + DeleteFileW(this->library_path); }