How to get C# Console App. Always visible?

Hw to you keep a c# console app always on top of other windows?

Page 1 of 1

2 Replies - 7261 Views - Last Post: 26 May 2009 - 05:27 AM Rate Topic: -----

#1 fl4wl3ss  Icon User is offline

  • New D.I.C Head

Reputation: 4
  • View blog
  • Posts: 19
  • Joined: 22-January 09

How to get C# Console App. Always visible?

Posted 23 May 2009 - 05:44 PM

How would you keep a c# console application in the foreground at all times (on top of other windows)? I can't find a solution to this, so any help would be appreciated.
Is This A Good Question/Topic? 0
  • +

Replies To: How to get C# Console App. Always visible?

#2 masteryee  Icon User is offline

  • D.I.C Regular

Reputation: 40
  • View blog
  • Posts: 271
  • Joined: 16-May 09

Re: How to get C# Console App. Always visible?

Posted 23 May 2009 - 06:36 PM

Off the top of my head, I think the only way to do something like that on a Windows operating system is to use unmanaged calls to the microsoft user32.dll (use DllImport), which has a method like FindWindow, which will allow you to find a specific open window by name or caption and return the handle to that window, and then call the dll's SetForegroundWindow method with said handle as the parameter. On the other hand, if it were a Form application instead of console application, you just need to call the form's BrintToFront method.
Was This Post Helpful? 0
  • +
  • -

#3 Ändrew  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 25
  • View blog
  • Posts: 312
  • Joined: 21-April 08

Re: How to get C# Console App. Always visible?

Posted 26 May 2009 - 05:27 AM

I found this...

http://stackoverflow...w-to-front-in-c

Ändrew
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1