English
Opportunities and suggestions

wish: Globale Mausposition

 
trouble: The globale Mausposition isn't simply To relating.

an additional function getMousePos (vlt. get("MousePos",handle&)) missing, these setting too The System-Variables %mouseX  and %mouseY .

is handle& zero, then is the Globale meant, otherwise relatively vlt. How:
CompileMarkSeparation
proc MOUSE.GETPOS

    PARAMETERS H&

    SELECT %PCOUNT

        CASEOF 0

        ~GetCursorPos(MOUSE.MEM#)
        MOUSE.X&=MOUSE.MEM#.X&
        MOUSE.Y&=MOUSE.MEM#.Y&

        CASEOF 1

        DECLARE GMP#
        DIM GMP#,8
        CLEAR GMP#
        ~clientToScreen(H&,GMP#)
        var GMX%=LONG(GMP#,0)
        var GMY%=LONG(GMP#,4)
        ~getCursorPos(GMP#)
        GMX%=LONG(GMP#,0)-GMX%
        GMY%=LONG(GMP#,4)-GMY%
        MOUSE.X&=GMX%
        MOUSE.Y&=GMY%
        DISPOSE GMP#

    ENDSELECT

endproc


CompileMarkSeparation
 
10/16/09  
 




Dieter
Zornow
Why umständlich ifs too simply goes
CompileMarkSeparation
XProfan 11
ohne Parameter ist screenposition
 $H Windows.ph

subproc Get.MOUSEPOS

    PARAMETERS Hwnd&
    Declare X%,Y%,point#
    Dim point#,8

    SELECT %PCOUNT

        CASEOF 0

        ~GetCursorPos(point#)
        X%=long(point#,0)
        Y%=long(point#,4)

        CASEOF 1

        ~getCursorPos(point#)
        ~screenToClient(Hwnd&,point#)
        X% = long(point#,0)
        Y% = long(point#,4)
        OTHERWISE
        Dispose point#
        Return "0|0"

    ENDSELECT

    Dispose point#
    return str$(X%)+"|"+str$(Y%)

endproc

cls

while 1

    waitinput 5
    case %Key = 2:break
    settext %Hwnd,Get("MOUSEPOS",%Hwnd)

endwhile

end
 
Er ist ein Mann wie ein Baum. Sie nennen ihn Bonsai., Win 7 32 bit und Win 7 64 bit, mit XProfan X2
10/17/09  
 



means %mousex and %mousey-setzend would still but schöner and particularly faster.
 
10/17/09  
 




Nico
Madysa
Can the Coordinates because not ClientToScreen converting let?
 
Nico Madysa
10/18/09  
 




Dieter
Zornow
you mean well screentoClient not clienttoscreen. getcursorpos supply already The Screen-Coordinates, everybody can with ScreentoClient on window relating can, How I it in my code made have.
 
Er ist ein Mann wie ein Baum. Sie nennen ihn Bonsai., Win 7 32 bit und Win 7 64 bit, mit XProfan X2
10/18/09  
 



Nico Madysa, Beitrag=54509, Zeitpunkt=18.10.2009
Can the Coordinates because not ClientToScreen converting let?


Coordinates come not on if mouse not überm HWND.
 
10/18/09  
 




Dieter
Zornow
Try time my example, there come tappt im dunkeln on
 
Er ist ein Mann wie ein Baum. Sie nennen ihn Bonsai., Win 7 32 bit und Win 7 64 bit, mit XProfan X2
10/18/09  
 



@Dieter: my response counted Nico the IMHO annahm, that %mousex and %mousey simply umrechenbar would, what therefore little uses, there %mousex and %mousey only staid go, if the Mauspfeil itself over the HWND befindet. ^^ your example is still ok, is still in the Grunde same How mine supra - I meant only the it rather would if XProfan %mousex and y settle could and getMousePos nativ would.
 
10/18/09  
 




Dieter
Zornow
Achso, then have so did i Nico wrong understood, naja rapide fortschreitende Alzheimer.

but fundamentally has it right, The positions in the Mainwindow could one on Screen-Coordinates converting let.
But in the Mainwindow probably sinnfrei.
 
Er ist ein Mann wie ein Baum. Sie nennen ihn Bonsai., Win 7 32 bit und Win 7 64 bit, mit XProfan X2
10/19/09  
 



with Omikron-Basic (Atari 1040ST) hiess it too GetMousePos - found I always beautiful.
 
10/19/09  
 




Nico
Madysa
Yes, that %MouseX and -Y something limited are, forgot I, jsuis inconsolable.

then would but a Set-option, The the two System-Variables properly changes, still integral sinnvoller, or?
 
Nico Madysa
10/24/09  
 



Nico Madysa, Beitrag=54602, Zeitpunkt=24.10.2009
Yes, that %MouseX and -Y something limited are, forgot I, jsuis inconsolable.

then would but a Set-option, The the two System-Variables properly changes, still integral sinnvoller, or?


get("MousePos",[lever]) is meaningfully, changes both Sysvars.
 
10/24/09  
 




Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

6.155 Views

Untitledvor 0 min.
Sven Bader08/02/21
Axel Berse05/01/19
Walter04/07/19
Vgdd06/05/17
More...

Themeninformationen

this Topic has 3 subscriber:

iF (10x)
Nico Madysa (5x)
Dieter Zornow (4x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie