Server Help

Misc User Apps - Titles in console windows

Anonymous - Sat Dec 13, 2003 2:14 pm
Post subject: Titles in console windows
How do I do it? I've seen it in Mervbot. I want something other than the address of the file in the title bar
Fuzzjdc - Sun Dec 14, 2003 8:48 pm
Post subject:
dispite the point that this is in the wrong forum (should be in Bot Questions) the answer is simple, its soo easy that anyone who would have read the mervbot.ini would have found it!

open mervbot.ini and then
Code: Show/Hide
[Misc]
WindowCaption=**the name of the window**

Cyan~Fire - Mon Dec 15, 2003 6:17 pm
Post subject:
He means in any C++ program.

Well here's my modified way of how Catid did it. It's pretty complex, actually.
Code: Show/Hide
char fileName[532];
Sint32 len = GetModuleFileName(GetModuleHandle(NULL), fileName, 532);
SetWindowText(FindWindow(NULL, fileName), title)


As I don't feel like explaining all this, look all the functions up in the Windows SDK docs. This method requires windows.h (and, of course, Windows itself).
Dunno how to do it on another OS. icon_razz.gif
Anonymous - Mon Dec 15, 2003 7:54 pm
Post subject:
Complex is an understatement icon_redface.gif
Fuzzjdc - Mon Dec 15, 2003 9:16 pm
Post subject:
he saw that mervbot did it. so i told him how you do it in mervbot. sheez
Cyan~Fire - Mon Dec 15, 2003 10:43 pm
Post subject:
Yes, you told him how to set the caption of the MERVBot window. But that will surprisingly enough only work in MERVBot. He wanted the code behind it so he could make his own program that does the same thing.

Diediedie: I'd recommend just sticking with the default title for now icon_wink.gif
Uio - Thu Dec 18, 2003 11:37 am
Post subject:
*Smacks Windows* Got a good point, I think I'll do that =x.

<-- Diediedie!
D1st0rt - Thu Dec 18, 2003 5:17 pm
Post subject:
I forget how to do it in the Client window, it was one of those little tips that pops up when the thing starts
Cyan~Fire - Thu Dec 18, 2003 5:29 pm
Post subject:
There's an easier way to do it in MFC. But I don't know it. icon_razz.gif
Mine GO BOOM - Thu Dec 18, 2003 11:14 pm
Post subject:
Well, I know the DOS command that does this: title. So if you really want, you could do system("title New window title here");.
Uio - Fri Dec 19, 2003 1:58 pm
Post subject:
Hmmmm, should I use Cyan's uber-complex way, or just a simple system command? Boy that sure is a tough one icon_rolleyes.gif. Thanks, mgb.
Smong - Wed Dec 24, 2003 4:43 pm
Post subject:
D1st0rt wrote:
I forget how to do it in the Client window, it was one of those little tips that pops up when the thing starts

I beleive that was title.dat, however the version number in the title bar cannot be changed.
Versetti - Mon Jan 05, 2004 9:02 pm
Post subject:
there is really a very very simple but I think it is a cheap way too do it but for those that want too it is a basic MS-Dos command. but this method only works in Consle apps in C++.
Code: Show/Hide

#include <stdlib.h> //Include this file for the system(); funcation

void main()
{
char Titlename[32];
strncpy(Titlename,"tilte ",32); //this adds "title " to the char
strcat(Titlename,"Title Here");  //now it adds the rest so it looks like:
//"title Title Here"
system(Titlename);
}


thats the cheap way but it works as long Windows got the title.exe I think it is or something like it in the ms-dos commands.
Versetti - Mon Jan 05, 2004 9:08 pm
Post subject:
O Yea I remembered my other code that works also let me just show it too you real fast:
Code: Show/Hide
#include <windows.h>//I want too say it is this include but I have a
//feeling it is not try it and see if it works

void main(){
SetConsoleTitle("Put the title here!!!!");
}


hope those two replays help you out.
Cyan~Fire - Mon Jan 05, 2004 9:55 pm
Post subject:
icon_eek.gif Dude that SetConsoleTitle() rocks. *bows*
D1st0rt - Tue Jan 06, 2004 3:00 pm
Post subject:
$$
Versetti - Tue Jan 06, 2004 3:52 pm
Post subject:
icon_biggrin.gif
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group