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
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