Jump to content

New set of Eyes ...please


 Share

Recommended Posts

I just cant find it... probably something dumb...... and I will have to pay the price of ridicule... :mellow:

Any ways.... NO CLICKING... needed

1 Place your mouse over "Auto Click" it will turn green - On

2 Place your mouse over "Auto Move" ( no clicking) it will turn green

... you can move the GUI for 4 seconds

3 Place your mouse over "Auto Click" it will turn Blue - Off

... now comes the problem, "Auto Move" will be activated (turn green) ...why?????

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>

Global $Hover = 0, $Pause = 200

$Main = GUICreate("T-90", 330, 180, -1, -1, $WS_POPUP)
$exit = GUICtrlCreateLabel("EXIT", 295, 4, 25, 12)

$AutoClick = GUICtrlCreateLabel(" AUTO_CLICK", 99, 3, 70, 14)
GUICtrlSetBkColor(-1, 0x4876FF)
$AutoMove = GUICtrlCreateLabel(" AUTO_MOVE", 199, 3, 70, 14, -1, $GUI_WS_EX_PARENTDRAG)
GUICtrlSetBkColor(-1, 0x4876FF)
GUISetState()

While 1
    
    If $Hover Then
        Sleep($Pause * 10)
        ToolTip("")
        $inf = GUIGetCursorInfo($Main)
        $msg = $inf[4]
    Else
        $msg = GUIGetMsg()
        $inf = GUIGetCursorInfo($Main)
        If $inf[4] = $AutoClick Then $msg = $AutoClick
    EndIf
    
    Switch $msg
        Case $exit, -3
            Exit
        Case $AutoClick
            If $Hover = 0 Then
                $Hover = 1
                GUICtrlSetBkColor($AutoClick, 0x00ff00) ; Green
            Else
                $Hover = 0
                GUICtrlSetBkColor($AutoClick, 0x4876FF) ;FF0000) ; red
                Sleep(1000)
                ;ContinueLoop
            EndIf
        Case $AutoMove
            GUICtrlSetBkColor($AutoMove, 0x00ff00) ; Green
            $info = 'If MouseDown(""left"") And Sleep(' & $Pause * 20 & ') And MouseUp(""left"") = 1 Then Exit'
            RunWait(@AutoItExe & ' /AutoIt3ExecuteLine ' & '"' & $info & '"')
            GUICtrlSetBkColor($AutoMove, 0x4876FF) ;FF0000) ; red
            Sleep(1000)
    EndSwitch
    
WEnd

thx

8)

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

Hi Valuater

not the first time I've seen glitchiness from GuiGetMsg()

if I disabled a button just after pressing it, that caused problems with GuiGetMsg()

(I recall that the problem has since been fixed)

Case $AutoMove
            Opt("GUIOnEventMode", 1) 
            GUICtrlSetBkColor($AutoMove, 0x00ff00) ; Green
            $info = 'If MouseDown(""left"") And Sleep(' & $Pause * 20 & ') And MouseUp(""left"") = 1 Then Exit'
            RunWait(@AutoItExe & ' /AutoIt3ExecuteLine ' & '"' & $info & '"', @ScriptDir, @SW_HIDE)
            Opt("GUIOnEventMode", 0) 
            GUICtrlSetBkColor($AutoMove, 0x4876FF) ;FF0000) ; red
            Sleep(1000)

I see fascists...

Link to comment
Share on other sites

Hi Valuater

not the first time I've seen glitchiness from GuiGetMsg()

if I disabled a button just after pressing it, that caused problems with GuiGetMsg()

(I recall that the problem has since been fixed)

Case $AutoMove
            Opt("GUIOnEventMode", 1) 
            GUICtrlSetBkColor($AutoMove, 0x00ff00) ; Green
            $info = 'If MouseDown(""left"") And Sleep(' & $Pause * 20 & ') And MouseUp(""left"") = 1 Then Exit'
            RunWait(@AutoItExe & ' /AutoIt3ExecuteLine ' & '"' & $info & '"', @ScriptDir, @SW_HIDE)
            Opt("GUIOnEventMode", 0) 
            GUICtrlSetBkColor($AutoMove, 0x4876FF) ;FF0000) ; red
            Sleep(1000)
Cool!

Ya know, I'm not the kind guy who needs to know "why". But with this add-on you gave me, I can just move forward... Thanks

For the dev's maybe you might want to look into this...

thx

8)

NEWHeader1.png

Link to comment
Share on other sites

Cool!

Ya know, I'm not the kind guy who needs to know "why". But with this add-on you gave me, I can just move forward... Thanks

For the dev's maybe you might want to look into this...

thx

8)

no problem

turning on and off the message polling resets GuiGetMsg()

to eliminate the message bounce.

I don't know why that happens

but I have experienced it before in v3.2.8.1

Edit: poor wording corrected

Edited by rover

I see fascists...

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...