Jump to content

Changing mouse cursor on Winactive


Lambort
 Share

Recommended Posts

Is there any way to change the mouse cursor when a specified window is active? This window is not made in autoit, it is actually a full screen game. Any ideas?

Also, is there any way to change the background color/font color/size of a tooltip?

Link to comment
Share on other sites

Is there any way to change the mouse cursor when a specified window is active? This window is not made in autoit, it is actually a full screen game. Any ideas?

Also, is there any way to change the background color/font color/size of a tooltip?

There is a ToolTip module in Auto3Lib that allows you to manipulate tooltips. In the ToolTip demo, I have some code that shows how to change the tooltip in a external application.

As for cursors, you might want to take a look at this MSDN site that gives you all of the API calls for cursors. There are a few of these in Auto3Lib as well.

Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
Share on other sites

Is there any way to change the mouse cursor when a specified window is active? This window is not made in autoit, it is actually a full screen game. Any ideas?

yes,

#include <GUIConstants.au3>

Local $active = 0, $begin = TimerInit()

GUICreate("game")
GUISetState()

While 1
    If GUIGetMsg() = -3 Then Exit
    
    If WinActive("game") And Not $active Then
        $active = 1
        GUISetCursor(15)
    ElseIf Not WinActive("game") And $active Then
        $active = Not $active
        GUISetCursor(9)
    EndIf

    $dif = TimerDiff($begin)
    If $dif > 5000 And $active Then WinSetTitle("game", "", "my gui")
    
WEnd

8)

NEWHeader1.png

Link to comment
Share on other sites

There is a ToolTip module in Auto3Lib that allows you to manipulate tooltips. In the ToolTip demo, I have some code that shows how to change the tooltip in a external application.

As for cursors, you might want to take a look at this MSDN site that gives you all of the API calls for cursors. There are a few of these in Auto3Lib as well.

Can you post this code that shows how to change the tooltip in an external application?

yes,

#include <GUIConstants.au3>

Local $active = 0, $begin = TimerInit()

GUICreate("game")
GUISetState()

While 1
    If GUIGetMsg() = -3 Then Exit
    
    If WinActive("game") And Not $active Then
        $active = 1
        GUISetCursor(15)
    ElseIf Not WinActive("game") And $active Then
        $active = Not $active
        GUISetCursor(9)
    EndIf

    $dif = TimerDiff($begin)
    If $dif > 5000 And $active Then WinSetTitle("game", "", "my gui")
    
WEnd

8)

As for this. Thanks, but I really can't figure out how to get it to work. It seems that it only changes the cursor for the GUI it creates. I suck, I know, But I'm trying to learn ;)
Link to comment
Share on other sites

Can you post this code that shows how to change the tooltip in an external application?

Uh... no.

I suck, I know, But I'm trying to learn

The first thing you need to learn is to do a little bit of the work yourself. Asking me to post code so you don't have to download a file is just ;) lazy. Edited by PaulIA
Auto3Lib: A library of over 1200 functions for AutoIt
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...