| 
	
		|  Autor | Tema: Clickear sin mover mouse  (Leído 17,439 veces) |  
	| 
			| 
					
						| Hasseds 
								
								 Desconectado 
								Mensajes: 145
								
								   | 
 
SendMessage (ByVal lParam As Long)  +  Make_lParam  Function Make_lParam(ByVal x As Integer, ByVal y As Integer) As Long   Make_lParam = (x And &HFFFF&) Or (y * &H10000)End Function  
 
 |  
						| 
								|  |  
								| « Última modificación:  9 Agosto 2011, 12:58 pm por Hasseds » |  En línea | 
 
 Sergio Desanti |  |  |  | 
			| 
					
						| BahiereTTi 
								
								 Desconectado 
								Mensajes: 18
								
								
								
								
								
								   | 
 
Function Make_lParam(ByVal x As Integer, ByVal y As Integer) As LongMake_lParam = (x And &HFFFF&) Or (y * &H10000)
 End Function
 
 
 ¿?
 
 
 Así?
 
 Pero, que en un timer pongo frmmain.make
 
 O que?
 
 Y tendría que poner: X = COORDENADA
 
 Y: Y = COORDENADA
 
 Pero, no entiendo ese código.
 
 La cosa es que en un timer pase eso.
 
 ¿Pongo ese código en un timer?
 
 Pero donde modifico las coordenadas?
 
 
 Ayudaaaa
 
 
 
 |  
						| 
								|  |  
								|  |  En línea | 
 
 |  |  |  | 
			| 
					
						| Hasseds 
								
								 Desconectado 
								Mensajes: 145
								
								   | 
 
 Option Explicit Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hwnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long Private Sub Form_Load()  ScaleMode = 3  Timer1.Interval = 16End Sub Private Sub Form_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)   Static CountClickX15Y15 As Long   If Button = vbLeftButton And x = 15 And y = 15 Then    CountClickX15Y15 = CountClickX15Y15 + 1    Caption = CountClickX15Y15  End If End SubFunction Make_lParam(ByVal x As Integer, ByVal y As Integer) As Long  Make_lParam = x Or (y * &H10000)End Function Private Sub Timer1_Timer()  Call SendMessage(Me.hwnd, &H201, &H0&, Make_lParam(15, 15))  Call SendMessage(Me.hwnd, &H202, &H0&, Make_lParam(15, 15))End Sub   
 |  
						| 
								|  |  
								|  |  En línea | 
 
 Sergio Desanti |  |  |  | 
			| 
					
						| Hasseds 
								
								 Desconectado 
								Mensajes: 145
								
								   | 
 
. |  
						| 
								|  |  
								| « Última modificación: 15 Agosto 2011, 21:31 pm por Hasseds » |  En línea | 
 
 Sergio Desanti |  |  |  | 
			| 
					
						| BahiereTTi 
								
								 Desconectado 
								Mensajes: 18
								
								
								
								
								
								   | 
 
Gracias...
 El 1er codigo va en un modulo y el 2do en el form.
 
 Agrego 1 timer 1 command button.
 
 En el modulo, acá:
 Private Sub Form_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
 
 Static CountClickX15Y15 As Long
 
 If Button = vbLeftButton And x = 630 And y = 390 Then
 CountClickX15Y15 = CountClickX15Y15 + 1
 Caption = CountClickX15Y15
 End If
 
 End Sub
 
 
 Me tiró a CAPTION  "VARIABLE NO DEFINIDA"
 
 ¿Como la declaro y en donde me recomendas?
 |  
						| 
								|  |  
								|  |  En línea | 
 
 |  |  |  | 
			| 
					
						| Hasseds 
								
								 Desconectado 
								Mensajes: 145
								
								   | 
 
Olvidate del segundo código... el pimer codigo va en un Form, eso es lo que pediste, como mandar un Click por coordenadas sin mover el mouse !!!
 PD:
 Private Sub Form_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
 
 Nunca puede ir en un Módulo...
 
 
 
 
 
 
 |  
						| 
								|  |  
								| « Última modificación: 15 Agosto 2011, 21:38 pm por Hasseds » |  En línea | 
 
 Sergio Desanti |  |  |  | 
			| 
					
						| BahiereTTi 
								
								 Desconectado 
								Mensajes: 18
								
								
								
								
								
								   | 
 
