| |
|
|
|
$U thread.pcu =thread.
Declarar gmx%,gmy%,gmp#,dlg&
windowstyle ( 512 | 8 )
cls
dlg&=createdialog(%hwnd,,100,100,300,300)
Dim gmp#,8
whilenot %key=2
thread.start 1,1
waitinput
thread.stop 1
wend
disponer gmp#
destroywindow (dlg&)
end
proc thread.do
parámetros n&
if n&=1
clear gmp#
external(user32,ClientToScreen,dlg&,gmp#)
gmx%=long(gmp#,0)
gmy%=long(gmp#,4)
external(user32,GetCursorPos,gmp#)
gmx%=long(gmp#,0)-gmx%
gmy%=long(gmp#,4)-gmy%
locate 1,1
imprimir gmx%,gmy%,
endif
ENDPROC
Salve. |
|
|
| |
|
|
|
| Frank Abbing (Apéndice): Otro Solución es esta. Lo se bastante simplemente el Message WM_MOUSEMOVE ausgewertet:
Declarar rect#,mousex&,mousey&,fenster&
Dim rect#,16
DEF ScreenToClient(2) ! user32,ScreenToClient
DEF GetCursorPos(1) !USER32,GetCursorPos
Cls
fenster&=@Crear(Ventana,%hwnd,Diálogo,100,100,240,480)
Usermessages $200
Mientras que 1
WaitInput
Case ((%key=2) or (%key=4)):BREAK
If fenster&=%MWnd
GetCursorPos(rect#)
ScreenToClient(fenster&,rect#)
mousex&=Largo(rect#,0)
mousey&=Largo(rect#,4)
DrawText 20,20,Str$(Int(mousex&))+, +Str$(Int(mousey&))+
EndIf
EndWhile
Disponer rect#
End
|
|
|
| |
|
|