J0ker Posted March 5, 2007 Posted March 5, 2007 Hi,Is that possible to set the current icon image of my script(.exe file) on the title of my Gui box without having the image file in the folder? How can I do it?Thanks!
J0ker Posted March 5, 2007 Author Posted March 5, 2007 If I use this command, I MUST have the .ico file in the folder. I want a command that will get the icons from the exe.
Moderators SmOke_N Posted March 5, 2007 Moderators Posted March 5, 2007 If I use this command, I MUST have the .ico file in the folder. I want a command that will get the icons from the exe.What icon are you trying to set it to?Maybe... http://msdn2.microsoft.com/en-us/library/ms648068.aspx 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.
smashly Posted March 5, 2007 Posted March 5, 2007 If I use this command, I MUST have the .ico file in the folder. I want a command that will get the icons from the exe.Then try adding the path to the exe and the exe's icon index number. eg:GuiSetIcon("C:\WhatEverDirectory\YourExe\is.exe, 1) works with dll's , ocx's , cpl's and various other files that have icon resources. Cheers
J0ker Posted March 5, 2007 Author Posted March 5, 2007 What icon are you trying to set it to?Maybe... http://msdn2.microsoft.com/en-us/library/ms648068.aspxThe icon of my current script(exe file). The function will be called from inside this script and I want it to get the icon of the exe file.
smashly Posted March 5, 2007 Posted March 5, 2007 If you mean your compiled script then use GuiSetIcon(@AutoItExe, x) x being the index number of you icon.
J0ker Posted March 5, 2007 Author Posted March 5, 2007 (edited) Then try adding the path to the exe and the exe's icon index number. eg:GuiSetIcon("C:\WhatEverDirectory\YourExe\is.exe, 1) How can I set it with @SCRIPTDIR if there's not supposed to be any "workingdir" in the parameters. EDIT: If you mean your compiled script then use GuiSetIcon(@AutoItExe, x) x being the index number of you icon. I will try this! How can i know the Index number of my icon? Edited March 5, 2007 by J0ker
smashly Posted March 5, 2007 Posted March 5, 2007 If you want a easy to use gui tool to inject your icons into your compiled upx'd scripts exe then let me know and I'll post my dodgey script I've made for doing the task. Basicly the script/tool uses reshacker and to inject your icons into an already unedited compiled autoit script.
J0ker Posted March 5, 2007 Author Posted March 5, 2007 (edited) Using this I'm not getting any image... GuiCreate("My title", 391, 187,-1, -1, $WS_CAPTION) GuiSetIcon(@AutoItExe, 1) GuiSetState() I tried it compiled. @smashly: You dont know an other way because I dont really want to use reshacker. The GuiSetIcon should work... Edited March 5, 2007 by J0ker
tAKTelapis Posted March 5, 2007 Posted March 5, 2007 Erm.. well, i compile my scripts with the Compile Script to Exe that is included with v3, it has an option to define a custom icon file, i just use that.. and it replaces anywhere that the icon would have shown with the icon i have given it.
J0ker Posted March 5, 2007 Author Posted March 5, 2007 (edited) Erm.. well, i compile my scripts with the Compile Script to Exe that is included with v3, it has an option to define a custom icon file, i just use that.. and it replaces anywhere that the icon would have shown with the icon i have given it.huh... I also compiled my script and defined an icon. It's THAT icon image that i want on the title bar of my gui box but without having the .ico file. Edited March 5, 2007 by J0ker
smashly Posted March 5, 2007 Posted March 5, 2007 (edited) try it without the $WS_CAPTION@tAKTelapisSomtimes ppl want to use more then the 1 icon from their compiled autoit exe, sometimes ppl don't want to use the install function either. example of what I mean: here Edited March 5, 2007 by smashly
J0ker Posted March 5, 2007 Author Posted March 5, 2007 try it without the $WS_CAPTIONTried, doesnt work. Im getting this:(The Red X is not my image)
Moderators SmOke_N Posted March 5, 2007 Moderators Posted March 5, 2007 Add a minus sign to the number. 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.
smashly Posted March 5, 2007 Posted March 5, 2007 Tried, doesnt work. Im getting this:(The Red X is not my image) Then it's working as it should.index 0 is the Autoit icon (first icon in the exe)index 1 is the cross (this is the second icon in the exe)index 2 is the white box with a + sign in it (this is the third icon)
J0ker Posted March 5, 2007 Author Posted March 5, 2007 (edited) Add a minus sign to the number.Hurray it work!(without the $WS_CAPTION)Thx Smash and Smoke! Edited March 5, 2007 by J0ker
smashly Posted March 5, 2007 Posted March 5, 2007 Have a look here for a rough example of how I was using icons from my compiled exe..
EndFunc Posted March 5, 2007 Posted March 5, 2007 Hi,Is that possible to set the current icon image of my script(.exe file) on the title of my Gui box without having the image file in the folder? How can I do it?Thanks!As one person said if you are simply just wanting to add a specific icon to left corner of your compiled scripts you can do that with the Compile Script to Exe utility and select the custom ico. Now if you have a regular image that is not a .ico file then it probably won't work. You may need to convert you image to a .ico file and then use the utility to use that image. I have done that before using Photoshop to convert to .ico file. If you don't have PS you can try http://www.coolutils.com/Online-Image-Converter.php and it should convert it for free. EndFuncAutoIt is the shiznit. I love it.
freeman7 Posted March 14, 2007 Posted March 14, 2007 (edited) Hi, Is that possible to set the current icon image of my script(.exe file) on the title of my Gui box without having the image file in the folder? How can I do it? Try this: Put your code with icons to folder c:code put this line to the code after #include lines: FileInstall("C:\code\icon.ico", "C:\temp\icon.ico") Now, on wanted place in the code put this: GUISetIcon ("c:\temp\icon.ico") Fileinstall() is a way to put all wanted files into compiled script file. It unpacks those "fileinstalled" files to marked place but will not delete them. It has to be done with FileDelete() I have made some discovering on icon stuff and I think this is only way to make it having only script.exe in folder while run it. Autoit can't use icon straight from an exe. (Like windows style c:file.exe,1) Like this: #include <GUIConstants.au3> FileInstall("C:\code\icon1.ico", "C:\temp\icon1.ico") FileInstall("C:\code\icon2.ico", "C:\temp\icon2.ico") FileInstall("C:\code\icon3.ico", "C:\temp\icon3.ico") FileInstall("C:\code\icon4.ico", "C:\temp\icon4.ico") GUICreate ("My test GUI") GUISetIcon ("c:\temp\icon1.ico") GUISetState ( ) While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop Wend Does this help you? Edited March 14, 2007 by freeman7 -------------------------------------------------------People keeping order at their stuff are just too lazy to search anything...Test these:Easy-to-use notepad
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