English
Forum

Click simulate

 
- Page 1 -



Timotheus
Hi,

I have a problem. i want at a designed place in the program Window a EditBox create. The y-Koordinate becomes by the Click select, and the x-k. is 0.
in this Edit-Box can but already one Text stand. therefore must I the Click once more repeat, once the Edit created watts. therefore setting itself the Cursor in the Edit very on The right place, How in a MultiEdit. How do I do the ?

Timo
 
09/11/04  
 



 
- Page 1 -



Michael
Dell
Sorry, small mistake!

Versuchs time herewith, it setting whom Cursor on whom beginning:
CompileMarkSeparation
Salu Michael...

Hab zwar krumme Fieß awer dofir e' ecklich Gsicht! 
09/11/04  
 




Timotheus
not integrally, if to that example The mouse something moreover lane of left Fensterrand pressed becomes, then must the Schreibbalken on z.B. the second place stand. concise and simply: How can I a Click at a designed place simulate?

Timo
 
09/12/04  
 




Michael
Dell
OK, then time so:
CompileMarkSeparation
Def GSC(1)           !User32.dll,GetSysColor
Def ButtonUp(1)      Equ(If(Equ(%Lastmessage,514),1,If(Equ(%Lastmessage,512),SetFocus(&(1)),0)),1)
Def SetCurPosNull(1) SendKey(@&(1),36)  Setzt den Cursor an erste Stelle
Def SetCurPosEnd(1)  SendKey(@&(1),35)  Setzt den Cursor an letzte Stelle

Proc SetCurPos                          Setzt den Cursor an beliebige Stelle

    Parameters hndl&,anz&
    Case Lt(anz&,1)
    SendKey(hndl&,36)

    WhileLoop 1,@&(2),1

        SendKey(hndl&,39)

    EndWhile

EndProc

declare bt01&,ed01&,edak%
Clear bt01&,ed01&,edak%

Proc MakeED

    Parameters HWHndl&,Text$,x%,y%,b%,h%

    If Equ(edak%,0)                                    wenn Edit-Control nicht existent dann...

        ed01& = create(Edit,HWHndl&,Text$,x%,y%,b%,h%)  Erzweuge Edit-Control mit Text inhalt
        SetFocus(ed01&)                                  Setze Focus auf Edit-Control
        SetCurPos(ed01&,8)                              Setzt den Cursor an Stelle 8
        Sleep 1000
        SetCurPos(ed01&,6)                              Setzt den Cursor an Stelle 6
        Sleep 1000
        SetCurPos(ed01&,4)                              Setzt den Cursor an Stelle 4
        Sleep 1000
        SetCurPos(ed01&,2)                              Setzt den Cursor an Stelle 2
        Sleep 1000
        SetCurPosNull(ed01&)                            Setzt den Cursor an erste Stelle
        Sleep 1000
        SetCurPosEnd(ed01&)                             Setzt den Cursor an letzte Stelle
        Sleep 1000
        SetCurPosNull(ed01&)                            Setzt den Cursor an erste Stelle
        Sleep 1000

    EndIf

    Return 1

EndProc

SetTrueColor 1
WindowStyle 26
Window Add(%maxX,10),0-500,66
Cls GSC(15)
bt01& = create(Button,%HWnd,Erstelle Edit,360,10,120,22)
Window 0,0-500,66

WhileNot Or(Equ(%MenuItem,-2),Equ(%MenuItem,-4000))

    GetMessage

    If GetFocus(bt01&)

        If ButtonUp(%HWnd)

            edak% = MakeED(%HWnd,Hallolo, na wie gethts?,10,10,340,22)
            Case edak%: SetFocus(ed01&)

        EndIf

    EndIf

EndWhi
End

Michael...

P.s.: Have I everything in the Profan- Help nachgeschlagen!
 
Salu Michael...

Hab zwar krumme Fieß awer dofir e' ecklich Gsicht! 
09/12/04  
 




Timotheus
No the neither!

here time one demonstration:
CompileMarkSeparation
here missing only The Def or Proc SimuliereMausklick. in this example is the Schreibbalken by the wiederholte clicking on the right place. this is How if one into vorhandenes Edit clicking, then setting itself the beam indeed automatically on The place The in the Edit klicked watts.

Timo
 
09/12/04  
 



so?
CompileMarkSeparation
cls
declare x%,a&,b&

while 1

    waitinput

    if %Mousekey = 1

        x% = %Mousex
        a& = Create(Edit,%Hwnd,Hallo,0,%Mousey - 12,600,25)
        @SENDMESSAGE(a&,$00B1,0,256)
        @SETFOCUS(A&)
        Sleep 1000
        destroyWindow(a&)

    endif

wend


or so??
CompileMarkSeparation
DEF @mouse_event(5)!User32,mouse_event
CLS
declare x%,a&,b&

while 1

    Waitinput

    if %Mousekey = 1

        x% = %Mousex
        a& = Create(Edit,%Hwnd,Hello,0,%Mousey - 12,600,25)
        @mouse_event(2,x%,%MOUSEY,0,0)
        @mouse_event(4,x%,%MOUSEY,0,0)
        @mouse_event(2,x%,%MOUSEY,0,0)
        @mouse_event(4,x%,%MOUSEY,0,0)
        Sleep 1000
        destroyWindow(a&)

    endif

