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

class WindowClassManager
{
public:
    WindowClassManager(const std::wstring& className);
    ~WindowClassManager();

    bool Register(WNDPROC wndProc);
    bool Unregister();

    bool IsRegistered() const;
    std::wstring GetWindowClassName() const;
    HINSTANCE GetInstance() const;

    WNDCLASSEXW CreateWindowClass(WNDPROC wndProc) const;

private:
    bool RegisterWindowClass(const WNDCLASSEXW& wc);
    bool UnregisterWindowClass();

    void SetRegistered(bool registered);

    WNDCLASSEXW BuildWindowClassStruct(WNDPROC wndProc) const;
    void InitializeWindowClassDefaults(WNDCLASSEXW& wc) const;

    std::wstring mClassName;
    HINSTANCE mhInstance;
    bool mIsRegistered;
};