Symbianize Forum

Most of our features and services are available only to members, so we encourage you to login or register a new account. Registration is free, fast and simple. You only need to provide a valid email. Being a member you'll gain access to all member forums and features, post a message to ask question or provide answer, and share or find resources related to mobile phones, tablets, computers, game consoles, and multimedia.

All that and more, so what are you waiting for, click the register button and join us now! Ito ang website na ginawa ng pinoy para sa pinoy!

[Simple]Tut how to make VPN GUI [VB 6 + OPENVPN Commands] ]

Status
Not open for further replies.
try this code....

Private Sub Form_Resize()
' System tray min.
If WindowState = vbMinimized Then
Me.Hide
Me.Refresh
With nid
.cbSize = Len(nid)
.hwnd = Me.hwnd
.uId = vbNull
.uFlags = NIF_ICON Or NIF_TIP Or NIF_MESSAGE
.uCallBackMessage = WM_MOUSEMOVE
.hIcon = Me.Icon
.szTip = Me.Caption & vbNullChar
End With
Shell_NotifyIcon NIM_ADD, nid
Else
Shell_NotifyIcon NIM_DELETE, nid
End If
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
Dim Sys As Long
Sys = x / Screen.TwipsPerPixelX
Select Case Sys
Case WM_LBUTTONDOWN:
WindowState = vbNormal
Me.Show
End Select
End Sub




--------->>>>>tapos add ka ng module

then paste this code


Public Declare Function Shell_NotifyIcon Lib "shell32" Alias "Shell_NotifyIconA" (ByVal dwMessage As Long, pnid As NOTIFYICONDATA) As Boolean

Public Const NIM_ADD = &H0
Public Const NIM_MODIFY = &H1
Public Const NIM_DELETE = &H2
Public Const NIF_MESSAGE = &H1
Public Const NIF_ICON = &H2
Public Const NIF_TIP = &H4
Public Const WM_MOUSEMOVE = &H200
Public Const WM_LBUTTONDOWN = &H201
Public Const WM_LBUTTONUP = &H202
Public Const WM_LBUTTONDBLCLK = &H203
Public Const WM_RBUTTONDOWN = &H204
Public Const WM_RBUTTONUP = &H205
Public Const WM_RBUTTONDBLCLK = &H206
Public Const HWND_TOPMOST = -1

Public nid As NOTIFYICONDATA

Public Type NOTIFYICONDATA
cbSize As Long
hwnd As Long
uId As Long
uFlags As Long
uCallBackMessage As Long
hIcon As Long
szTip As String * 64
End Type

thanks to gnol21 ^_^

ym ko? [email protected] :)

newbie lang ako bro as in wala akong alam sa coding ng VB:rofl::upset: pero tech naman ako

yan nga din ginawa ko kanna pa galing kay gnod1... ayaw parin... paste lang ginawa ko and naggawa din ako ng module tapos paste ko din un isa... walang lumabas... hayst may gagawin paba?para gumana?
 
yung combo1additem dun mo ilagay sa form_code

ok na ako dun lumalabas na ung smart and globe ung cnasabi ko ung panu gagana un kapag naclick ko na ung connect... hehehe pareho din tau newbie pero mas madali kang matutu ie.. hehehe ^_^
 
yan nga din ginawa ko kanna pa galing kay gnod1... ayaw parin... paste lang ginawa ko and naggawa din ako ng module tapos paste ko din un isa... walang lumabas... hayst may gagawin paba?para gumana?

hahaha wala naman akong ginawa na copy paste lang :yipee:
 
ok na ako dun lumalabas na ung smart and globe ung cnasabi ko ung panu gagana un kapag naclick ko na ung connect... hehehe pareho din tau newbie pero mas madali kang matutu ie.. hehehe ^_^

