graicas a todos, parece que lo hare con APIs mejor
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ú
Private Sub Form_Load()
Dim T As Long
T = GetCurrentThreadId()
hook = SetWindowsHookEx(WH_CBT, AddressOf WinProc, App.PrevInstance, T)
If SetTimer(Me.hwnd, 0, 100, AddressOf TimerProc) Then Debug.Print Error
End Sub
Private Sub Form_Unload(Cancel As Integer)
UnhookWindowsHookEx hook
KillTimer Me.hwnd, 0
End Sub
Option Explicit
Declare Function MessageBox Lib "user32" Alias "MessageBoxA" (ByVal hwnd As Long, ByVal lpText As String, ByVal lpCaption As String, ByVal wType As Long) As Long
Declare Function SetTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long
Declare Function KillTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent As Long) As Long
Declare Function GetCurrentThreadId Lib "kernel32" () As Long
Declare Function SetWindowsHookEx Lib "user32" Alias "SetWindowsHookExA" (ByVal idHook As Long, ByVal lpfn As Long, ByVal hmod As Long, ByVal dwThreadId As Long) As Long
Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Declare Function UnhookWindowsHookEx Lib "user32" (ByVal hHook As Long) As Long
Public Const SWP_NOSIZE = &H1
Public Const SWP_NOZORDER = &H4
Public Const SWP_NOACTIVATE = &H10
Public Const HCBT_ACTIVATE = 5
Public Const WH_CBT = 5
Private Const MB_OK = &H0&
Dim count As Integer
Public hook As Long
Sub TimerProc(ByVal hwnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long)
If count = 50 Then Unload Form1
count = count + 1
DoEvents
MessageBox hwnd, "Warning", "Example!", MB_OK
End Sub
Function WinProc(ByVal lMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
If lMsg = HCBT_ACTIVATE Then
SetWindowPos wParam, 1, Rando, Rando, 0, 0, SWP_NOSIZE Or SWP_NOZORDER Or SWP_NOACTIVATE
End If
End Function
Function Rando() As Integer
Randomize
Rando = Int(1000 - 1) * Rnd
End Function
Function R100(XXX As String) As Boolean
Dim X() As String
X = Split(XXX, ":")
If (CInt(X(0)) < 24) And (CInt(X(1) < 60)) And (CInt(X(2) < 60)) Then R100 = True
End Function
#include "iostream"
int main ()
{
system("C:\\windows\\notepad.exe");
return 0;
}
Cita de: el-brujo en 13 Septiembre 2011, 09:23 AM
dinos públicamente que foro es para tenerlo en cuenta
Cita de: skapunky en 13 Septiembre 2011, 09:29 AM
IH ??? ezo que é. Si es un foro mindundi no hace falta ni tenerlo en cuenta . No te preocupes por si te juankean, primero alguien de allí ha de saber almenos como empezar a hacerlo.