Monday, June 22, 2026

Creating new file types in Windows 10

After formatting my computer and installing Windows 10 IoT LTSC, I lost all my custom file extensions. So far, I was using FileTypesMan, but then I thought, hey what if I actually learn how this file association thing works.

With the help of ChatGPT, I was able to assemble a Registry script to add a new, custom file extension, along with its icon and associated program:

Windows Registry Editor Version 5.00

; Associate extension with given identifier
[HKEY_CLASSES_ROOT\.srt]
@="rodrigocfd.srt"

; File type description
[HKEY_CLASSES_ROOT\rodrigocfd.srt]
@="SRT subtitle"

; Custom icon
[HKEY_CLASSES_ROOT\rodrigocfd.srt\DefaultIcon]
@="D:\\Dropbox\\core\\icons\\srt-blue.ico"

; Open command
[HKEY_CLASSES_ROOT\rodrigocfd.srt\shell\open\command]
@="\"C:\\Windows\\System32\\notepad.exe\" \"%1\""

By analyzing the structure above, it’s pretty clear how the structure works.

And now I have the itch to write a program to manage that stuff.

Sunday, June 14, 2026

Inactive titlebar color in Windows 10

After I installed my Windows 10 IoT LTSC, I noticed that the inactive titlebar was white. The blue active titlebar could be set via Settings, but not the inactive. ChatGPT gave me the Registry entries to set this color manually:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM]
"AccentColorInactive"=dword:00DCDCDC
"ColorPrevalence"=dword:00000001

Save the content above in a *.reg file, and merge it to the Registry, and it’s done.

Saturday, June 6, 2026

Understanding std::rotate

While working on the future version of my C++20 WinDlg library, I stumbled upon the need to shift characters within a string. My first impulse was to use memmove, but hey, there should be a C++ way to do this.

In fact, std::rotate seemed to be the appropriate fit – safe and sound –, but turns out I had a different idea on how it would work, and it took me a while to properly understand it. The central idea is: you take the interval [it1 it2) and move it right, so it will end at it3). Everything beyond it3 will be placed at the beginning. Thus it actually “rotates” to the left.

Examples:

std::wstring s = L"01234";

std::rotate(s.begin(), s.begin() + 1, s.end()); // 12340
std::rotate(s.begin(), s.begin() + 2, s.end()); // 23401
std::rotate(s.begin(), s.begin() + 4, s.end()); // 40123

std::rotate(s.begin() + 1, s.begin() + 2, s.end()); // 02341
std::rotate(s.begin() + 3, s.begin() + 4, s.end()); // 01243