How to set the console window title in C?
printf("%c]0;%s%c", '\033', "My Console Title", '\007');
This works only under linux, not in windows, Does anybody know a "cross-platform" solution? (of course not "system ( title=blah )")
How to set the console window title in C?
printf("%c]0;%s%c", '\033', "My Console Title", '\007');
This works only under linux, not in windows, Does anybody know a "cross-platform" solution? (of course not "system ( title=blah )")
Sounds similar to this posting: (Which is for Java, but the accepted answer uses JNI [ie a C Native call].
windows.h
defines SetConsoleTitle()
.
You could use that everywhere, and declare your own function for linux platforms that does the same thing.