Win32 C++ Listbox export

So I have this here. I got the code importing the users from a text file. Now I want it to format the names into a certain criteria. And save it to a new file called abc.txt I can't even get it to save the listbox to a file please someone help.