Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- '*Make sure to have all your server files in the debug folder Wink
- 'Code:
- If ComboBox1.Text = "ServerName" Then
- System.Diagnostics.Process.Start("openvpn-gui.exe", "--connect openvpnserver.ovpn")
- End If
- 'How to Hide the OpenVPN window and make it run in the background
- 'Code:
- Dim style As Integer = GetWindowLong(hWnd, GWL_STYLE)
- style = style And Not (WS_VISIBLE)
- style = style Or WS_EX_TOOLWINDOW
- style = style And Not (WS_EX_APPWINDOW)
- ShowWindow(hWnd, SW_HIDE)
- SetWindowLong(hWnd, GWL_STYLE, style)
- ShowWindow(hWnd, SW_SHOW)
- ShowWindow(hWnd, SW_HIDE)
- 'How To Kill The Process So its only open 1 time and you dont get the error "openvpn gui is already running"
- 'Code:
- For Each namehere As Process In Process.GetProcesses
- If namehere.ProcessName.Contains("OpenVPN") Then
- namhere.Kill()
- End If
- Next
- 'not by me ;)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement