Hi, i have just finished my first basic program (with a little help)
i want to know if there is a way to name my program, and not just the file path coming up when i run it
help appreiciated
Hi, i have just finished my first basic program (with a little help)
i want to know if there is a way to name my program, and not just the file path coming up when i run it
help appreiciated
You need to describe in a little more detail exactly what you want to do. What do you want the user to do, and what do you want the user to see? Since you're new, you aren't speaking C++ yet.
I think he is referring to the window title name. There must be some windows function (assuming your using windows) that changes the window title. I know how to do this while registering a windows app but never tried for console.
Try:
If you don't care about error checking, you can skip the two if's and also get rid of the "BOOL result = ".Code:#include <windows.h> ... char newTitle[] = "This is my new console window title."; HWND consoleWnd = GetConsoleWindow(); //Get a handle to the console window if(!consoleWnd) //Check for error getting handle { //Fix any error } BOOL result = SetWindowText(consoleWnd, newTitle); //Set the title using this handle if(!result) //Check for error setting title { //Fix any error }
Just Google It. √
(\ /)
( . .)
c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.
I think you can just do this
Code:#include <windows.h> SetConsoleTitle("Hey look, a title!");
Neat, didn't know there was a function for that. Will remember this
Just Google It. √
(\ /)
( . .)
c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.
Thanks everybody, that was what i was after, and has done the trick nicely.
cheers!