Jump to content

Guigetcursorinfo() Do Not Read The Cursor Coordinate


Recommended Posts

Hello forum,

In detail:

The cursor is flashing, after activate the entry field, on the end of the text. After pick up this Cursor coordinates I let jumping the cursor to the start of this entry field. A difference of these two x-coordinates reports an available text for further action.

Ready in the theory :(

However, in the practice the difference result always remains 0 (= no text) even if the whole field is filled and so that the maximum difference should come out :)

The function with MouseGetCursor() is analysed with MsgBox'en; I have already tried it with previous GUISetCursor() to this field and analyses what was calculated for now, then.

MouseGetCursor() always has NO calculated difference, even with built-in breaks and mouse moved at it. It responds to different mouse cursor forms, what suggests the suspicion that the function GUIGetCursorInfo() orientates itself at the mouse but not at the cursor.

If anybody has a better idea how this entry field can detected if text is present or not, let me know. Thank you for checking my Problem in advance :-)

;GUIGetCursorInfo() - test
Do
WinWaitActive("Registrierungs-Editor","Arbeitsplatz")
Send("{ENTER}")
WinWaitActive("Zeichenfolge bearbeiten","Abbrechen")
GUISetCursor(1001, 1, "")
    $cursor = MouseGetCursor()
    $a=GUIGetCursorInfo()
    Send("{HOME}")
    Sleep(1000)
    $b=GUIGetCursorInfo ()
        If $a[0] - $b[0] = 0 Then
        MsgBox(4096, "", "Cursor x 1/2:  " & $a[0] & "/" & $b[0] & "/" & $cursor & "")
        ExitLoop
        ElseIf $a[0] - $b[0] <> 0 Then
        MsgBox(4096, "", "Cursor x<>" & $a[0] & "/" & $b[0] & "")
        EndIf
;weiterer Code...
Until WinExists("Registrierungs-Editor","Arbeitsplatz")

KnALLE, new here and this problem nowhere finding.

(Code written an tested with the actual XP Tablet PC- Edition)

Link to comment
Share on other sites

  • Moderators

Since your using GUISetCursor and GUIGetCursorInfo, are using this in your "own" GUI, or are you trying to use it in another applications window? (I ask, because you didn't provide a GUI to look at).

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Thank's SmOke_N

right, I don't create my own 'Grafic User Interface' in the whole script. And I use the GUISetCursor() only for troubleshooting to be sure that it points in this entry field.

By the way its a Value field in the regestry which I'm interesting for. Mark such an Key and your result should be the same:

Cursor x 1/2: 0/0/5

Where /5 depends on the position of the mouse Pointer. 2 = arrow from MouseGetCursor(), which is definitely not this cursor in the entry field; therefore 5 = ibeam is the expected number. That's the point in my eyes. Or the problem is sitting, before the screen :)

So long,

KnALLE

Edited by KnALLE
Link to comment
Share on other sites

problem solved with

WinGetCaretPos()

All I have to do is to replace Guigetcursorinfo() with WinGetCaretPos() an this part of the script is working as expected.

As the first sentence of the reference described, I found myself, that the GUIGetCursorInfo funktion is only for the coordinates of the mouse cursor.

Or as we say in Germany when you can read the manual, you are clearly in advantage.

--> A related link to each other might be helpful :)

· Anyway a very usefull program for amateurs as well as for IT-specialists, with top organized help and reference windows. IMO has the C++ GUI in the Software- departement of my last job not this inviting touch as the SciTE for AutoIt.

Till next trouble, but after reading the manual carefully ;-)

KnALLE, pleased only test and work with new software from this 'very special' departement ;-)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...