wend

 
09/12/04  
 




Dietmar
Horn
yet as appendix (to response of Andreas)

DEF @mouse_event(5)!User32,mouse_event

mouse_event(n,dx%,dy%,0,0)

=> resolve a artificial Mausbewegung and a Click from.
=> has none Return Value

n: gives on, which Mouse button pressed (simulate) go should

n = $1 - Double click simulate
n = $2 - left Mouse button runterdrücken
n = $4 - left Mouse button release
n = $8 - rights Mouse button runterdrücken
n = $10 - rights Mouse button release
n = $20 - mittlere Mouse button runterdrücken (if present)
n = $40 - mittlere Mouse button release (if present)

dx% = x-Koordinate the Mausposition (or its Änderung, where tappt im dunkeln from the derzeitigen position from seen, hingesetzt go should)
dy% = y-Koordinate the Mausposition (or its ...)

The 4. and 5. Parameter having no weight, therefore means each on 0 settle.

possible must You another slightly with the Mouse-Coordinates experiment, white not, whether these relatively or utterly are, whether related on the Desktop, the Mainwindow, or the Dialog-Window. try thereby too time $8000 with whom Values for n To add, means n = $8000 + $2, or n = $2 settle. $8000 = MOUSEEVENTF_ABSOLUTE

Greeting
Dietmar
 
Multimedia für Jugendliche und junge Erwachsene - MMJ Hoyerswerda e.V.  [...] 

Windows 95 bis Windows 7
Profan² 6.6 bis XProfan X2 mit XPSE

Das große XProfan-Lehrbuch:  [...] 
09/12/04  
 




Timotheus
thanks

Timo
 
09/12/04  
 




Uwe
''Pascal''
Niemeier
Hello people!

Gibts because The API mouse_event  XP/NT at all yet?
Quote of MSDN:


The mouse_event function synthesizes mouse motion and button clicks.
windows NT: Diese function has been superseded. Use SendInput instead.


SeeYou
Pascal
 
09/13/04  
 




Michael
Dell
Microsoft wished mouse_event already former supplant, the standing anyway so in the WinHlp no Win32s. I denk from Supportgründen functions it in the momentum yet, one ought to well in future hereon dispense. In Longhorn Better get going well not any more weg.

Michael...
 
Salu Michael...

Hab zwar krumme Fieß awer dofir e' ecklich Gsicht! 
09/13/04  
 



 
- Page 2 -



Michael
Dell
here the whole without mouse_event:
CompileMarkSeparation
Declare a&,x&,y&,Fontx&,EDminX&
FontX&  = 8                                                 Font- Breite
EDminX& = 10                                                Edit- Control Startpunkt (X min)
Def SetCurMark(2) sendmessage(@&(1),$00B1,@&(2),0)          Setzt Markierung

Proc SetCurPos                                              Setzt den Cursor an beliebige Stelle

    Parameters hndl&,anz&
    SetFocus(hndl&)
    SendKey(hndl&,36)
    Case Lt(anz&,1): Return

    WhileLoop 1,@&(2),1

        SendKey(hndl&,39)

    EndWhile

EndProc

Proc CalkCurPos

    Parameters EDhndl&
    Declare p1&,p2&

    If Gt(x&,Add(EDminX&,Mul(Len(GetText$(EDhndl&)),FontX&)))  Mauszeiger hinter Textende

        p1& = Len(GetText$(EDhndl&))

    ElseIf Gt(x&,EDminX&)                                     Mauszeiger im Text

        p1& = Int(Div(Sub(x&,EDminX&),FontX&))
        Else                                                      Mauszeiger vor Text
        p1& = 0

    EndIf

    SetCurPos(EDhndl&,p1&)                                    Setzt den Cursor auf Mausposition
    SetCurMark(EDhndl&,p1&)                                   Setzt Markierung 0 bis Mausposition

EndProc

CLS
UseFont Arial,16,FontX&,1,0,0
SetDialogFont 1

while 1

    Waitinput

    if %Mousekey = 1

        x& = %Mousex
        y& = %Mousey
        a& = Create(Edit,%Hwnd,Hallolo, na wie geht`s den so?,EDminX&,y& - 12,600,25)
        CalkCurPos(a&)
        Sleep 2000
        destroyWindow(a&)

    endif

wend

SetDialogFont 0
s4 href='./../../Function-References/XProfan/end/'>End

only in order to sehn the it too in reinem Profan goes.

Michael...
 
Salu Michael...

Hab zwar krumme Fieß awer dofir e' ecklich Gsicht! 
09/14/04  
 



Hello Michael...

completely correctly.!! The Message standing already in my first View source one little moreover supra as alternative To MOUSE_EVENT. but it wished so absolutely a Double click.
I sags Yes - quite unideal and unübersichtlich, if one whom View source not immediate sees...
 
09/14/04  
 



Jaja OK AH, I habs Yes understood.

I überleg me already what....

iF
 
09/14/04  
 




Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

5.635 Views

Untitledvor 0 min.
Sven Bader07/04/23
H.Brill02/06/22
AndreasS11/29/18
RICOSCH06/17/16
More...

Themeninformationen



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