Jump to content

Display A Message In Status When A Button Is Hovered Over


Recommended Posts

hi, how do i get this to display a message in the statusbar when i hover over a button?

#include <GUIConstants.au3>
$Form2 = GUICreate("Blash", 716, 561, 155, 134, BitOR($WS_MAXIMIZEBOX,$WS_SIZEBOX,$WS_THICKFRAME,$WS_OVERLAPPEDWINDOW,$WS_TILEDWINDOW,$WS_TABSTOP))
$status= GUICtrlCreateLabel("Welcome to Blash", 24, 528, 651, 17)
$Button1 = GUICtrlCreateButton("Notepad", 48, 88, 89, 41)
$Button2 = GUICtrlCreateButton("MSpaint", 152, 88, 89, 41)
$Button3 = GUICtrlCreateButton("Regedit", 256, 88, 89, 41)
$Button4 = GUICtrlCreateButton("The Gimp", 360, 88, 89, 41)
$Button5 = GUICtrlCreateButton("My Computer", 360, 152, 89, 41)
$Button6 = GUICtrlCreateButton("AButton1", 464, 88, 89, 41)
$Button7 = GUICtrlCreateButton("AButton1", 48, 152, 89, 41)
$Button8 = GUICtrlCreateButton("AButton1", 152, 152, 89, 41)
$Button9 = GUICtrlCreateButton("AButton1", 256, 152, 89, 41)
$Button10 = GUICtrlCreateButton("AButton1", 464, 152, 89, 41)
$Button11 = GUICtrlCreateButton("AButton1", 576, 88, 89, 41)
$Button12 = GUICtrlCreateButton("AButton1", 576, 152, 89, 41)
GUISetState(@SW_SHOW)
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $Button1 
    GUICtrlSetData($status,"Open Notepad, for text editing.")
    Case $msg = $Button2
    GUICtrlSetData($status,"Open MSPaint, for basic photo editing.")    
    Case $msg = $Button3
    GUICtrlSetData($status,"Open Regedit, for regestry editing.")
    Case $msg = $Button4 
    GUICtrlSetData($status,"Open The Gimp, for Photo manipulation, and editing.")   
    Case $msg = $Button5 
    GUICtrlSetData($status,"Open My Computer, for no particular reason.")
    Case $msg = $Button6 
    GUICtrlSetData($status,"Nothing yet")
    Case $msg = $Button7 
    GUICtrlSetData($status,"Nothing yet")
    Case $msg = $Button8 
    GUICtrlSetData($status,"Nothing yet")
    Case $msg = $Button9 
    GUICtrlSetData($status,"Nothing yet")
    Case $msg = $Button10 
    GUICtrlSetData($status,"Nothing yet")
    Case $msg = $Button11
    GUICtrlSetData($status,"Nothing yet")
    Case $msg = $Button12
    GUICtrlSetData($status,"Nothing yet")
    Case Else
    ;;;;;;;
    EndSelect
WEnd
Exit
Edited by slightly_abnormal
Link to comment
Share on other sites

You could create a function that checks for the mousecords.

Like _IsMouseIn(xLeft,yLeftTop,xRight,yRightBottom)

That Funcs checks if x => xLeft, x <= xRight & y => yLeftTop & <= yLeftBottom

then it could return 1/0

if thatds done just put some _IsMouseIN(cords) in a loop to check where the mouse is.

Don't know if this is the fastest/best/or even a good solution, but atleast it is one.

Link to comment
Share on other sites

  • Moderators

Here this seemed to work:

#include <GUIConstants.au3>
Global $Hovered = 0
Local $Focus[13], $Button[13]
For $i = 1 To 12
    $Focus[$i] = 'Button' & $i
