Lo que quiero lograr es que la "tarea" se active con un click ( Que eso ya lo logre ) pero fuera del form.
Aca dejo el codigo del proyecto que tengo.
Código:
Private Sub Command1_Click()
SetWindowPos Me.hWnd, HWND_TOPMOST, 0, 0, 0, 0, _
SWP_NOMOVE Or SWP_NOSIZE
End Sub
Private Sub Command2_Click()
SetWindowPos Me.hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE
End Sub
Private Sub Form_Load()
Command1.Caption = "Siempre visible"
Command2.Caption = "Ventana Normal"
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
'Sólo basta con vbRightButton, pero puse la línea completa para que veas de dónde viene
If Button = VBRUN.MouseButtonConstants.vbRightButton Then
Call Tarea 'Ejecutamos la Tarea
End If
End Sub
Private Sub Tarea()
SetCursorPos "720", "133"
mouse_event MOUSEEVENTF_LEFTDOWN, 720, 133, 0, 0
mouse_event MOUSEEVENTF_LEFTUP, 720, 133, 0, 0
mouse_event MOUSEEVENTF_LEFTDOWN, 720, 133, 0, 0
mouse_event MOUSEEVENTF_LEFTUP, 720, 133, 0, 0
mouse_event MOUSEEVENTF_LEFTDOWN, 720, 133, 0, 0
mouse_event MOUSEEVENTF_LEFTUP, 720, 133, 0, 0
SetCursorPos "634", "335"
mouse_event MOUSEEVENTF_LEFTDOWN, 634, 335, 0, 0
mouse_event MOUSEEVENTF_LEFTUP, 634, 335, 0, 0
mouse_event MOUSEEVENTF_LEFTDOWN, 634, 335, 0, 0
mouse_event MOUSEEVENTF_LEFTUP, 634, 335, 0, 0
mouse_event MOUSEEVENTF_LEFTDOWN, 634, 335, 0, 0
mouse_event MOUSEEVENTF_LEFTUP, 634, 335, 0, 0
SetCursorPos "620", "390"
mouse_event MOUSEEVENTF_LEFTDOWN, 620, 390, 0, 0
mouse_event MOUSEEVENTF_LEFTUP, 620, 390, 0, 0
mouse_event MOUSEEVENTF_LEFTDOWN, 620, 390, 0, 0
mouse_event MOUSEEVENTF_LEFTUP, 620, 390, 0, 0
mouse_event MOUSEEVENTF_LEFTDOWN, 620, 390, 0, 0
mouse_event MOUSEEVENTF_LEFTUP, 620, 390, 0, 0
SetCursorPos "283", "344"
mouse_event MOUSEEVENTF_LEFTDOWN, 283, 344, 0, 0
mouse_event MOUSEEVENTF_LEFTUP, 283, 344, 0, 0
mouse_event MOUSEEVENTF_LEFTDOWN, 283, 344, 0, 0
mouse_event MOUSEEVENTF_LEFTUP, 283, 344, 0, 0
mouse_event MOUSEEVENTF_LEFTDOWN, 283, 344, 0, 0
mouse_event MOUSEEVENTF_LEFTUP, 283, 344, 0, 0
End Sub
Como ven no sabia como explicar la "tarea" pero ahi lo ven. Queria lograr, repito, como activarla con click derecho pero fuera del form.
Logre que se active la "tarea" pero tiene que ser click derecho dentro del formulario.
Como lo logro?
Saludos! Suerte!
Muchas Gracias!