If it's a classic header control (class name SysHeader32), probably can be used message HDM_SETITEM. But it's not easy, because need to use process memory, know indices, use different code for 64 and 32 bit process, maybe DPI-scale.
Maybe better to use drag-and-drop. Can record it, or get column rectangles and write mouse-drag code.
Maybe better to use drag-and-drop. Can record it, or get column rectangles and write mouse-drag code.