Results 1 to 2 of 2

Thread: cmd.exe: Removing Titlebar and Borders

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2009
    Posts
    31

    cmd.exe: Removing Titlebar and Borders

    Hi,

    Having opened cmd.exe by using a process, how can I now open it without a Titlebar or borders?

    Code:
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Dim p As New System.Diagnostics.ProcessStartInfo
            p.FileName = "cmd"
            proc.StartInfo = p
            proc.Start()
        End Sub
    TIA

    Rock

  2. #2
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: cmd.exe: Removing Titlebar and Borders

    I dont think thats possible. One (rather time consuming) alternative might be to create a form that uses a richtextbox and sets the background color as black and the foreground color as white (so that it looks like command prompt) and then when the user enters something into your richtextbox you pass it to a hidden CMD.exe instance and use RedirectStandardOutput (look it up on MSDN) to read in the response from cmd.exe
    For the amount of effort it would take to get that to work really well I think you may find that you can put up with the borders and title bar :P

    Of course someone else may know of an API or something that you can use to hide the borders etc but I've certainly not heard of one.

    EDIT: Actually, here you go this looks like an API that could do it: http://support.microsoft.com/kb/110393
    You would need to get the hwnd of the command prompt window that you opened and pass that to the SetWindowLong API
    Last edited by chris128; Jan 30th, 2009 at 02:57 PM.
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width