Jump to content

GUISetIcon not updating icon


Recommended Posts

#include <GUIConstants.au3>

$Form = GUICreate("Form", 323, 170, -1, -1, -1, BitOR($WS_EX_ACCEPTFILES,$WS_EX_TOPMOST,$WS_EX_WINDOWEDGE))
$Input = GUICtrlCreateInput("", 8, 8, 305, 105, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN))
GUICtrlSetState($Input, $GUI_DROPACCEPTED)
$Button = GUICtrlCreateButton("Go", 255, 134, 56, 25, 0)
$Icon = GUICtrlCreateIcon("shell32.dll", 12, 136, 120, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
;GUISetIcon("shell32.dll", 12, $Form); Displays icon correctly
GUISetState(@SW_SHOW)

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $Button
        _icon()
    EndSelect
WEnd

Func _icon()
$name = GUICtrlRead($Input) 
GUICtrlSetImage($Icon, $name, 0)
GUISetIcon($name, 0, $Form); Only displays icon if cursor over minimize/close buttons
EndFunc

Dragging an exe into $Input and clicking Go updates $Icon but not GUISetIcon unless the cursor is over the minimize or close buttons.

Tested using Autoit v3.2.8.1 and it worked as expected.

Is this a bug?

Windows XP

Autoit v3.2.10.0

Link to comment
Share on other sites

#include <GUIConstants.au3>

$Form = GUICreate("Form", 323, 170, -1, -1, -1, BitOR($WS_EX_ACCEPTFILES,$WS_EX_TOPMOST,$WS_EX_WINDOWEDGE))
$Input = GUICtrlCreateInput("", 8, 8, 305, 105, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN))
GUICtrlSetState($Input, $GUI_DROPACCEPTED)
$Button = GUICtrlCreateButton("Go", 255, 134, 56, 25, 0)
$Icon = GUICtrlCreateIcon("shell32.dll", 12, 136, 120, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
;GUISetIcon("shell32.dll", 12, $Form); Displays icon correctly
GUISetState(@SW_SHOW)

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $Button
        _icon()
    EndSelect
WEnd

Func _icon()
$name = GUICtrlRead($Input) 
GUICtrlSetImage($Icon, $name, 0)
GUISetIcon($name, 0, $Form); Only displays icon if cursor over minimize/close buttons
EndFunc

Dragging an exe into $Input and clicking Go updates $Icon but not GUISetIcon unless the cursor is over the minimize or close buttons.

Tested using Autoit v3.2.8.1 and it worked as expected.

Is this a bug?

Windows XP

Autoit v3.2.10.0

Tested with 3.2.10.0 and it worked fine (didn't need to mouseover the min/close). Tested both as a test run from SciTE and as a compiled script with no issue.

- MoChr(77)& Chr(97)& Chr(100)& Chr(101)& Chr(32)& Chr(121)& Chr(97)& Chr(32)& Chr(108)& Chr(111)& Chr(111)& Chr(107)-------I've told you 100,000 times not to exaggerate!-------Don't make me hit you with my cigarette hand...-------My scripts:Random Episode Selector, Keyboard MouseMover, CopyPath v2.1, SmartRename for XP,Window Tracer[sup]New![/sup]

Link to comment
Share on other sites

#include <GUIConstants.au3>

$Form = GUICreate("Form", 323, 170, -1, -1, -1, BitOR($WS_EX_ACCEPTFILES,$WS_EX_TOPMOST,$WS_EX_WINDOWEDGE))
$Input = GUICtrlCreateInput("", 8, 8, 305, 105, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN))
GUICtrlSetState($Input, $GUI_DROPACCEPTED)
$Button = GUICtrlCreateButton("Go", 255, 134, 56, 25, 0)
$Icon = GUICtrlCreateIcon("shell32.dll", 12, 136, 120, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
;GUISetIcon("shell32.dll", 12, $Form); Displays icon correctly
GUISetState(@SW_SHOW)

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $Button
        _icon()
    EndSelect
WEnd

Func _icon()
$name = GUICtrlRead($Input) 
GUICtrlSetImage($Icon, $name, 0)
GUISetIcon($name, 0, $Form); Only displays icon if cursor over minimize/close buttons
EndFunc

Dragging an exe into $Input and clicking Go updates $Icon but not GUISetIcon unless the cursor is over the minimize or close buttons.

Tested using Autoit v3.2.8.1 and it worked as expected.

Is this a bug?

Windows XP

Autoit v3.2.10.0

3.2.10.0 worked for me. What happens if the path = C:\WINDOWS\NOTEPAD.EXE??
Link to comment
Share on other sites

Thanks for testing it Bert.

I've performed a System Restore and re-installed v3.2.10.0 and it's working as expected.

Good to know it wasn't an autoit problem but i fear it's a warning of bigger problems with my pc.

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