creek
The AI Image Editor of 2030git clone https://github.com/maydayv7/creek
windows/runner/main.cpp (1266B)
1#include <flutter/dart_project.h>
2#include <flutter/flutter_view_controller.h>
3#include <windows.h>
4
5#include "flutter_window.h"
6#include "utils.h"
7
8int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
9 _In_ wchar_t *command_line, _In_ int show_command)
10{
11 // Attach to console when present (e.g., 'flutter run') or create a
12 // new console when running with a debugger.
13 if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent())
14 {
15 CreateAndAttachConsole();
16 }
17
18 // Initialize COM, so that it is available for use in the library and/or
19 // plugins.
20 ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED);
21
22 flutter::DartProject project(L"data");
23
24 std::vector<std::string> command_line_arguments =
25 GetCommandLineArguments();
26
27 project.set_dart_entrypoint_arguments(std::move(command_line_arguments));
28
29 FlutterWindow window(project);
30 Win32Window::Point origin(10, 10);
31 Win32Window::Size size(1280, 720);
32 if (!window.Create(L"creekui", origin, size))
33 {
34 return EXIT_FAILURE;
35 }
36 window.SetQuitOnClose(true);
37
38 ::MSG msg;
39 while (::GetMessage(&msg, nullptr, 0, 0))
40 {
41 ::TranslateMessage(&msg);
42 ::DispatchMessage(&msg);
43 }
44
45 ::CoUninitialize();
46 return EXIT_SUCCESS;
47}