For modifying the icon, I am not sure how you can do it in C, but I do know of a way to do it in TI-BASIC using the Celtic (monochome) libs.
Code:
If you can find a way to get the address of the start of your file, it shouldn't be too bad to write over the icon data.
Code:
PROGRAM:ICON
:DCS
"AA55AA55AA55AA55 //checker icon
"0->Str1
det(21,Str1,0,42 //put " in Str1
Input "ICON:",A
If A
Then
det(8,"ICON",Str1+"FF818181818181FF",2 //put box icon on line 2 of this file
Else
det(8,"ICON",Str1+"AA55AA55AA55AA55",2 //put checker icon on line 2
End
If you can find a way to get the address of the start of your file, it shouldn't be too bad to write over the icon data.