2022-05-21 19:58:09 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
#include <atomic>
|
|
|
|
#include "Form.h"
|
|
|
|
|
|
|
|
namespace Forms
|
|
|
|
{
|
|
|
|
// Provides static methods and properties to manage an application.
|
|
|
|
class Application
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
// Begins running a standard application message loop on the current
|
|
|
|
// thread, and makes the specified form visible.
|
2024-06-01 11:35:07 +02:00
|
|
|
static void Run(Form* MainWindow, bool DeleteWindow);
|
2022-05-21 19:58:09 +02:00
|
|
|
|
|
|
|
// Begins running a dialog application loop on the
|
|
|
|
// current thread, you MUST clean up the dialog after use.
|
|
|
|
static void RunDialog(Form* MainDialog);
|
|
|
|
|
|
|
|
// Enables the use of visual style components and initializes GDI+.
|
|
|
|
static void EnableVisualStyles();
|
|
|
|
|
|
|
|
private:
|
|
|
|
// Runs the main window loop.
|
|
|
|
static void RunMainLoop(Form* MainWindow);
|
|
|
|
|
|
|
|
// Whether or not GDI+ has been initialized
|
|
|
|
static std::atomic<bool> IsGdipInitialized;
|
|
|
|
// The token for GDI+
|
|
|
|
static ULONG_PTR GdipToken;
|
|
|
|
|
|
|
|
// Internal cleanup routines
|
|
|
|
static void InitializeGdip();
|
|
|
|
static void ShutdownGdip();
|
|
|
|
};
|
|
|
|
}
|