0

My problem I want to maximize the window, like without any title bar, which is usually seen in games. I want to do it in this CPP code. I work on flutter but there is no API to resize the app from startup so I need to edit this file. This is the code of my file and I want this file to launch my exe program in full-screen mode.

#include <flutter/dart_project.h>
#include <flutter/flutter_view_controller.h>
#include <windows.h>

#include "flutter_window.h"
#include "run_loop.h"
#include "utils.h"

int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
                      _In_ wchar_t *command_line, _In_ int show_command) {
  // Attach to console when present (e.g., 'flutter run') or create a
  // new console when running with a debugger.
  if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) {
    CreateAndAttachConsole();
  }

  // Initialize COM, so that it is available for use in the library and/or
  // plugins.
  ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED);

  RunLoop run_loop;

  flutter::DartProject project(L"data");

  std::vector<std::string> command_line_arguments =
      GetCommandLineArguments();

  project.set_dart_entrypoint_arguments(std::move(command_line_arguments));

  FlutterWindow window(&run_loop, project);
  Win32Window::Point origin(10, 10);
  Win32Window::Size size(1280, 720);
  if (!window.CreateAndShow(L"mlzs_labmanager", origin, size)) {
    return EXIT_FAILURE;
  }
  window.SetQuitOnClose(true);
  run_loop.Run();

  ::CoUninitialize();
  return EXIT_SUCCESS;
}

If you want any more code of those headers and libraries please tell me I will provide it's GitHub link. I have found these links but I don't know how to use these codes so please help me. I am a total newbie to c++ so I know nothing about this.

Link 1

Link 2

Kumar Saptam
  • 336
  • 5
  • 18
  • can you override `enterFullScreen`? You have to change to `SetWindowLongPtr(hwnd, GWL_STYLE, WS_VISIBLE | WS_MAXIMIZE | WS_POPUPWINDOW);` – Barmak Shemirani Dec 21 '20 at 01:45
  • can you please tell me the code because I know nothing about CPP literally nothing but I want a quick solution to this thing? And I had maximized the window. I want it in full screen the complete full screen as seen in games, like with no title bar and taskbar. – Kumar Saptam Dec 21 '20 at 10:57
  • I don't know your code. I am asking if you can edit the function `enterFullScreen` listed in Link2 and change it. – Barmak Shemirani Dec 21 '20 at 12:01

0 Answers0