Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 342
  • Last Modified:

Console title bar - .net 1.1

Hi,

Probably a nice easy question.

How can you change the text in the title bar of a console application using .net 1.1?
I've seems you can use Console.Title in .net 2.0, but it's not available in .net 1.1, which I need to use for this project.

Thanks.
0
Jivlain
Asked:
Jivlain
1 Solution
 
JivlainAuthor Commented:
Never mind, I found it myself.

first:
 using System.Runtime.InteropServices;

inside class, import a function from a DLL:
 [DllImport("kernel32.dll")]
 public static extern bool SetConsoleTitle(String lpConsoleTitle);

finally, call the function from within the class:
 SetConsoleTitle("Hello world!");
0
 
GranModCommented:
Closed, 125 points refunded.
GranMod
The Experts Exchange
Community Support Moderator of all Ages
0

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now