momar33 Posted October 4, 2007 Share Posted October 4, 2007 If try to create an icon after GuiSetState() it doesn't show up. Here is some code: (you may have to change the exe being used) #include <GUIConstants.au3> Global $button[6] Global $icon[6] $GUI = GUICreate("My GUI") $icon1 = GUICtrlCreateIcon("shell32.dll" , 4,4,4,16,16) ;GUICtrlSetImage (-1, "C:\Program Files\Mozilla Firefox\firefox.exe") GUISetState() $icon2 = GUICtrlCreateIcon("",Default,32,4,16,16) GUICtrlSetImage (-1, "C:\Program Files\CCleaner\ccleaner.exe") GUICtrlSetState(-1,$GUI_SHOW) While 1 $m = GUIGetMsg() If $m = -3 then Exit WEnd I did discover that if I set the file name to "shell32.dll" first then change the image it works fine, but i would prefer to not have to set the filename first. Link to comment Share on other sites More sharing options...
i542 Posted October 4, 2007 Share Posted October 4, 2007 Weird...you shall post it in Bugs forum... I can do signature me. Link to comment Share on other sites More sharing options...
Nahuel Posted October 4, 2007 Share Posted October 4, 2007 I discovered that with an app I made to draw a graphic. If you use GUICtrlSetGraphic($ControlID,"blah","blah") after GuiSetState then it won't work...Examples:Won't show the graphic:#include <GUIConstants.au3> GUICreate("Form1", 288, 299, 241, 122) $Graphic = GUICtrlCreateGraphic(0, 0, 281, 297) GUISetState(@SW_SHOW) GUICtrlSetGraphic($Graphic,$GUI_GR_LINE,281,297) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEndWill show the graphic:#include <GUIConstants.au3> GUICreate("Form1", 288, 299, 241, 122) $Graphic = GUICtrlCreateGraphic(0, 0, 281, 297) GUICtrlSetGraphic($Graphic,$GUI_GR_LINE,281,297) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEndNow this will only show the graphic that was underneath the splashtext#include <GUIConstants.au3> GUICreate("Form1", 288, 299, 241, 122) $Graphic = GUICtrlCreateGraphic(0, 0, 281, 297) GUISetState(@SW_SHOW) SplashTextOn("","splash text",200,200,-1,-1,1) Sleep(700) GUICtrlSetGraphic($Graphic,$GUI_GR_LINE,281,297) SplashOff() While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Link to comment Share on other sites More sharing options...
aslani Posted October 5, 2007 Share Posted October 5, 2007 If try to create an icon after GuiSetState() it doesn't show up. May I ask why you want to do it this way? Anyways, can you do this instead? $icon1 = GUICtrlCreateIcon("shell32.dll" , 4,4,4,16,16) ;GUICtrlSetImage (-1, "C:\Program Files\Mozilla Firefox\firefox.exe") $icon2 = GUICtrlCreateIcon("",Default,32,4,16,16) $icon3 = GUICtrlCreateIcon("",Default,60,4,16,16) GUISetState() GUICtrlSetImage ($icon2, "notepad.exe") GUICtrlSetState($icon2, $GUI_SHOW) GUICtrlSetImage ($icon3, "calc.exe") GUICtrlSetState($icon3, $GUI_SHOW) [font="Georgia"]Chances are, I'm wrong.[/font]HotKey trouble?Stringregexp GuideAutoIT Current Version Link to comment Share on other sites More sharing options...
corz Posted October 6, 2007 Share Posted October 6, 2007 From the AutoIt manual page for GUICtrlCreateIcon .. "To update the icon after the dialog box is displayed use GUICtrlSetImage" ;o) (or nothing is foolproof to the sufficiently talented fool.. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now