Sign in to follow this  
Followers 0
eagle4life69

GUIGetCursorInfo()

15 posts in this topic

So I am trying to use GUIGetCursorInfo() But All I get is 0 Shouldn't it be something else. What would cause this. How Do I check for an error to see why it sees a 0

If you need the Entire code Let me know But it just isn't working

I am trying to make my own slider and the script I used before isn't allowing this into the new Script

Share this post


Link to post
Share on other sites



$aArray = GUIGetCursorInfo()
If IsArray($aArray) = 0 Then MsgBox(16, "Error", "An Array wasn't returned")


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.

Share this post


Link to post
Share on other sites

But why would the cursor info com back with a 0?

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

But why would the cursor info com back with a 0?

wtf are you talking about?

Return Value

Failure: 0 and set @error to 1

Edited by SmOke_N

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.

Share this post


Link to post
Share on other sites

When I Use GUIGetCursorInfo() And use a tooltip to tell me if the array is there IE 0 & 1 All I see is 0 I should see a 1

Share this post


Link to post
Share on other sites

When I Use GUIGetCursorInfo() And use a tooltip to tell me if the array is there IE 0 & 1 All I see is 0 I should see a 1

If you bother to open the help file and read... you'll see the return is 0 for a "hard value" or the return is an array, since I doubt very seriously you're even bothering to check for an array, the return would always be 0 or blank.

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.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Here is my Full Code though it is messy and I haven't Cleaned up the spot's I am working on.

I read the Help File it is open all the time.

test.au3

Edited by eagle4life69

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Here is my Full Code though it is messy and I haven't Cleaned up the spot's I am working on.

I read the Help File it is open all the time.

You can't really think anyone is going to go through 650 lines of code for you (if they do they are an idiot).

Make a recreation script (50 lines or smaller) that replicates the error you are getting.

Other than that, I've told you the return values, and how to check them.

Edit:

Although:

"Inside The Magic" is not a Window "Handle" as GUIGetCursorInfo() requires... and are you trying to find where the cursor is in a GUI other than an AutoIt gui?

Edited by SmOke_N

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.

Share this post


Link to post
Share on other sites

Here is the Code I am using

#301419

I am trying to make a simple Ball and Bar as my volume Slider.

I have squeezed that code into the Script I put above and it doesn't work. I could Rewrite the Entire thing but the script above works fine it is just the Volume slider using 2 pictures.

Smoke I notice some of your other Post within the last few Minutes are Negative (and not just to me). I hope your Day/Night is better and if Something is bugging you I am sorry. I am trying I have been stuck on this 1 problem for 3 days and just wanted to change the way the very basic volume slider looks

Share this post


Link to post
Share on other sites

Smoke I notice some of your other Post within the last few Minutes are Negative (and not just to me). I hope your Day/Night is better and if Something is bugging you I am sorry. I am trying I have been stuck on this 1 problem for 3 days and just wanted to change the way the very basic volume slider looks

I'm only negative when people take things for granted.

Check the edit I made above... I personally am not going through 640 lines of code... but the last few lines, I did see the error I stated above.


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.

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

I love AutoIt it has saved me so many times. I did see that the Inside the Magic was not the Gui I was using. I understand the issue with going through the Huge Code Sorry. Saying that. Changing the Gui into IE "Inside The Magic" to "SubsonicRadio.com" does not change the fact that it isn't working. What would cause the Curse info not to work right. Could it be something I have done in the Beginning that does show the cursor info just right?.

Edited by eagle4life69

Share this post


Link to post
Share on other sites

I love AutoIt it has saved me so many times. I did see that the Inside the Magic was not the Gui I was using. I understand the issue with going through the Huge Code Sorry. Saying that. Changing the Gui into IE "Inside The Magic" to "SubsonicRadio.com" does not change the fact that it isn't working. What would cause the Curse info not to work right. Could it be something I have done in the Beginning that does show the cursor info just right?.

Again... Before you respond... (I'm bad about it myself) read what I wrote.

You CANNOT use a Window "Title" for GUIGetCursorInfo(). It must be a "Handle".


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.

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

While $msg3[2] = 1
            Sleep(10)
            Select
                Case ($msg3[0] - $offset) < 265
                    GUICtrlSetPos($ball,265,110)
                    $pos = 260
                Case ($msg3[0] - $offset) > 365
                    GUICtrlSetPos($ball,365,110)
                    $pos = 360
                Case Else
                    If $pos Then
                        $v = $pos-270
                    $oMediaPlaySettings.Volume = $v
                    EndIf
                    ;Tooltip($pos)
                    GUICtrlSetPos($ball,($msg3[0]-$offset),110)
                    $pos = $msg3[0]-$offset
            EndSelect
            ;$msg3 = GUIGetCursorInfo("Inside The Magic")
        WEnd
        $aCursor = GUIGetCursorInfo("THERE MUST BE A WINDOW HANDLE HERE")
        If IsArray($aCursor) Then
            ;If $aCursor[0] = whatever
            ;If $aCursor[1] = whatever
            ;etc....
            ;There must be a condition
        EndIf

Edited by SmOke_N

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.

Share this post


Link to post
Share on other sites

What Smoke_N is trying to say is this:

$a_CurPos = GUIGetCursorInfo(WinGetHandle ( "title" ))oÝ÷ Øíá#¬r·µçb«­¢+r¢ì(ºW]¢Øb±«­¢+ØÀÌØí!}5¥¹U%!¹±ôU%
ÉÑ ¤)U%MÑMÑÑ ¤((ÀÌØí}
ÕÉA½ÌôU%Ñ
ÕÉͽÉ%¹¼ ÀÌØí!}5¥¹U%!¹±¤

This is psuedo code, you acutally have to have the function parameters filled out for this to work.

- The Kandie Man ;-)


"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

Share this post


Link to post
Share on other sites

Well After looking into that It all works and Makes since. I guess I was just lucky that my other script that was set wrong worked. Thanks for your help and I am sorry for being a pain. Thanks again

Share this post


Link to post
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
Sign in to follow this  
Followers 0