Next
Local $SetStatus[13] = ['', "Open Notepad, for text editing.", "Open MSPaint, for basic photo editing.", "Open Regedit, for regestry editing.", _
"Open The Gimp, for Photo manipulation, and editing.", "Open My Computer, for no particular reason.", "Nothing yet", "Nothing yet", "Nothing yet", _
"Nothing yet", "Nothing yet", "Nothing yet", "Nothing yet"]
$Form2 = GUICreate("Blash", 716, 561, 155, 134, BitOR($WS_MAXIMIZEBOX,$WS_SIZEBOX,$WS_THICKFRAME,$WS_OVERLAPPEDWINDOW,$WS_TILEDWINDOW,$WS_TABSTOP))
$status= GUICtrlCreateLabel("Welcome to Blash", 24, 528, 651, 17)
$Button[1] = GUICtrlCreateButton("Notepad", 48, 88, 89, 41)
$Button[2] = GUICtrlCreateButton("MSpaint", 152, 88, 89, 41)
$Button[3] = GUICtrlCreateButton("Regedit", 256, 88, 89, 41)
$Button[4] = GUICtrlCreateButton("The Gimp", 360, 88, 89, 41)
$Button[5] = GUICtrlCreateButton("My Computer", 360, 152, 89, 41)
$Button[6] = GUICtrlCreateButton("AButton1", 464, 88, 89, 41)
$Button[7] = GUICtrlCreateButton("AButton1", 48, 152, 89, 41)
$Button[8] = GUICtrlCreateButton("AButton1", 152, 152, 89, 41)
$Button[9] = GUICtrlCreateButton("AButton1", 256, 152, 89, 41)
$Button[10] = GUICtrlCreateButton("AButton1", 464, 152, 89, 41)
$Button[11] = GUICtrlCreateButton("AButton1", 576, 88, 89, 41)
$Button[12] = GUICtrlCreateButton("AButton1", 576, 152, 89, 41)
GUISetState(@SW_SHOW)
While 1
    $msg = GuiGetMsg()
    _ChangeStatus($Form2, $Button, $Focus, $status, $SetStatus)
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $Button[1]
    Case $msg = $Button[2]   
    Case $msg = $Button[3]
    Case $msg = $Button[4]  
    Case $msg = $Button[5]
    Case $msg = $Button[6]
    Case $msg = $Button[7]
    Case $msg = $Button[8]
    Case $msg = $Button[9]
    Case $msg = $Button[10]
    Case $msg = $Button[11]
    Case $msg = $Button[12]
    Case Else
   ;;;;;;;
    EndSelect
WEnd
Exit
Func _ChangeStatus($Hwnd_GUI, $Hwnd_CTRLID, $v_ClassNameNN, $Hwnd_StatusID, $v_SetStatus)
    $OptMCoord = Opt('MouseCoordMode', 2)
    Local $Mpos = MouseGetPos()
    For $x = 1 To 12
        $Cpos = ControlGetPos($Hwnd_GUI, '',$Hwnd_CTRLID[$x])
        If $Mpos[0] >= $Cpos[0] And $Mpos[0] <= $Cpos[0] + $Cpos[2] And $Mpos[1] >= $Cpos[1] And $Mpos[1] <= $Cpos[1] + $Cpos[3] And $Hovered <> $x Then
            ControlFocus($Hwnd_GUI, '', $v_ClassNameNN[$x])
            GUICtrlSetData($Hwnd_StatusID, $v_SetStatus[$x])
            $Hovered = $x
            Opt('MouseCoordMode', $OptMCoord)
            Return 1
        EndIf
    Next
    Opt('MouseCoordMode', $OptMCoord)
    Return 0
EndFunc

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

