elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Guía rápida para descarga de herramientas gratuitas de seguridad y desinfección


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación General
| | |-+  .NET (C#, VB.NET, ASP)
| | | |-+  Programación Visual Basic (Moderadores: LeandroA, seba123neo)
| | | | |-+  Una duda
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: Una duda  (Leído 1,077 veces)
VirucKingX


Desconectado Desconectado

Mensajes: 541


VirucKingX


Ver Perfil
Una duda
« en: 24 Diciembre 2006, 21:16 pm »

Como puedo hacer que el form sigua al mouse  ;D

esu nu mas  ;D

Bye falta poco para  ::)


En línea



Bye
DrakoX

Desconectado Desconectado

Mensajes: 191



Ver Perfil
Re: Una duda
« Respuesta #1 en: 24 Diciembre 2006, 22:15 pm »

Bueno,
aun no logro mantener el tamaño de la ventana,
pero si logre que el esta, siguiera al mouse por toda la pantalla,
en cuanto logre mantener en tamaño,
posteo nuevamente el code,

hasta ahora tengo esto:

Código:
'En el Form
Private Type POINTAPI
    x As Long
    y As Long
End Type

Private Declare Function WindowFromPoint Lib "user32" (ByVal xPoint As Long, ByVal yPoint As Long) As Long
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Dim Pt As POINTAPI, mWnd As Long

Private Sub Timer1_Timer()
GetCursorPos Pt
SetWindowPos Me.hwnd, HWND_TOPMOST, Pt.x, Pt.y, Me.Width, Me.Height, SWP_NOSIZE
End Sub

Código:
'En el modulo
Const SWP_NOSIZE = &H1
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

salu2 y suerte,
en cuanto pueda veo como solucionar esto

salu2



En línea

DrakoX

Desconectado Desconectado

Mensajes: 191



Ver Perfil
Re: Una duda
« Respuesta #2 en: 24 Diciembre 2006, 22:30 pm »

listo!!!
lo acabo de hacer,
y quedaria de la siguiente manera:

Código:
'En un Modulo
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

Código:
'En el Form
Private Type POINTAPI
    x As Long
    y As Long
End Type
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Dim Pt As POINTAPI, mWnd As Long, CX As Long, CY As Long

Private Sub Timer1_Timer()
GetCursorPos Pt
CX = Me.Width / 15
CY = Me.Height / 15
SetWindowPos Me.hwnd, HWND_TOPMOST, Pt.x, Pt.y, CX, CY, SWP_NOSIZE
End Sub

ahora si, el form queda con su tamaño original,
deberias agregar un timer y ponerle un interbalo de 10 milisegundos,
no muhco mayor

salu2 y suerte
En línea

VirucKingX


Desconectado Desconectado

Mensajes: 541


VirucKingX


Ver Perfil
Re: Una duda
« Respuesta #3 en: 25 Diciembre 2006, 01:30 am »

DrakoX eres un maestro  ;D

Muxas gracias


Bye
En línea



Bye
DrakoX

Desconectado Desconectado

Mensajes: 191



Ver Perfil
Re: Una duda
« Respuesta #4 en: 25 Diciembre 2006, 11:48 am »

jeje,
gracias,
me alegra que te alla servido

salu2
En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines