Sign in to follow this  
Followers 0
star2

Flickering button

4 posts in this topic

#1 ·  Posted (edited)

this is the GUI

#include <GuiConstants.au3>

GUICreate("testing", 120, 60)
$button = GUICtrlCreateButton ("", 5 , 5, 48 , 48 , $BS_icon)
GUICtrlSetImage ($button, "shell32.dll",210,1)

GUISetState()

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            Exit
    EndSelect
    hoover()
WEnd

Func hoover()
    $a=GUIGetCursorInfo()
    If $a[4] = 3 Then
        GUICtrlSetImage ($button, "shell32.dll",20,1)
    Else
        GUICtrlSetImage ($button, "shell32.dll",210,1)
    EndIf
    If $a[2] = 1 Then
        GUICtrlSetImage ($button, "shell32.dll",25,1)
    EndIf
EndFunc

I tried but I really need a certain method for avoiding this kind of flickering

Edited by star2

[quote]Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams[/quote].............................................................................[u]AUTOIT[/u]

Share this post


Link to post
Share on other sites



#include <GuiConstants.au3>
 
 Global $state, $state_old
 
 GUICreate("testing", 120, 60)
 $button = GUICtrlCreateButton ("", 5 , 5, 48 , 48 , $BS_icon)
 GUICtrlSetImage ($button, "shell32.dll",210,1)
 GUISetState()
 
 While 1
     $msg = GUIGetMsg()
     Select
         Case $msg = $GUI_EVENT_CLOSE
             Exit
     EndSelect
     hoover()
 WEnd
 
 Func hoover()
     $a=GUIGetCursorInfo()
     If $a[4] = 3 Then
         $state = 20
     Else
         $state = 210
     EndIf
     If $a[2] = 1 Then
         $state = 25
     EndIf
 
     If $state <> $state_old Then
         GUICtrlSetImage ($button, "shell32.dll",$state,1)
         $state_old = $state
     EndIf
 EndFunc

Share this post


Link to post
Share on other sites

thank you Zedna that was great

you know I've never used this

Global

I'm gonna look for the help file now

all this time I didn't think it's important but it looks like I was wrong

thanks again


[quote]Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams[/quote].............................................................................[u]AUTOIT[/u]

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

#include <GuiConstants.au3>
 
 Global $state, $state_old
 
 $gui = GUICreate("testing", 120, 60)
 $button = GUICtrlCreateButton ("", 5 , 5, 48 , 48 , $BS_icon)
 GUICtrlSetImage ($button, "shell32.dll",210,1)
 GUISetState()
 
 While 1
     $msg = GUIGetMsg()
     Select
         Case $msg = $GUI_EVENT_CLOSE
             Exit
     EndSelect
     hoover()
 WEnd
 
 Func hoover()
     $a=GUIGetCursorInfo($gui)
     If $a[4] = 3 Then
         $state = 20
     Else
         $state = 210
     EndIf
     If $a[4] = 3 And $a[2] = 1 Then
         $state = 25
     EndIf
 
     If $state <> $state_old Then
         GUICtrlSetImage ($button, "shell32.dll",$state,1)
         $state_old = $state
     EndIf
 EndFunc

made a few fixes

Edited by star2

[quote]Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams[/quote].............................................................................[u]AUTOIT[/u]

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