thanks smoken!!.. :( been trying to get it to reset back to to the default message "Welcome to Blash" when the buttons aren't hovered.. so far it just blinks the message now.. :think:

#include <GUIConstants.au3>
Global $Hovered = 0
Local $Focus[13], $Button[13]
For $i = 1 To 12
    $Focus[$i] = 'Button' & $i
Next
Local $SetStatus[13] = ['', "Open Notepad, for text editing.", "Open MSPaint, for basic photo editing.", "Open Regedit, for regestry editing.", _
"Open The Gimp, for Photo manipulation, and editing.", "Open My Computer, for no particular reason.", "Nothing yet", "Nothing yet", "Nothing yet", _
"Nothing yet", "Nothing yet", "Nothing yet", "Nothing yet"]
$Form2 = GUICreate("Blash", 716, 561, 155, 134, BitOR($WS_MAXIMIZEBOX,$WS_SIZEBOX,$WS_THICKFRAME,$WS_OVERLAPPEDWINDOW,$WS_TILEDWINDOW,$WS_TABSTOP))
$status= GUICtrlCreateLabel("Welcome to Blash", 24, 528, 651, 17)
$Button[1] = GUICtrlCreateButton("Notepad", 48, 88, 89, 41)
$Button[2] = GUICtrlCreateButton("MSpaint", 152, 88, 89, 41)
$Button[3] = GUICtrlCreateButton("Regedit", 256, 88, 89, 41)
$Button[4] = GUICtrlCreateButton("The Gimp", 360, 88, 89, 41)
$Button[5] = GUICtrlCreateButton("My Computer", 360, 152, 89, 41)
$Button[6] = GUICtrlCreateButton("AButton1", 464, 88, 89, 41)
$Button[7] = GUICtrlCreateButton("AButton1", 48, 152, 89, 41)
$Button[8] = GUICtrlCreateButton("AButton1", 152, 152, 89, 41)
$Button[9] = GUICtrlCreateButton("AButton1", 256, 152, 89, 41)
$Button[10] = GUICtrlCreateButton("AButton1", 464, 152, 89, 41)
$Button[11] = GUICtrlCreateButton("AButton1", 576, 88, 89, 41)
$Button[12] = GUICtrlCreateButton("AButton1", 576, 152, 89, 41)
GUISetState(@SW_SHOW)
While 1
    $msg = GuiGetMsg()
    _ChangeStatus($Form2, $Button, $Focus, $status, $SetStatus)
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $Button[1]
    Case $msg = $Button[2]  
    Case $msg = $Button[3]
    Case $msg = $Button[4]  
    Case $msg = $Button[5]
    Case $msg = $Button[6]
    Case $msg = $Button[7]
    Case $msg = $Button[8]
    Case $msg = $Button[9]
    Case $msg = $Button[10]
    Case $msg = $Button[11]
    Case $msg = $Button[12]
    Case Else
  ;;;;;;;
    EndSelect
WEnd
Exit
Func _ChangeStatus($Hwnd_GUI, $Hwnd_CTRLID, $v_ClassNameNN, $Hwnd_StatusID, $v_SetStatus)
    $OptMCoord = Opt('MouseCoordMode', 2)
    Local $Mpos = MouseGetPos()
    For $x = 1 To 12
        $Cpos = ControlGetPos($Hwnd_GUI, '',$Hwnd_CTRLID[$x])
        If $Mpos[0] >= $Cpos[0] And $Mpos[0] <= $Cpos[0] + $Cpos[2] And $Mpos[1] >= $Cpos[1] And $Mpos[1] <= $Cpos[1] + $Cpos[3] And $Hovered <> $x Then
            ControlFocus($Hwnd_GUI, '', $v_ClassNameNN[$x])
            GUICtrlSetData($Hwnd_StatusID, $v_SetStatus[$x])
            $Hovered = $x
            Opt('MouseCoordMode', $OptMCoord)
            Return 1
            Else;<--- added to reset when no button is hovered
            GUICtrlSetData($status,"Welcome to Blash");<---
        EndIf
    Next
    Opt('MouseCoordMode', $OptMCoord)
    Return 0
EndFunc
Link to comment
Share on other sites

  • Moderators

I guess you could store all the x and y positions of the controls ahead of time if you are not going to change positions of them, and then you could do another true if statement.

The reason it keeps flashing, is it's going through 12 loops, and it's changing at least 11 times each loop it takes in that function.

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

maybe

button #1 and #2 only... you can finish it

#include <GUIConstants.au3>

HotkeySet("{Esc}", "GetPos"); use to get control info **************************


Global $Hovered = 0
Local $Focus[13], $Button[13]
For $i = 1 To 12
    $Focus[$i] = 'Button' & $i
Next
Local $SetStatus[13] = ['', "Open Notepad, for text editing.", "Open MSPaint, for basic photo editing.", "Open Regedit, for regestry editing.", _
"Open The Gimp, for Photo manipulation, and editing.", "Open My Computer, for no particular reason.", "Nothing yet", "Nothing yet", "Nothing yet", _
"Nothing yet", "Nothing yet", "Nothing yet", "Nothing yet"]
$Form2 = GUICreate("Blash", 716, 561, 155, 134, BitOR($WS_MAXIMIZEBOX,$WS_SIZEBOX,$WS_THICKFRAME,$WS_OVERLAPPEDWINDOW,$WS_TILEDWINDOW,$WS_TABSTOP))
$status= GUICtrlCreateLabel("Welcome to Blash", 24, 528, 651, 17, $SS_SUNKEN + $SS_CENTER)
$Button[1] = GUICtrlCreateButton("Notepad", 48, 88, 89, 41)
$Button[2] = GUICtrlCreateButton("MSpaint", 152, 88, 89, 41)
$Button[3] = GUICtrlCreateButton("Regedit", 256, 88, 89, 41)
$Button[4] = GUICtrlCreateButton("The Gimp", 360, 88, 89, 41)
$Button[5] = GUICtrlCreateButton("My Computer", 360, 152, 89, 41)
$Button[6] = GUICtrlCreateButton("AButton1", 464, 88, 89, 41)
$Button[7] = GUICtrlCreateButton("AButton1", 48, 152, 89, 41)
$Button[8] = GUICtrlCreateButton("AButton1", 152, 152, 89, 41)
$Button[9] = GUICtrlCreateButton("AButton1", 256, 152, 89, 41)
$Button[10] = GUICtrlCreateButton("AButton1", 464, 152, 89, 41)
$Button[11] = GUICtrlCreateButton("AButton1", 576, 88, 89, 41)
$Button[12] = GUICtrlCreateButton("AButton1", 576, 152, 89, 41)
GUISetState(@SW_SHOW)
While 1
    $msg = GuiGetMsg()
  ; _ChangeStatus($Form2, $Button, $Focus, $status, $SetStatus)
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $Button[1]
    Case $msg = $Button[2]  
    Case $msg = $Button[3]
    Case $msg = $Button[4]  
    Case $msg = $Button[5]
    Case $msg = $Button[6]
    Case $msg = $Button[7]
    Case $msg = $Button[8]
    Case $msg = $Button[9]
    Case $msg = $Button[10]
    Case $msg = $Button[11]
    Case $msg = $Button[12]
    Case Else
 ;;;;;;;
    EndSelect

    $pos = ""
    $pos=GUIGetCursorInfo() 
    If $pos[4] = 4 Then 
        GUICtrlSetData($status, "This labe info #1")
        Do
            $msg1 = GUIGetMsg()
            If $msg1 = $Button[1] Then MsgBox(64, " Item Found"," Item #1 - Program will now Run   "); call the function
            $pos1=GUIGetCursorInfo()    
            Sleep(10)
        Until $pos1[4] <> 4 
        GUICtrlSetData($status, "Welcome to Blash")
    EndIf   
    
    If $pos[4] = 5 Then 
        GUICtrlSetData($status, "This labe info #2")
        Do
            $msg1 = GUIGetMsg()
            If $msg1 = $Button[2] Then MsgBox(64, " Item Found"," Item #2 - Program will now Run   "); call the function
            $pos1=GUIGetCursorInfo()    
            Sleep(10)
        Until $pos1[4] <> 5 
        GUICtrlSetData($status, "Welcome to Blash")
    EndIf   



WEnd

Func GetPos()
    $a=GUIGetCursorInfo()
    MsgBox(0,"","left = " & $a[0] & @CRLF & "top = " & $a[1] & @CRLF & " control = " &  $a[4]) 
EndFunc

8)

