Autor
|
Tema: Una duda (Leído 1,077 veces)
|
VirucKingX
Desconectado
Mensajes: 541
VirucKingX
|
|
Una duda
« en: 24 Diciembre 2006, 21:16 pm » |
|
Como puedo hacer que el form sigua al mouse esu nu mas Bye falta poco para
|
|
|
En línea
|
Bye
|
|
|
DrakoX
Desconectado
Mensajes: 191
|
|
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: '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 '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
Mensajes: 191
|
|
Re: Una duda
« Respuesta #2 en: 24 Diciembre 2006, 22:30 pm » |
|
listo!!! lo acabo de hacer, y quedaria de la siguiente manera: '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 '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
Mensajes: 541
VirucKingX
|
|
Re: Una duda
« Respuesta #3 en: 25 Diciembre 2006, 01:30 am » |
|
DrakoX eres un maestro Muxas gracias Bye
|
|
|
En línea
|
Bye
|
|
|
DrakoX
Desconectado
Mensajes: 191
|
|
Re: Una duda
« Respuesta #4 en: 25 Diciembre 2006, 11:48 am » |
|
jeje, gracias, me alegra que te alla servido
salu2
|
|
|
En línea
|
|
|
|
|
|