+#else
+ HKEY hkey;
+ LONG success = RegCreateKeyEx(HKEY_CURRENT_USER, TEXT("Software\\subsurface"),
+ 0L, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS,
+ NULL, &hkey, NULL);
+ if (success != ERROR_SUCCESS)
+ printf("CreateKey Software\\subsurface failed %ld\n", success);
+ DWORD value;
+
+#define StoreInReg(_key, _val) { \
+ value = (_val) ; \
+ RegSetValueEx(hkey, TEXT(_key), 0, REG_DWORD, &value, 4); \
+ }
+
+ StoreInReg("feet", output_units.length == FEET);
+ StoreInReg("psi", output_units.pressure == PSI);
+ StoreInReg("cuft", output_units.volume == CUFT);
+ StoreInReg("fahrenheit", output_units.temperature == FAHRENHEIT);
+ StoreInReg("temperature", visible_cols.temperature);
+ StoreInReg("cylinder", visible_cols.cylinder);
+ StoreInReg("nitrox", visible_cols.nitrox);
+ StoreInReg("sac", visible_cols.sac);
+ StoreInReg("otu", visible_cols.otu);
+ RegSetValueEx(hkey, TEXT("divelist_font"), 0, REG_SZ, divelist_font, strlen(divelist_font));
+ if (RegFlushKey(hkey) != ERROR_SUCCESS)
+ printf("RegFlushKey failed %ld\n");
+ RegCloseKey(hkey);
+#endif