NEWHeader1.png

Link to comment
Share on other sites

  • Moderators

I forgot about this post after I went out last night, just messed with it a bit, this should work:

#include <GUIConstants.au3>
Global $Hovered = 0
Local $Focus[13], $Button[13]
For $i = 1 To 12
    $Focus[$i] = 'Button' & $i
Next
Local $SetStatus[13] = ['', "Open Notepad, for text editing.", "Open MSPaint, for basic photo editing.", "Open Regedit, for regestry editing.", _
"Open The Gimp, for Photo manipulation, and editing.", "Open My Computer, for no particular reason.", "Nothing yet", "Nothing yet", "Nothing yet", _
"Nothing yet", "Nothing yet", "Nothing yet", "Nothing yet"]
$Form2 = GUICreate("Blash", 716, 561, 155, 134, BitOR($WS_MAXIMIZEBOX,$WS_SIZEBOX,$WS_THICKFRAME,$WS_OVERLAPPEDWINDOW,$WS_TILEDWINDOW,$WS_TABSTOP))
$status= GUICtrlCreateLabel("Welcome to Blash", 24, 528, 651, 17)
$Button[1] = GUICtrlCreateButton("Notepad", 48, 88, 89, 41)
$Button[2] = GUICtrlCreateButton("MSpaint", 152, 88, 89, 41)
$Button[3] = GUICtrlCreateButton("Regedit", 256, 88, 89, 41)
$Button[4] = GUICtrlCreateButton("The Gimp", 360, 88, 89, 41)
$Button[5] = GUICtrlCreateButton("My Computer", 360, 152, 89, 41)
$Button[6] = GUICtrlCreateButton("AButton1", 464, 88, 89, 41)
$Button[7] = GUICtrlCreateButton("AButton1", 48, 152, 89, 41)
$Button[8] = GUICtrlCreateButton("AButton1", 152, 152, 89, 41)
$Button[9] = GUICtrlCreateButton("AButton1", 256, 152, 89, 41)
$Button[10] = GUICtrlCreateButton("AButton1", 464, 152, 89, 41)
$Button[11] = GUICtrlCreateButton("AButton1", 576, 88, 89, 41)
$Button[12] = GUICtrlCreateButton("AButton1", 576, 152, 89, 41)
GUISetState(@SW_SHOW)
While 1
    $msg = GuiGetMsg()
    _ChangeStatus($Form2, $Button, $Focus, $status, $SetStatus)
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $Button[1]
    Case $msg = $Button[2]  
    Case $msg = $Button[3]
    Case $msg = $Button[4]  
    Case $msg = $Button[5]
    Case $msg = $Button[6]
    Case $msg = $Button[7]
    Case $msg = $Button[8]
    Case $msg = $Button[9]
    Case $msg = $Button[10]
    Case $msg = $Button[11]
    Case $msg = $Button[12]
    Case Else
  ;;;;;;;
    EndSelect
