Hiding console windows?


Hi folks
Im trying to learn vb by coding an app that launches some server components for mangos but Im really struggling to workout how to hide the console windows that are launched. Can anybody point me in the right direction pls. Here's the code I have so far...
Public Class Frm1 Private Sub Frm1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load webLink.Links.Remove(webLink.Links(0)) webLink.Links.Add(0, webLink.Text.Length, "http://127.0.0.1/") mmLink.Links.Remove(mmLink.Links(0)) mmLink.Links.Add(0, mmLink.Text.Length, "http://127.0.0.1/minimanager/") End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Start("start") End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Start("stop") End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Start("realmd") End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click kill("realmd") End Sub Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click Start("mangosd") End Sub Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click kill("mangosd") End Sub Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click Me.Hide() NotifyIcon1.Visible = True End Sub ' When the user double-clicks the tray icon, display the main form again. Private Sub ntfSystemInfo_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles NotifyIcon1.DoubleClick Me.Show() End Sub Protected Sub Shutdown() ' Make the system tray icon invisible before ending ' the application, otherwise, it can linger in the tray when the application ' is no longer running. NotifyIcon1.Visible = False Application.Exit() End Sub Private Sub exitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem.Click Shutdown() End Sub Private Sub NotifyIcon1_MouseDoubleClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles NotifyIcon1.MouseDoubleClick End Sub Private Sub ContextMenuStrip1_Opening(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles ContextMenuStrip1.Opening End Sub Private Sub SendToTrayToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SendToTrayToolStripMenuItem.Click Me.Hide() NotifyIcon1.Visible = True End Sub Private Sub LinkLabel1_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles webLink.LinkClicked Dim sInfo As New ProcessStartInfo(e.Link.LinkData.ToString()) Process.Start(sInfo) End Sub Private Sub mmLink_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles mmLink.LinkClicked Dim sInfo As New ProcessStartInfo(e.Link.LinkData.ToString()) Process.Start(sInfo) End Sub Private Sub AboutToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AboutToolStripMenuItem.Click MsgBox("Version info" & vbCrLf & vbCrLf & "v1.0.1" & vbCrLf & vbCrLf & "me@hotmail.com") End Sub Private Sub HelpToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles HelpToolStripMenuItem1.Click MsgBox("Usage..." & vbCrLf & "1. Start Server - Starts the miniserver for MySQL and Apache" & vbCrLf & "2. Start Realmd - Starts realmd.exe" & vbCrLf & "3. Start MaNGOS - Starts mangosd.exe" & vbCrLf & "4. Remember to stop in reverse order" & vbCrLf & "5. Ticking Restart will start any of the process above not running and check they are responding every 30s") End Sub Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged Timer1.Interval = 30000 Timer1.Start() CheckServer("miniserv") CheckProcess("realmd") CheckProcess("mangosd") End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick 'call functions CheckProcess("realmd") CheckProcess("mangosd") Responding("realmd") Responding("mangosd") End Sub Private Sub Responding(ByVal program As String) For Each proc As Process In Process.GetProcesses If proc.ProcessName = program Then Dim myProcesses() As Process myProcesses = Process.GetProcessesByName(program) ' Test for a False return value. If Not myProcesses(0).Responding Then Try myProcesses(0).Kill() Process.Start(program) Catch ex As Exception End Try End If End If Next End Sub Private Sub CheckProcess(ByVal program As String) Dim chk As Integer chk = 0 Dim pList() As System.Diagnostics.Process = _ System.Diagnostics.Process.GetProcesses For Each proc As System.Diagnostics.Process In pList If program = proc.ProcessName Then chk = chk + 1 Next If chk = 0 Then Start(program) End Sub Private Sub CheckServer(ByVal program As String) Dim chk As Integer chk = 0 Dim pList() As System.Diagnostics.Process = _ System.Diagnostics.Process.GetProcesses For Each proc As System.Diagnostics.Process In pList If program = proc.ProcessName Then chk = chk + 1 Next If chk = 0 Then Start("Stop") 'Start the process. Dim miniserv As Process = Process.Start("start") 'Wait for the process to exit. miniserv.WaitForExit() End If End Sub Private Sub kill(ByVal program As String) 'Kill all process's and uncheck CheckBox1 'Using kill("app") Dim pList() As System.Diagnostics.Process = _ System.Diagnostics.Process.GetProcessesByName(program) For Each proc As System.Diagnostics.Process In pList proc.Kill() Next If CheckBox1.Checked = True Then CheckBox1.Checked = False Timer1.Stop() End Sub Private Sub Start(ByVal program As String) 'Launch with error trap! 'Using Start("app") Try Dim myProcess As New Process() myProcess.StartInfo.FileName = program myProcess.Start() Catch ex As Exception MsgBox(ex.Message) End Try End Sub Private Sub CheckBox2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox2.CheckedChanged hideconsole() End Sub Private Sub hideconsole() End Sub End Class
Posted On: Monday 24th of December 2012 01:16:54 AM Total Views:  302
View Complete with Replies

RELATED TOPICS OF Visual Basic PROGRAMMING LANGUAGE




"hiding" columns in Datagrid

OK, I have 20 columns in a datagrid, but I only want to show about 10 of them... I am using this code which dumps all 20 columns into my app: Code: SqlDataAdapter1.Fill(DataSet11) dgQuestions.DataSource = DataSet11.Tables(0) I looked on a few sites and they say that this should work to "hide" a column: Code: dgQuestions.Columns(1).ColumnMapping = MappingType.Hidden Of course this is supposted to hide column #1. I am working in Visual Studio.Net and when I try this code, I get a blue underline and the error says: "Columns" is not a member of System.Windows.Forms.DataGrid Anyone ideas would be nifty.
VIEWS ON THIS POST

74

Posted on:

Saturday 13th October 2012
View Replies!

hiding a workbook

------------------------------------------------------------------------------------------------Put your PC to good work at vbCity at world community grid and join Team vbCity.10,210,819points and ranked 1,839th as of June 23 2011!------------------------------------------------------------------------------------------------ #mce_temp_url# | Post Points: 5 davcbr Right Here Since 6/14/2006 Posts 25 Reputation 395 Reply dave cobor (davcbr) replied on 5/9/2007 7:32 AM rated by 0 users Actually, my last attempt before I posted was:\t\tMyWB.Activate\t\tActiveWindow.Visible = FalseThis turns up error 424 - Object requiredWhen ActiveWindow.Visible = False is calledI want the user to select some cells in one of their workbooks, and my program acts on those selections. However, in the case where the selections are made and then my program is run, my workbook has the attention and the code looks for the selection there. [SelectedRange = ExcelAp.ActiveWindow.RangeSelection.Address]. I need to create my workbook and then get it out of the way so that the active window goes back to the workbook that has the selected range.thanxdc
VIEWS ON THIS POST

147

Posted on:

Saturday 13th October 2012
View Replies!

hiding button c sharp code

Travis MCADGod created the world in fifth normal form, but had to de-normalize it for us to understandPosting Guidlines | Post Points: 5 Kulrom Republic of Macedonia Since 5/29/2006 Posts 2,835 Reputation 17,429 Reply Kulrom (Kulrom) replied on 1/12/2007 8:38 AM rated by 0 users Hahaha it is not stupid but rather easy to find an answer by yourself i believe.However, you can just do it like this:Code:private void btnTest_Click(object sender, System.EventArgs e) { try { \tMessageBox.Show("I think I am going to be hidden !"); } catch (Exception ex) { } finally { \tthis.btnTest.Visible = false; }
VIEWS ON THIS POST

143

Posted on:

Sunday 14th October 2012
View Replies!

If statements and database queries

I am trying to create a survey that can be updated if a user comes back after leaving. The page I am working on here is to get back to their survey. The should enter thier programs license number. The page should then look at the DB and see if that license number(DVN) exist with the column isActive = 1. There will be at most 1 instace of this. If the record does not exist, it should go to the insert statement. If the record does exits it should set the Session. I'm having trouble seeing if the DB value is null. It keeps going to theELSE part of the statement. If someone could steer me in the right direction I would much appreciate it. My button click is below.
VIEWS ON THIS POST

151

Posted on:

Friday 2nd November 2012
View Replies!

Me.activecontrols

\t\t\t\t I have a toolstripcontainer defined and i have 2 buttons inside the toolstrip. I want to use the Me.Activecontrols.Name to check the button that was clicked, but it always returns the toolstrip control name. Let me know how to get the button that was clicked with Me.ActiveControls.Name Private Sub btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn.Click MsgBox(Me.ActiveControl.Name) End Sub
VIEWS ON THIS POST

170

Posted on:

Friday 2nd November 2012
View Replies!

Sending Email to a group address within Domain

I am trying to send out emails using my VB.Net Application to a Group. The Group name is like " Admins" my domain is like "mycompany.com". Now to send out an email to the group from my Lotus Notes Client, I use just " Admins" and the email runs fine. Also from my Lotus Notes Client if I send an email at .Admins@aexp.com, the email runs fine. But the problem appears when I try to use the Application to send emails. If I use only " Admins" then the CDO error comes(this I understand), so to avoid this I use the id as ".Admins@mycompany.com", but I recieve the email back at the From Address Specified in the Mail saying the "Delivery Failue:Enhanced Mail System Status Code (RFC1893): 5.1.1". Though the mail is working fine if I specify persons Id like mike.d.rout@mycompany.com. It would be great help if somebody can lead me to the problem/resolution.
VIEWS ON THIS POST

189

Posted on:

Friday 2nd November 2012
View Replies!

End of Month Function

Is there a function or simple way to get the last day of a given month Craig...
VIEWS ON THIS POST

70

Posted on:

Tuesday 20th November 2012
View Replies!

Connection

How do i connect MySql in Visual Basic....
VIEWS ON THIS POST

101

Posted on:

Thursday 29th November 2012
View Replies!

Open file in append mode mysql procedure

Hi , I have tried to create a file by this query, mysql>select user_id from user into outfile '/home/1234.txt'; Successfully created file.But i have to add header and footer for the same file. I could'nt create a file in mysql.I have to create file with header,data and footer.these are, header -> framed during data insert into the file data -> selected from the table footer -> framed by number of rows inserted in file Please suggest me to create file in mysql.Its very urgent.
VIEWS ON THIS POST

166

Posted on:

Friday 30th November 2012
View Replies!

Determine selected row in DataGrid control

Is there a way to determine which row the user has selected in a datagrid control Currently I'm working on a search facility project in VB 6.0 where user will type some search text in a textbox and the datagrid will display the search result. How can i know which row the user has placed his cursor This post has been edited by bohemian9485: 26 February 2010 - 08:21 PM
VIEWS ON THIS POST

184

Posted on:

Friday 30th November 2012
View Replies!