English
Source / code snippets

local Mausposition Reelle

 

 $u thread.pcu =thread.
Declare 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

dispose gmp#
destroywindow (dlg&)
end

proc thread.do

    parameters 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
        print gmx%,gmy%,

    endif

endproc

salvo.
 
08/11/05  
 



Frank Abbing (Nachtrag):
another Solution is these. it'll integrally simply The Message WM_MOUSEMOVE ausgewertet:
Declare rect#,mousex&,mousey&,fenster&
Dim rect#,16
DEF ScreenToClient(2) ! user32,ScreenToClient
DEF GetCursorPos(1) !USER32,GetCursorPos
Cls
fenster&=@Create(Window,%hwnd,dialog,100,100,240,480)
User Messages $200

While 1

    WaitInput
    Case ((%key=2) or (%key=4)):BREAK

    If fenster&=%MWnd

        GetCursorPos(rect#)
        ScreenToClient(fenster&,rect#)
        mousex&=Long(rect#,0)
        mousey&=Long(rect#,4)
        DrawText 20,20,Str $(Int(mousex&))+, +Str $(Int(mousey&))+

    EndIf

EndWhile

Dispose rect#
End
 
08/11/05  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

3.111 Views

Untitledvor 0 min.
Thomas Freier11/21/21
Ralf Netz05/22/21
RudiB.03/15/20
Peter Max Müller10/23/17
More...

Themeninformationen

this Topic has 1 subscriber:

iF (2x)


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