Sign in to follow this  
Followers 0
faustf

little questions about GUICtrlCreateIcon

9 posts in this topic

i create i little icon whit GUICtrlCreateIcon but if i want remove ???

i treyed GUICtrlDelete but dnt do nothing , exist a specific command ??

Share this post


Link to post
Share on other sites



Hi, faustf, can you please clarify what you're trying to do (this seems to be a common request in your posts)? Do you mean you're creating the control with the Icon, and then at some point in the script want the icon to disappear? How about posting your code so we can take a look :)


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

o sorry :D simply i have a gui in middle creat a icon , after some time , the icon must desappear

how can erase ? ? ?

Share this post


Link to post
Share on other sites

Post your code, and we'll do what we can to assist :)


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#include <GuiConstantsEx.au3>
#include <GDIPlus.au3>
#include <ScreenCapture.au3>
#include <Date.au3>
#include <GuiEdit.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>
#include <Date.au3>
#include <editconstants.au3>
#include <listviewconstants.au3>
#include <staticconstants.au3>
#include <windowsconstants.au3>
#include <guilistview.au3>
#include <Word.au3>
#include <GuiImageList.au3>
#include <Timers.au3>
#include <GuiListBox.au3>
#include <GuiButton.au3>
#include <ComboConstants.au3>
#include <misc.au3>
#include <Word.au3>
#include <MPDF_UDF.au3>
#include <GUIComboBox.au3>
#include <Constants.au3>
#include <DateTimeConstants.au3>
#include <file.au3>
#include <array.au3>
#include <INet.au3>
#include <Process.au3>
#include <ColorPicker.au3>
#include <WinAPI.au3>

$Form2 = GUICreate("Form2", 413, 305, 303, 219)
GUISetState(@SW_SHOW)
  $loading=GUICtrlCreateIcon('E:_recorder-screenDataicon', -1, 160,120, 32, 32)

  sleep(50000)
  GUICtrlDelete ($loading)

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
  Case $GUI_EVENT_CLOSE
   Exit
EndSwitch
WEnd

Share this post


Link to post
Share on other sites

This script, modified from the GUICtrlCreateIcon example script, works just fine for me.

#include <GUIConstantsEx.au3>
Example1()

;example1 ---------------------------
Func Example1()
     GUICreate(" My GUI Icons", 250, 250)
     $icon1 = GUICtrlCreateIcon("shell32.dll", 10, 20, 20)
     $icon2 = GUICtrlCreateIcon("shell32.dll", 7, 20, 75, 32, 32)
     GUISetState()
     Sleep(3000)
     GUICtrlDelete($icon1)
     Sleep(3000)
     GUICtrlDelete($icon2)
     ; Run the GUI until the dialog is closed
     While 1
          Local $msg = GUIGetMsg()
          If $msg = $GUI_EVENT_CLOSE Then ExitLoop
     WEnd
     GUIDelete()
EndFunc   ;==>Example1

It will create a GUI with 2 icons on it, 3 seconds later the top icon will be deleted, 3 seconds after that the bottom icon will be deleted.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

I almost forgot to ask this, what is with all of the includes you have at the top of the example script you posted???

You have several of the same UDF files in there twice.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

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