Saving settings to Windows registry as a tuple
you need save winpos_t as single value with REG_BINARY instead 3 different values. possible implementation:

class CConfig
{
    HKEY _hKey;
public:

    ~CConfig()
    {
        if (_hKey)
        {
            RegCloseKey(_hKey);
        }
    }

    CConfig() : _hKey (0)
    {
    }

    LSTATUS Save(
        PCWSTR lpValueName,
        DWORD dwType,
        const void* lpData,
        DWORD cbData)
    {
        return RegSetValueExW(_hKey, lpValueName, 0, dwType, (BYTE*)lpData, cbData);
    }

    LSTATUS Load(
        PCWSTR lpValueName,
        PDWORD lpType,
        void* lpData,
        PDWORD lpcbData)
    {
        return RegQueryValueExW(_hKey, lpValueName, 0, lpType, (BYTE*)lpData, lpcbData);
    }

    LSTATUS Init(HKEY hKey, PCWSTR lpSubKey)
    {
        return RegCreateKeyExW(hKey, lpSubKey, 0, 0, 0, KEY_ALL_ACCESS, 0, &amp;_hKey, 0);
    }
};

void test_cfg()
{
    CConfig cfg;
    if (!cfg.Init(HKEY_CURRENT_USER, L"Software\\MyKey"))
    {
        struct winpos_t
        {
            DWORD dwWindowStyle;
            int iWindowX;
            int iWindowY;
        };

        winpos_t test_pos = { 1, 2, 3};

        static const PCWSTR szwinpos_t = L"winpos_t";

        if (!cfg.Save(szwinpos_t, REG_BINARY, &amp;test_pos, sizeof(test_pos)))
        {
            ULONG type, cb = sizeof(test_pos);
            RtlZeroMemory(&amp;test_pos, sizeof(test_pos));
            if (!cfg.Load(szwinpos_t, &amp;type, &amp;test_pos, &amp;cb) &amp;&amp; type == REG_BINARY &amp;&amp; cb == sizeof(test_pos))
            {
                DbgPrint("{%x, %x, %x}\n", test_pos.dwWindowStyle, test_pos.iWindowX, test_pos.iWindowY);
            }
        }
    }
}