Echale un vistazo a este post aver si te sirve
[urhttp://foro.elhacker.net/index.php/topic,101303.0.htmll][/url]
[urhttp://foro.elhacker.net/index.php/topic,101303.0.htmll][/url]
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ú
Option Explicit
Private Sub Command1_Click()
MsgBox Text1
End Sub
Option Explicit
Private objDer As PictureBox
Private hndNotepad As Long
Private Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
'------------------------------------------------------------------------------
' APIS para incluir las ventanas en un PictureBox
'------------------------------------------------------------------------------
' Para hacer ventanas hijas
Private Declare Function SetParent Lib "user32" _
(ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
'
' Para mostrar una ventana según el handle (hwnd)
' ShowWindow() Commands
Private Enum eShowWindow
HIDE_eSW = 0&
SHOWNORMAL_eSW = 1&
NORMAL_eSW = 1&
SHOWMINIMIZED_eSW = 2&
SHOWMAXIMIZED_eSW = 3&
MAXIMIZE_eSW = 3&
SHOWNOACTIVATE_eSW = 4&
SHOW_eSW = 5&
MINIMIZE_eSW = 6&
SHOWMINNOACTIVE_eSW = 7&
SHOWNA_eSW = 8&
RESTORE_eSW = 9&
SHOWDEFAULT_eSW = 10&
MAX_eSW = 10&
End Enum
Private Declare Function ShowWindow Lib "user32" _
(ByVal hWnd As Long, ByVal nCmdShow As eShowWindow) As Long
'
' Para posicionar una ventana según su hWnd
Private Declare Function MoveWindow Lib "user32" _
(ByVal hWnd As Long, ByVal x As Long, ByVal y As Long, _
ByVal nWidth As Long, ByVal nHeight As Long, ByVal bRepaint As Long) As Long
'
' Para saber si una ventana es hija de otra
Private Declare Function IsChild Lib "user32" _
(ByVal hWndParent As Long, ByVal hWnd As Long) As Long
Private Type POINTAPI
x As Long
y As Long
End Type
Private Type RECTAPI
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Type WINDOWPLACEMENT
Length As Long
Flags As Long
ShowCmd As Long
ptMinPosition As POINTAPI
ptMaxPosition As POINTAPI
rcNormalPosition As RECTAPI
End Type
Private Declare Function GetWindowPlacement Lib "user32" _
(ByVal hWnd As Long, ByRef lpwndpl As WINDOWPLACEMENT) As Long
' Mostrar el formulario indicado, dentro de picDock
Private Sub dockForm(ByVal formhWnd As Long, _
ByVal picDock As PictureBox, _
Optional ByVal ajustar As Boolean = True)
' Hacer el formulario indicado, un hijo del picDock
' Si Ajustar es True, se ajustará al tamaño del contenedor,
' si Ajustar es False, se quedará con el tamaño actual.
Call SetParent(formhWnd, picDock.hWnd)
posDockForm formhWnd, picDock, ajustar
Call ShowWindow(formhWnd, NORMAL_eSW)
End Sub
' Posicionar el formulario indicado dentro de picDock
Private Sub posDockForm(ByVal formhWnd As Long, _
ByVal picDock As PictureBox, _
Optional ByVal ajustar As Boolean = True)
' Posicionar el formulario indicado en las coordenadas del picDock
' Si Ajustar es True, se ajustará al tamaño del contenedor,
' si Ajustar es False, se quedará con el tamaño actual.
Dim nWidth As Long, nHeight As Long
Dim wndPl As WINDOWPLACEMENT
'
If ajustar Then
nWidth = picDock.ScaleWidth \ Screen.TwipsPerPixelX
nHeight = picDock.ScaleHeight \ Screen.TwipsPerPixelY
Else
' el tamaño del formulario que se va a posicionar
Call GetWindowPlacement(formhWnd, wndPl)
With wndPl.rcNormalPosition
nWidth = .Right - .Left
nHeight = .Bottom - .Top
End With
End If
Call MoveWindow(formhWnd, 0, 0, nWidth, nHeight, True)
End Sub
Private Sub Command1_Click()
Call Shell("calc.exe", vbNormalFocus) '<<<Podes cambiar por el programa que quieras vos
'
Dim s As String
'hndNotepad = FindWindow(s, "Sin título - Bloc de notas")
hndNotepad = FindWindow(s, "Calculadora") '<<<<--Titulo de la Ventana
'si es false se ve el exe tal cual es LEERRRR
'si es true se ajusta a la ventana bakan
dockForm hndNotepad, objDer, False
End Sub
Private Sub Form_Load()
Set objDer = picR
End Sub
'MODULO
Option Explicit
Public Declare Function RasEnumConnections Lib "RasApi32.dll" Alias "RasEnumConnectionsA" (lpRasCon As Any, lpcb As Long, lpcConnections As Long) As Long
Public Declare Function RasGetConnectStatus Lib "RasApi32.dll" Alias "RasGetConnectStatusA" (ByVal hRasCon As Long, lpStatus As Any) As Long
Public Const RAS95_MaxEntryName = 256
Public Const RAS95_MaxDeviceType = 16
Public Const RAS95_MaxDeviceName = 32
Public Type RASCONN95
dwSize As Long
hRasCon As Long
szEntryName(RAS95_MaxEntryName) As Byte
szDeviceType(RAS95_MaxDeviceType) As Byte
szDeviceName(RAS95_MaxDeviceName) As Byte
End Type
Public Type RASCONNSTATUS95
dwSize As Long
RasConnState As Long
dwError As Long
szDeviceType(RAS95_MaxDeviceType) As Byte
szDeviceName(RAS95_MaxDeviceName) As Byte
End Type
Option Explicit
Public Function IsConnected() As Boolean
Dim TRasCon(255) As RASCONN95
Dim lg As Long
Dim lpcon As Long
Dim RetVal As Long
Dim Tstatus As RASCONNSTATUS95
TRasCon(0).dwSize = 412
lg = 256 * TRasCon(0).dwSize
RetVal = RasEnumConnections(TRasCon(0), lg, lpcon)
If RetVal <> 0 Then
Exit Function
End If
Tstatus.dwSize = 160
RetVal = RasGetConnectStatus(TRasCon(0).hRasCon, Tstatus)
If Tstatus.RasConnState = &H2000 Then
IsConnected = True
Else
IsConnected = False
End If
End Function
Private Sub Timer1_Timer()
Timer1.Interval = 10000 '=10 segundos
'sacale los msgbox son para que te des cuenta como funca.
If IsConnected = True Then MsgBox "Estas Conectado" 'comienza log
If IsConnected = False Then MsgBox "NO estas Conectado" 'fin log
End Sub
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Sleep 1000 '1000 milisegundos=1segundo