#pragma once
#include <windows.h>
#include <string>

class LoadingWindow {
public:
    void Create(const std::string& title = "Loading...");
    void Update(const std::string& step, const std::string& detail, float progress);
    void Destroy();

private:
    HWND hwnd = nullptr;
    std::wstring windowTitle;
    std::string currentStep;
    std::string currentDetail;
    float currentProgress = 0.0f;

    // Static thunk to route Windows messages to the correct instance
    static LRESULT CALLBACK ThunkProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);

    // Actual message handler for this instance
    LRESULT WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
};
