diff --git a/keypress_simulator/packages/keypress_simulator_windows/windows/keypress_simulator_windows_plugin.cpp b/keypress_simulator/packages/keypress_simulator_windows/windows/keypress_simulator_windows_plugin.cpp index dd99059..f93211b 100644 --- a/keypress_simulator/packages/keypress_simulator_windows/windows/keypress_simulator_windows_plugin.cpp +++ b/keypress_simulator/packages/keypress_simulator_windows/windows/keypress_simulator_windows_plugin.cpp @@ -18,6 +18,16 @@ using flutter::EncodableValue; namespace keypress_simulator_windows { +// Forward declarations +struct FindWindowData { + std::string targetProcessName; + std::string targetWindowTitle; + HWND foundWindow; +}; + +BOOL CALLBACK EnumWindowsCallback(HWND hwnd, LPARAM lParam); +HWND FindTargetWindow(const std::string& processName, const std::string& windowTitle); + // static void KeypressSimulatorWindowsPlugin::RegisterWithRegistrar( flutter::PluginRegistrarWindows* registrar) { @@ -144,13 +154,6 @@ void KeypressSimulatorWindowsPlugin::SimulateMouseClick( result->Success(flutter::EncodableValue(true)); } -// Helper function to find window by process name or window title -struct FindWindowData { - std::string targetProcessName; - std::string targetWindowTitle; - HWND foundWindow; -}; - BOOL CALLBACK EnumWindowsCallback(HWND hwnd, LPARAM lParam) { FindWindowData* data = reinterpret_cast(lParam);