diff --git a/CMakeLists.txt b/CMakeLists.txt index 1f6c8ca..268576e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,3 +34,4 @@ add_subdirectory(GUI) add_subdirectory(GUI/host) add_subdirectory(texthook) add_subdirectory(extensions) +add_subdirectory(testractor) diff --git a/testractor/CMakeLists.txt b/testractor/CMakeLists.txt new file mode 100644 index 0000000..7bca354 --- /dev/null +++ b/testractor/CMakeLists.txt @@ -0,0 +1 @@ +add_executable(Testractor WIN32 testractor.cpp testractor.rc) diff --git a/testractor/resource.h b/testractor/resource.h new file mode 100644 index 0000000..707fe42 --- /dev/null +++ b/testractor/resource.h @@ -0,0 +1,27 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by testractor.rc +// +#define IDD_DIALOG1 101 +#define IDC_EDIT1 1000 +#define IDC_EDIT2 1001 +#define IDC_EDIT3 1002 +#define IDC_EDIT4 1003 +#define IDC_EDIT5 1004 +#define IDC_EDIT6 1005 +#define IDC_EDIT7 1006 +#define IDC_EDIT8 1007 +#define IDC_EDIT9 1008 +#define IDC_EDIT10 1009 +#define IDC_STATIC -1 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 103 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1011 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/testractor/testractor.cpp b/testractor/testractor.cpp new file mode 100644 index 0000000..29d17a9 --- /dev/null +++ b/testractor/testractor.cpp @@ -0,0 +1,46 @@ +#include "common.h" +#include "resource.h" + +wchar_t buffer[1000] = {}; +std::array vars = {}; + +int WINAPI wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE, _In_ LPWSTR, _In_ int) +{ + ShowWindow(CreateDialogParamW(hInstance, MAKEINTRESOURCEW(IDD_DIALOG1), NULL, [](HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) -> INT_PTR + { + switch (uMsg) + { + case WM_CLOSE: + { + DestroyWindow(hWnd); + } + return TRUE; + case WM_DESTROY: + { + PostQuitMessage(0); + } + return TRUE; + case WM_COMMAND: + { + if (HIWORD(wParam) == EN_CHANGE) + { + GetWindowTextW((HWND)lParam, buffer, std::size(buffer)); + try { vars.at(LOWORD(wParam) - IDC_EDIT1) = std::stoi(buffer); } + catch (std::invalid_argument&) {} + } + } + break; + } + return FALSE; + }, 0), SW_SHOW); + + std::thread([] { while (true) lstrlenW(L"こんにちは"); }).detach(); + + MSG msg; + while (GetMessageW(&msg, NULL, 0, 0) > 0) + { + TranslateMessage(&msg); + DispatchMessageW(&msg); + } + return 0; +} diff --git a/testractor/testractor.rc b/testractor/testractor.rc new file mode 100644 index 0000000..611d32d Binary files /dev/null and b/testractor/testractor.rc differ