fctd Posted January 14, 2009 Share Posted January 14, 2009 Hello, Can't find anything to change the icon in the taskbar, when starting the script with a MsgBox. Does someone have an idea? Thanks. [list][font="Century Gothic"]If nothing is certain, everything is possible.[/font][/list][font="Century Gothic"]Experience is something you get, just after you need it.[/font] Link to comment Share on other sites More sharing options...
SpookMeister Posted January 14, 2009 Share Posted January 14, 2009 Is TraySetIcon() what you are looking for? [u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote] Link to comment Share on other sites More sharing options...
fctd Posted January 14, 2009 Author Share Posted January 14, 2009 Just doing that. The TrayIcon is displayed well. Not the Taskbar icon while running a MsgBox. [list][font="Century Gothic"]If nothing is certain, everything is possible.[/font][/list][font="Century Gothic"]Experience is something you get, just after you need it.[/font] Link to comment Share on other sites More sharing options...
SpookMeister Posted January 14, 2009 Share Posted January 14, 2009 (edited) So you mean the icon of the msgbox itself? (not meaning the Warning sign or Exclamation etc.. on the msgbox) Edited January 14, 2009 by SpookMeister [u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote] Link to comment Share on other sites More sharing options...
fctd Posted January 14, 2009 Author Share Posted January 14, 2009 I don't have an icon in the MsgBox yet. I mean the icon under in the "taskbar" from windows, where the opened applications are shown. [list][font="Century Gothic"]If nothing is certain, everything is possible.[/font][/list][font="Century Gothic"]Experience is something you get, just after you need it.[/font] Link to comment Share on other sites More sharing options...
SpookMeister Posted January 14, 2009 Share Posted January 14, 2009 When you compile the script and give it an icon (CTRL+F7 in SciTE) it will use that icon for the msgbox in the taskbar. [u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote] Link to comment Share on other sites More sharing options...
fctd Posted January 14, 2009 Author Share Posted January 14, 2009 How can I add an icon? I build it in SciTE. ; First Run ;============================================== Func OnAutoItStart () ; === Set Tray Icon === TraySetIcon("C:\Program Files\Windows Media Player\wmplayer.exe") ; === Reset auto Pauze in tray === Opt("TrayAutoPause", 0) EndFunc ; === Show MessageBox === MsgBox(4096,"<= Wrong Icon", "In the MsgBox is not the right icon" & @CRLF & "Also under in the taskbar of windows, i need an other icon") With this script, I get a Windows mediaplayer icon in the tray, but still not in the Taskbar or MsgBox. [list][font="Century Gothic"]If nothing is certain, everything is possible.[/font][/list][font="Century Gothic"]Experience is something you get, just after you need it.[/font] Link to comment Share on other sites More sharing options...
SpookMeister Posted January 14, 2009 Share Posted January 14, 2009 (edited) In SciTE got to the Tools menu and click on Compile (or press CTRL+F7 like I told you before). This pops up some advanced compile options. There is one for "Icon", you just need to point it at a .ico file to use that icon. Edited January 14, 2009 by SpookMeister [u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote] Link to comment Share on other sites More sharing options...
fctd Posted January 14, 2009 Author Share Posted January 14, 2009 I don't get a pop-up ! [list][font="Century Gothic"]If nothing is certain, everything is possible.[/font][/list][font="Century Gothic"]Experience is something you get, just after you need it.[/font] Link to comment Share on other sites More sharing options...
SpookMeister Posted January 14, 2009 Share Posted January 14, 2009 OK, try saving your script (as a .au3). Then open up "My Computer" browse to wherever you saved the file, right click on it and choose "Compile with options". [u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote] Link to comment Share on other sites More sharing options...
fctd Posted January 14, 2009 Author Share Posted January 14, 2009 (edited) Only choice is "Compile". Can't find "Compile with options". *Edit* Is Scite Lite the problem ? Edited January 14, 2009 by fctd [list][font="Century Gothic"]If nothing is certain, everything is possible.[/font][/list][font="Century Gothic"]Experience is something you get, just after you need it.[/font] Link to comment Share on other sites More sharing options...
SpookMeister Posted January 14, 2009 Share Posted January 14, 2009 Hmmm.... OK, try Start | Programs | AutoIt v3 | Compile Script to .exe slightly different but should have the same effect for you... if you don't have that... I'm out of ideas for you buddy [u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote] Link to comment Share on other sites More sharing options...
fctd Posted January 14, 2009 Author Share Posted January 14, 2009 SciteLite is the problem ! Sorry for disturbing. Greetings. [list][font="Century Gothic"]If nothing is certain, everything is possible.[/font][/list][font="Century Gothic"]Experience is something you get, just after you need it.[/font] Link to comment Share on other sites More sharing options...
fctd Posted January 15, 2009 Author Share Posted January 15, 2009 (edited) SpookMeister, Compiling with an icon, changes only the icon of the .exe file. When I start the MsgBox, still have the AutoIt icon in the taskbar. *EDIT* Was pointing to a .exe file in stead of a .ico, now it works fine. Don't have an icon in the MsgBox yet, working on that. Thanks. Edited January 15, 2009 by fctd [list][font="Century Gothic"]If nothing is certain, everything is possible.[/font][/list][font="Century Gothic"]Experience is something you get, just after you need it.[/font] Link to comment Share on other sites More sharing options...
Cyri Posted April 27, 2009 Share Posted April 27, 2009 SpookMeister,Compiling with an icon, changes only the icon of the .exe file.When I start the MsgBox, still have the AutoIt icon in the taskbar.*EDIT* Was pointing to a .exe file in stead of a .ico, now it works fine.Don't have an icon in the MsgBox yet, working on that.Thanks.Did you ever figure out how to change the icon of a msgbox on the taskbar? I'm compiling it with an ico which does change it for the .exe file, but when I pop up a msgbox it's still the AutoIT default icon in the taskbar. Link to comment Share on other sites More sharing options...
Cyri Posted April 27, 2009 Share Posted April 27, 2009 SpookMeister,Compiling with an icon, changes only the icon of the .exe file.When I start the MsgBox, still have the AutoIt icon in the taskbar.*EDIT* Was pointing to a .exe file in stead of a .ico, now it works fine.Don't have an icon in the MsgBox yet, working on that.Thanks.I saw some strange things depending on what ico I specified during compile. I used the ScriptPackager.ico from PrimalScript and it changed the msgbox's taskbar icon as well. I thought OK all is good. However, when I removed the ico file and recompiled it, the msgbox's taskbar icon was still the ScriptPackager.ico. Very strange stuff. Then when I tried to use the original ico that I wanted it would never change the msgbox icon after compiling with that ico. Seems like some strange issues with Aut2Exe. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 28, 2009 Moderators Share Posted April 28, 2009 Cyri, I have had the same problem in the past. It is the Windows icon cache that is remembering the previous icon - it is not a problem with Aut2Exe. Google for how to refresh the icon cache on your OS and you should then get the correct icon displayed. M23  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area  Link to comment Share on other sites More sharing options...
Cyri Posted April 28, 2009 Share Posted April 28, 2009 Cyri, I have had the same problem in the past. It is the Windows icon cache that is remembering the previous icon - it is not a problem with Aut2Exe. Google for how to refresh the icon cache on your OS and you should then get the correct icon displayed. M23Thanks for the tip. I've had to rebuild the icon cache once or twice before when it was corrupted. As a workaround, I ended up using something like this: $hWnd = GUICreate("") MsgBox(4096, "test", "testing the msgbox icon", 0, $hWnd) In my case I really didn't care about the icon so much but rather hiding msgbox from showing in the taskbar at all. Even using the system modal as shown above nothing gets displayed on the taskbar. I'm guessing this is because I never show the parent GUI. Perhaps there are better ways, but this worked for me. Link to comment Share on other sites More sharing options...
shuaua Posted July 10, 2014 Share Posted July 10, 2014 Maybe the function _MsgBox() below can serve the purpose, it creates a GUI with the desired icon, associating the MsgBox as child. To see the example, the code must be compiled. Example() Func _MsgBox($flag, $title, $text, $timeout = "", $icofile = "") Local $hwnd, $out $hwnd = GUICreate("", 0, 0, -1, -1, 0, 0, 0) GUISetIcon($icofile) GUISetState(@SW_SHOWMINIMIZED) $msg = MsgBox($flag, $title, $text, $timeout, $hwnd) GUIDelete($hwnd) Return $msg EndFunc Func Example() ; Example (works only if compiled) If Not @Compiled Then _MsgBox(16,"Error", "Compile the script to see the examples") Exit EndIf Local $icofile1 = @SystemDir & "\regedit.exe" Local $icofile2 = @SystemDir & "\notepad.exe" Local $icofile3 = @SystemDir & "\explorer.exe" Local $button While 1 $button = _MsgBox(3+48, "_MsgBox", "This is a MsgBox with customized icon in the taskbar. Look to the icon, it's from Regedit.exe. Click YES to Notepad.exe icon or NO to Explorer.exe icon, or CANCEL to exit.", "", $icofile1) If $button == 6 Then _MsgBox(64, "_MsgBox", "You clicked on YES. Look to the icon in taskbar, it's now from Notepad.exe", 10, $icofile2) ElseIf $button == 7 Then _MsgBox(64, "_MsgBox", "You clicked on NO. Look to the icon in taskbar, it's now from Explorer.exe", 10, $icofile3) Else Exit EndIf WEnd EndFunc meoit 1 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