WEnd
Exit
Func _ChangeStatus($Hwnd_GUI, $Hwnd_CTRLID, $v_ClassNameNN, $Hwnd_StatusID, $v_SetStatus)
    $OptMCoord = Opt('MouseCoordMode', 2)
    Local $Mpos = MouseGetPos(), $True = 0
    For $x = 1 To 12
        $Cpos = ControlGetPos($Hwnd_GUI, '',$Hwnd_CTRLID[$x])
        If IsArray($Cpos) And IsArray($Mpos) Then
            If $Mpos[0] >= $Cpos[0] And $Mpos[0] <= $Cpos[0] + $Cpos[2] And $Mpos[1] >= $Cpos[1] And $Mpos[1] <= $Cpos[1] + $Cpos[3] And $Hovered <> $x Then
                ControlFocus($Hwnd_GUI, '', $v_ClassNameNN[$x])
                GUICtrlSetData($Hwnd_StatusID, $v_SetStatus[$x])
                $Hovered = $x
                $True = 1
                Opt('MouseCoordMode', $OptMCoord)
                Return 1
            EndIf
        EndIf
    Next
    If $True = 0 Then
        $Cpos2 = ControlGetPos($Hwnd_GUI, '', $Hwnd_CTRLID[$Hovered])
        If IsArray($Cpos2) And IsArray($Mpos) Then
            If $Mpos[0] < $Cpos2[0] Or $Mpos[0] > $Cpos2[0] + $Cpos2[2] Or $Mpos[1] < $Cpos2[1] Or $Mpos[1] > $Cpos2[1] + $Cpos2[3] Then
                If GUICtrlRead($status) <> "Welcome to Blash" Then 
                    GUICtrlSetData($status, "Welcome to Blash")
                    $Hovered = 0
                EndIf
            EndIf
        EndIf
    EndIf
    Opt('MouseCoordMode', $OptMCoord)
    Return 0
EndFunc

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

requires beta, minimum OS Win XP

#include <GUIConstants.au3>
Opt("MustDeclareVars", 1)

Global Const $DebugIt = 1
Global Const $WM_NOTIFY = 0x004E
Global Const $BCN_HOTITEMCHANGE = -1249
Global $Hovered = 0
Global $Button[13][2], $status

_Main()