Private Sub Command1_Click()
If netw = "Smart" Then
Shell App.Path & "\bin\openvpn --client --dev tun --remote x.x.x.x --proto udp --port 9200 --persist-key --persist-tun --ca crt\torrent_UDP.crt --comp-lzo --mute 3 --tun-mtu 1500 --auth-user-pass crt\account.txt --reneg-sec 0 --keepalive 10 120 --route-method exe --route-delay 2 --verb 3 --log crt\log.txt --status crt\stat.db 1", vbHide
Label1.Caption = "Connecting"
connecting_Timer.Enabled = True
log_Timer.Enabled = True
Else
Command1.Caption = "Disconnecting"
Command1.Enabled = False
disconnecting_Timer.Enabled = True
reconnecting_Timer.Enabled = False
If netw = "Globe" Then
Shell App.Path & "\bin\openvpn --client --dev tun --remote x.x.x.x --proto udp --port 9200 --lport 53 --persist-key --persist-tun --ca crt\torrent_UDP.crt --comp-lzo --mute 3 --tun-mtu 1500 --auth-user-pass crt\account.txt --reneg-sec 0 --keepalive 10 120 --route-method exe --route-delay 2 --verb 3 --log crt\log.txt --status crt\stat.db 1", vbHide
Label1.Caption = "Connecting"
connecting_Timer.Enabled = True
log_Timer.Enabled = True
Else
Command1.Caption = "Disconnecting"
Command1.Enabled = False
disconnecting_Timer.Enabled = True
reconnecting_Timer.Enabled = False
End If
End If
End Sub


o ayan na :)
 
Last edited:
Private Sub Command1_Click()
If netw = "Smart" Then
Shell App.Path & "\bin\openvpn --client --dev tun --remote x.x.x.x --proto udp --port 9200 --persist-key --persist-tun --ca crt\torrent_UDP.crt --comp-lzo --mute 3 --tun-mtu 1500 --auth-user-pass crt\account.txt --reneg-sec 0 --keepalive 10 120 --route-method exe --route-delay 2 --verb 3 --log crt\log.txt --status crt\stat.db 1", vbHide
Label1.Caption = "Connecting"
connecting_Timer.Enabled = True
log_Timer.Enabled = True
Else
Command1.Caption = "Disconnecting"
Command1.Enabled = False
disconnecting_Timer.Enabled = True
reconnecting_Timer.Enabled = False
If netw = "Globe" Then
Shell App.Path & "\bin\openvpn --client --dev tun --remote x.x.x.x --proto udp --port 9200 --lport 53 --persist-key --persist-tun --ca crt\torrent_UDP.crt --comp-lzo --mute 3 --tun-mtu 1500 --auth-user-pass crt\account.txt --reneg-sec 0 --keepalive 10 120 --route-method exe --route-delay 2 --verb 3 --log crt\log.txt --status crt\stat.db 1", vbHide
Label1.Caption = "Connecting"
connecting_Timer.Enabled = True
log_Timer.Enabled = True
Else
Command1.Caption = "Disconnecting"
Command1.Enabled = False
disconnecting_Timer.Enabled = True
reconnecting_Timer.Enabled = False
End If
End If
End Sub


o ayan na :)

mamats po... hmmmm

di ka po gumamit ng "elseif"
example

if netw = smart then
codeblahblah
elseif = globe then
codeblahblah
else

end if

hehehehehe ewan ko lang kng gagana
 
sana may video tutorial, ung kuha sa hypercam
para complete...

medyo nkaka intende ako ng kunti kaso
ayan sa pc ko ung vb, pag piniplay ko na ung ginawa ko kung form
nag eerror.
 
yung disonnect buttong po ayaw gumana kapag iclick ko lumalabas na yung error code 13
 
ung error poh kac di poh lumalabas sakin... just make sure na may laman ang ang varialble "j" b4 gamitin...
 
ung error poh kac di poh lumalabas sakin... just make sure na may laman ang ang varialble "j" b4 gamitin...

okay na po nawala na po yung error yung disconnect button na lang ayaw gumana :)
 
sa disconnect just make sure na ung timer na nka enabled eh naka false lahat if na click ung button ulit... dapat ang nka enabled nlng na timer eh ung disconnecting_Timer kac auto stop un after 3sec...
 
ako nga din pinalitan ko na ung disconnect na true ayaw parin...... heheheh @shadow ung sa minimized tray pahelp nman
 
Status
Not open for further replies.
Back
Top Bottom