English
Forum

Mouse position, except half of the Profanprogramms find out

 

ToM
hi!

I would have time again ne question ...

The Mausposition inside the own window find out is easy, only how can I
the make, if I not even one own Window Have, I The actually Mausposition
herausfinde ?!

hope me kannwer help

mfg ToM
 
AMD Athlon 64 4500+ / 1500 MB Ram / Windows Server 2003 Enterprise / Profan 7.0
09/21/05  
 



so?
CompileMarkSeparation
DEF @GetCursorPos(1) !"USER32","GetCursorPos"
Def @ScreenToClient(2) !"USER32","ScreenToClient"
Windowstyle 31
Windowtitle "Globale Mauskoordinaten in Fensterposition umrechnen"
Window 50,75-600,350
Declare pos#

While 0=0

    Sleep 10
    DIM POS#,8
    GetCursorPos(pos#)
    Drawtext 0,0,"Global X="+@STR$(@Long(Pos#,0))+@Space$(100)
    Drawtext 0,20,"Global Y="+@STR$(@Long(Pos#,4))+@Space$(100)
    @ScreenToClient(%HWND,Pos#)
    Drawtext 0,40,"Lokal X="+@STR$(@Long(Pos#,0))+@Space$(100)
    Drawtext 0,60,"Lokal Y="+@STR$(@Long(Pos#,4))+@Space$(100)
    Dispose Pos#

Wend

 
09/21/05  
 




ToM
thanks

very the meant I
 
AMD Athlon 64 4500+ / 1500 MB Ram / Windows Server 2003 Enterprise / Profan 7.0
09/21/05  
 




ToM
hmm had another trouble

Gibts it a umgekehrte function of SetWindowPos

means that one The position one others Fensters and the Size of a others Fensters
herausfindet hm ?!

mfg tom
 
AMD Athlon 64 4500+ / 1500 MB Ram / Windows Server 2003 Enterprise / Profan 7.0
09/21/05  
 



so?
CompileMarkSeparation
Def @GetWindowRect(2) !"USER32", "GetWindowRect"
Def @ScreenToClient(2) !"USER32","ScreenToClient"
WindowTitle "Koordinaten"
Windowstyle 31+512
Window 0,0-640,440
Decimals 0
Declare b#,dlg&
LET dlg&=@Create("Window",%hwnd,"Testdialog",150,150,300,300)

Whilenot %MENUITEM=-2

    GetMessage
    Locate 1,1
    Dim b#,16
    @GetWindowRect(dlg&,b#)
    print "Eckpunkte von Testdialog bezogen auf Bildschirm:",Long(b#,0),Long(b#,4),Long(b#,8),Long(b#,12);"       "
    @ScreenToClient(%hwnd,b#)
    @ScreenToClient(%hwnd,b#+8)
    print "Eckpunkte von Testdialog bezogen auf %hwnd:",Long(b#,0),Long(b#,4),Long(b#,8),Long(b#,12);"       "
    @GetWindowRect(dlg&,b#)
    @ScreenToClient(dlg&,b#)
    @ScreenToClient(dlg&,b# + 8)
    Print ""
    PRINT "Breite des Rahmens von Testdialog: "+@STR$(@ABS(Long(b#,0))/2)+"            "
    PRINT "Höhe der Titelzeile von Testdialog ohne Rahmen: "+@STR$(@ABS(Long(b#,4))-@ABS(Long(b#,0)))+"            "
    PRINT "Breite des Clientbereiches von Testdialog: "+@STR$(Long(b#,8))+"            "
    PRINT "Höhe des Clientbereiches von Testdialog: "+@STR$(Long(b#,12))+"            "
    Dispose b#

Wend

 
09/21/05  
 




ToM
hmmm meant the so z.B.:

Window: windows Media Player
Höhe 300 / wide 400
PosX 200 / PosY 200

means that one these things herausfindet.

mfg tom
 
AMD Athlon 64 4500+ / 1500 MB Ram / Windows Server 2003 Enterprise / Profan 7.0
09/21/05  
 



the power the og code.
 
09/21/05  
 




ToM
ok habn bissl incorrect virtual, sorry

and thx fürn code and sorry I eurer forum so filling *g*

mfg tom
 
AMD Athlon 64 4500+ / 1500 MB Ram / Windows Server 2003 Enterprise / Profan 7.0
09/21/05  
 



never mind, is Yes plenty Space here .
 
09/21/05  
 




ToM
hmmm with whom oberen quellcode go now and than 1000it to put hunugefügt, means instead of z.B. 512 .. 512000

wieso hm ?!

mfg tom
 
AMD Athlon 64 4500+ / 1500 MB Ram / Windows Server 2003 Enterprise / Profan 7.0
09/21/05  
 



so too yet???
CompileMarkSeparation
Def @GetWindowRect(2) !"USER32", "GetWindowRect"
Def @ScreenToClient(2) !"USER32","ScreenToClient"
WindowTitle "Koordinaten"
Windowstyle 31+512
Window 0,0-640,440
Decimals 0
Declare b#,dlg&
LET dlg&=@Create("Window",%hwnd,"Testdialog",150,150,300,300)

Whilenot %MENUITEM=-2

    GetMessage
    Locate 1,1
    Dim b#,16
    @GetWindowRect(dlg&,b#)
    print "Eckpunkte von Testdialog bezogen auf Bildschirm:"+@STR$(Long(b#,0))+" "+@Str$(Long(b#,4))+" "+@Str$(Long(b#,8))+" "+@str$(Long(b#,12))+"                  "
    @ScreenToClient(%hwnd,b#)
    @ScreenToClient(%hwnd,b#+8)
    print "Eckpunkte von Testdialog bezogen auf %hwnd:"+@str$(Long(b#,0))+" "+@Str$(Long(b#,4))+" "+@Str$(Long(b#,8))+" "+@Str$(Long(b#,12))+"              "
    @GetWindowRect(dlg&,b#)
    @ScreenToClient(dlg&,b#)
    @ScreenToClient(dlg&,b# + 8)
    Print ""
    PRINT "Breite des Rahmens von Testdialog: "+@STR$(@ABS(Long(b#,0))/2)+"            "
    PRINT "Höhe der Titelzeile von Testdialog ohne Rahmen: "+@STR$(@ABS(Long(b#,4))-@ABS(Long(b#,0)))+"            "
    PRINT "Breite des Clientbereiches von Testdialog: "+@STR$(Long(b#,8))+"            "
    PRINT "Höhe des Clientbereiches von Testdialog: "+@STR$(Long(b#,12))+"            "
    Dispose b#

Wend

 
09/21/05  
 



so too yet? which Profanversion???
CompileMarkSeparation
DEF @GetCursorPos(1) !"USER32","GetCursorPos"
Def @ScreenToClient(2) !"USER32","ScreenToClient"
Windowstyle 31
Windowtitle "Globale Mauskoordinaten in Fensterposition umrechnen"
Window 50,75-600,350
Declare pos#

While 0=0

    Sleep 10
    DIM POS#,8
    GetCursorPos(pos#)
    Drawtext 0,0,"Global X="+@STR$(@Long(Pos#,0))+"                    "
    Drawtext 0,20,"Global Y="+@STR$(@Long(Pos#,4))+"                    "
    @ScreenToClient(%HWND,Pos#)
    Drawtext 0,40,"Lokal X="+@STR$(@Long(Pos#,0))+"                      "
    Drawtext 0,60,"Lokal Y="+@STR$(@Long(Pos#,4))+"                       "
    Dispose Pos#

Wend

 
09/21/05  
 




Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

2.374 Views

Untitledvor 0 min.
Sven Bader08/17/21
Untitled05/11/12
Julian Schmidt06/07/11

Themeninformationen

this Topic has 3 subscriber:

ToM (10x)
unbekannt (7x)
iF (1x)


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