MCPcopy Create free account
hub / github.com/Azure/static-web-apps-cli / wWinMain

Function wWinMain

e2e/samples/app/flutter/windows/runner/main.cpp:8–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 // Attach to console when present (e.g., 'flutter run') or create a
11 // new console when running with a debugger.
12 if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) {
13 CreateAndAttachConsole();
14 }
15
16 // Initialize COM, so that it is available for use in the library and/or
17 // plugins.
18 ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED);
19
20 flutter::DartProject project(L"data");
21
22 std::vector<std::string> command_line_arguments =
23 GetCommandLineArguments();
24
25 project.set_dart_entrypoint_arguments(std::move(command_line_arguments));
26
27 FlutterWindow window(project);
28 Win32Window::Point origin(10, 10);
29 Win32Window::Size size(1280, 720);
30 if (!window.CreateAndShow(L"flutterapp", origin, size)) {
31 return EXIT_FAILURE;
32 }
33 window.SetQuitOnClose(true);
34
35 ::MSG msg;
36 while (::GetMessage(&msg, nullptr, 0, 0)) {
37 ::TranslateMessage(&msg);
38 ::DispatchMessage(&msg);
39 }
40
41 ::CoUninitialize();
42 return EXIT_SUCCESS;
43}

Callers

nothing calls this directly

Calls 4

CreateAndAttachConsoleFunction · 0.85
GetCommandLineArgumentsFunction · 0.85
CreateAndShowMethod · 0.80
SetQuitOnCloseMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…