Func _Main()
    Local $x = 48, $y = 88, $msg, $Form2
    
    Local $SetStatus[13] = [12, "Open Notepad, for text editing.", "Open MSPaint, for basic photo editing.", "Open Regedit, for regestry editing.", _
            "Open The Gimp, for Photo manipulation, and editing.", "Open My Computer, for no particular reason.", "Nothing yet", "Nothing yet", "Nothing yet", _
            "Nothing yet", "Nothing yet", "Nothing yet", "Nothing yet"]
    Local $Btn_Text[13] = [12, "Notepad", "MSpaint", "Regedit", "The Gimp", "My Computer", _
            "AButton1", "AButton1", "AButton1", "AButton1", "AButton1", "AButton1", "AButton1"]
    
    $Form2 = GUICreate("Blash", 716, 561, 155, 134, BitOR($WS_MAXIMIZEBOX, $WS_SIZEBOX, $WS_THICKFRAME, $WS_OVERLAPPEDWINDOW, $WS_TILEDWINDOW, $WS_TABSTOP))
    $status = GUICtrlCreateLabel("Welcome to Blash", 24, 528, 651, 17)
    
    $Button[0][0] = 12
    
    For $i = 1 To 6
        $Button[$i][0] = GUICtrlCreateButton($Btn_Text[$i], $x, $y, 89, 41)
        $Button[$i][1] = $SetStatus[$i]
        $Button[$i + 6][0] = GUICtrlCreateButton($Btn_Text[$i + 6], $x, $y + 64, 89, 41)
        $Button[$i + 6][1] = $SetStatus[$i+6]
        $x += 104
    Next
;Register WM_NOTIFY  events
    GUIRegisterMsg($WM_NOTIFY, "WM_Notify_Events")
    GUISetState(@SW_SHOW)
    While 1
        $msg = GUIGetMsg()
        Select
            Case $msg = $GUI_EVENT_CLOSE
                ExitLoop
            Case Else
                For $x = 1 To $Button[0][0]
                    If $msg = $Button[$x][0] Then
                ; do something, could be another array
                        ExitLoop
                    EndIf
                Next
        EndSelect
    WEnd
EndFunc ;==>_Main

; WM_NOTIFY event handler
Func WM_Notify_Events($hWndGUI, $MsgID, $wParam, $lParam)
    #forceref $hWndGUI, $MsgID, $wParam
    Local Const $HICF_ENTERING = 0x10
    Local Const $HICF_LEAVING = 0x20
    Local $tagNMBCHOTITEM, $event, $hwndFrom, $code, $dwFlags, $i
    $tagNMBCHOTITEM = DllStructCreate("int;int;int;dword", $lParam)
    $hwndFrom = DllStructGetData($tagNMBCHOTITEM, 1)
    $code = DllStructGetData($tagNMBCHOTITEM, 3)
    $dwFlags = DllStructGetData($tagNMBCHOTITEM, 4)
    Select
        Case $code = $BCN_HOTITEMCHANGE
    ;----------------------------------------------------------------------------------------------
            If $DebugIt Then    ConsoleWrite (_DebugHeader("$BCN_HOTITEMCHANGE"))
    ;----------------------------------------------------------------------------------------------
            If BitAND($dwFlags, $HICF_LEAVING) = $HICF_LEAVING Then
        ;----------------------------------------------------------------------------------------------
                If $DebugIt Then    ConsoleWrite (_DebugHeader("Leaving Button Area"))
        ;----------------------------------------------------------------------------------------------
                GUICtrlSetData($status, "Welcome to Blash")
            ElseIf BitAND($dwFlags, $HICF_ENTERING) = $HICF_ENTERING Then
        ;----------------------------------------------------------------------------------------------
                If $DebugIt Then    ConsoleWrite (_DebugHeader("Entering Button Area"))
        ;----------------------------------------------------------------------------------------------
                For $i = 1 To $Button[0][0]
                    If $hwndFrom = ControlGetHandle($hWndGUI, "", $Button[$i][0]) Then
                        GUICtrlSetData($status, $Button[$i][1])
                        ExitLoop
                    EndIf
                Next
            EndIf
    EndSelect
    $tagNMBCHOTITEM = 0
    $event = 0
    $lParam = 0
EndFunc ;==>WM_Notify_Events

Func _DebugHeader($s_text)
    Return _
            "!===========================================================" & @LF & _
            "+===========================================================" & @LF & _
            "-->" & $s_text & @LF & _
            "+===========================================================" & @LF
EndFunc ;==>_DebugHeader
Edited by gafrost

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

  • Moderators

If the Minimum PC is XP then this option given by Gary is MUUUUUUUUUCH nicer then what I did... For 1, it doesn't matter if the script is tied up doing something else, I put Sleep(20000) in mine under GUIGetMsg(), and it had to wait for the sleep to be over to change, put it in to change, with Gary's it doesn't.

This to me is much more efficient, as your probably doing other things (I always do) that you can't break away from, almost seems like multithreading :(:think:

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

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