Buenisimo, pero dudas.
 1ero, para que el command1 abre el Pinball?
 Yo no pedí eso :S
 
 2do
 
 Donde configuro que me haga click?
 Donde está para poner la coordenada X y la Y?
 
 
 
 |  
						| 
								|  |  
								|  |  En línea | 
 
 |  |  |  | 
			| 
					
						| Hasseds 
								
								 Desconectado 
								Mensajes: 145
								
								   | 
 
Olvidate del codigo del Pinball, ya lo quité para q no te confundas, analizá el codigo que te dejé para entender como mandar un Click a una  coordenada específica de un control  sin mover el mouse !!! |  
						| 
								|  |  
								|  |  En línea | 
 
 Sergio Desanti |  |  |  | 
			| 
					
						| BahiereTTi 
								
								 Desconectado 
								Mensajes: 18
								
								
								
								
								
								   | 
 
Buenisimo, pero me podes explicar como funciona?
 Porque no lo entiendo.
 
 Mira como me quedo:
 Option Explicit
 
 Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hwnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
 
 Private Sub Form_Load()
 ScaleMode = 3
 Timer1.Interval = 16
 End Sub
 
 Private Sub Form_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
 
 Static CountClickX15Y15 As Long
 
 If Button = vbLeftButton And x = 650 And y = 380 Then
 CountClickX15Y15 = CountClickX15Y15 + 1
 Caption = CountClickX15Y15
 End If
 
 End Sub
 Function Make_lParam(ByVal x As Integer, ByVal y As Integer) As Long
 Make_lParam = x Or (y * &H10000)
 End Function
 
 Private Sub Timer1_Timer()
 Call SendMessage(Me.hwnd, &H201, &H0&, Make_lParam(650, 380))
 Call SendMessage(Me.hwnd, &H202, &H0&, Make_lParam(650, 380))
 End Sub
 
 
 
 
 
 Modifique eso de and y = 15 and x = 15 y lo del timer1  quedo así el timer1:
 Private Sub Timer1_Timer()
 Call SendMessage(Me.hwnd, &H201, &H0&, Make_lParam(650, 380))
 Call SendMessage(Me.hwnd, &H202, &H0&, Make_lParam(650, 380))
 End Sub
 
 650 = x
 380 = y
 
 
 
 Pero, sigue sin hacer click en esa coordenada .
 
 
 
 Igual, gracias por tratar de ayudarme :S
 
 |  
						| 
								|  |  
								| « Última modificación: 15 Agosto 2011, 23:12 pm por BahiereTTi » |  En línea | 
 
 |  |  |  | 
			| 
					
						| Hasseds 
								
								 Desconectado 
								Mensajes: 145
								
								   | 
 |  
						| 
								|  |  
								|  |  En línea | 
 
 Sergio Desanti |  |  |  |  |  
 
	
 
 
				
					
						| Mensajes similares |  
						|  | Asunto | Iniciado por | Respuestas | Vistas | Último mensaje |  
						|   |   | Tiempo sin mover el mouse/teclado Programación Visual Basic
 | Sanlegas | 2 | 3,278 |  29 Octubre 2011, 04:02 am por Sanlegas
 |  
						|   |   | mover imagen con el mouse Java
 | bengy | 6 | 8,703 |  16 Septiembre 2012, 16:08 pm por bengy
 |  
						|   |   | [Problema]Chillido al mover el mouse Windows
 | You-and- | 4 | 3,485 |  17 Enero 2013, 02:51 am por You-and-
 |  
						|   |   | Como hacer un transform al mover el mouse fuera del elem. con un selector css3 Desarrollo Web
 | Drakaris | 2 | 3,267 |  9 Octubre 2017, 22:23 pm por Drakaris
 |  
						|   |   | ¿Como Mover Objetos Con El Mouse (allegro en codeblocks)? Programación C/C++
 | MaUrOx970909 | 1 | 3,389 |  25 Octubre 2017, 18:08 pm por Maurice_Lupin
 |    |