alroyso 1 year ago
parent
commit
bb267a80c7
1 changed files with 3 additions and 3 deletions
  1. 3 3
      windows/runner/main.cpp

+ 3 - 3
windows/runner/main.cpp

@@ -45,8 +45,7 @@ void RegisterWithFlutter(flutter::PluginRegistrarWindows *registrar) {
 }
 int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
                       _In_ wchar_t *command_line, _In_ int show_command) {
-// 注册Flutter插件
-  RegisterPlugins(&flutter_controller->engine());
+
 
   HWND hwnd = ::FindWindow(L"FLUTTER_RUNNER_WIN32_WINDOW", L"naiyouwl");
   if (hwnd != NULL) {
@@ -89,7 +88,8 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
     return EXIT_FAILURE;
   }
   window.SetQuitOnClose(true);
-
+  // 注册Flutter插件
+  RegisterPlugins(&flutter_controller->engine());
   ::MSG msg;
   while (::GetMessage(&msg, nullptr, 0, 0)) {
     ::TranslateMessage(&msg);