Jump to content

Change Title Bar Icon


zone97
 Share

Recommended Posts

Hello, I'm new here and have a few questions. BTW, Excelent program....

I would like to know if there is a way to change the title bar icon? [found the tray icon setting.]

Can you use and icon file for above?

Can "needed" files be compiled into the exe so you end up with only one file?

Thanks.

BTW, I did search and couldnt find these answers... Thanks.

 

Spoiler

WinSizer 2.1 (01/04/2017) - Download - [ Windows Layout Manager ]
Folder+Program (12/23/2016) - Download - [ USB Shortcut Creator ]

 

Link to comment
Share on other sites

Hello, I'm new here and have a few questions. BTW, Excelent program....

I would like to know if there is a way to change the title bar icon? [found the tray icon setting.]

Can you use and icon file for above?

Can "needed" files be compiled into the exe so you end up with only one file?

Thanks.

BTW, I did search and couldnt find these answers... Thanks.

Hi and welcome to the forums!

The function you are looking for is GUISetIcon ( iconfile [, iconID [, winhandle]] ).

Cheers!

Brett

Link to comment
Share on other sites

Hi and welcome to the forums!

The function you are looking for is GUISetIcon ( iconfile [, iconID [, winhandle]] ).

Cheers!

Brett

Thank you for the information, however here is a snippit of my code...

TraySetIcon("Shell32.dll",-134)
GUISetIcon("Shell32.dll",-134)

The top works, the bottom does not. the taskbar icon and title bar icon stay the same.

 

Spoiler

WinSizer 2.1 (01/04/2017) - Download - [ Windows Layout Manager ]
Folder+Program (12/23/2016) - Download - [ USB Shortcut Creator ]

 

Link to comment
Share on other sites

And FileInstall for the second question coincidentally.

Thank you for this info as well. I noticed when reading the help on this command, that on exicution it is extracted to a predefined location. Could I assume then that if you want to clean up after yourself you would need to issue some delete commands to remove these files?

 

Spoiler

WinSizer 2.1 (01/04/2017) - Download - [ Windows Layout Manager ]
Folder+Program (12/23/2016) - Download - [ USB Shortcut Creator ]

 

Link to comment
Share on other sites

here is a snippit of my code...

TraySetIcon("Shell32.dll",-134)
GUISetIcon("Shell32.dll",-134)

The top works, the bottom does not. the taskbar icon and title bar icon stay the same.

It's work for me:

#include <GuiConstants.au3>

$GUI = GUICreate("Test Script", 300, 200)

TraySetIcon("Shell32.dll",-134)
GUISetIcon("Shell32.dll", -134)

GUICtrlCreateButton("Button", 20, 40, 60, 20)

GUISetState(@SW_SHOW, $GUI)

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

What version of AutoIt you are using? and on what system?

Could I assume then that if you want to clean up after yourself you would need to issue some delete commands to remove these files?

Yes, you need to delete (FileDelete/DirRemove) manualy all FileInstalls to clean after your app is exit.

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

Simpler way is here - Just place that 1 line at top of your AU3 script:

#AutoIt3Wrapper_icon=your_icon.ico

And compile your script from Scite4AutoIt3 editor (by F7).

You must have file your_icon.ico at script directory at compile time only.

After compilation is this icon inside output EXE and it's used as main icon also for your GUI window without using GUISetIcon.

Edited by Zedna
Link to comment
Share on other sites

It's work for me:

I had to change 2 lines and use the code you supplied, those lines were...

$GUI = GUICreate("Test Script", 300, 200)
GUISetState(@SW_SHOW, $GUI)

I was using only

GUICreate("Test Script", 300, 200)
GUISetState()

Like this.

 

Spoiler

WinSizer 2.1 (01/04/2017) - Download - [ Windows Layout Manager ]
Folder+Program (12/23/2016) - Download - [ USB Shortcut Creator ]

 

Link to comment
Share on other sites

Simpler way is here - Just place that 1 line at top of your AU3 script:

#AutoIt3Wrapper_icon=your_icon.ico

And compile your script from Scite4AutoIt3 editor (by F7).

You must have file your_icon.ico at script directory at compile time only.

After compilation is this icon inside output EXE and it's used as main icon also for your GUI window without using GUISetIcon.

I tried the #AutoIt3Wrapper_icon=template.ico and it didn't seem to cause the compiled application to have the icon i selected... I used a program to extract the icon file, and put it in the same folder as the au3 before compiling. Nothing happened? Thanks.

 

Spoiler

WinSizer 2.1 (01/04/2017) - Download - [ Windows Layout Manager ]
Folder+Program (12/23/2016) - Download - [ USB Shortcut Creator ]

 

Link to comment
Share on other sites

I tried the #AutoIt3Wrapper_icon=template.ico and it didn't seem to cause the compiled application to have the icon i selected... I used a program to extract the icon file, and put it in the same folder as the au3 before compiling. Nothing happened? Thanks.

As I said:

Download and install latest Scite4AutoIt3 editor first. Here is link: http://www.autoitscript.com/autoit3/scite/downloads.shtml

Then compile your script from Scite4AutoIt3 editor (by F7).

Edited by Zedna
Link to comment
Share on other sites

As I said:

Download and install latest Scite4AutoIt3 editor first. Here is link: http://www.autoitscript.com/autoit3/scite/downloads.shtml

Then compile your script from Scite4AutoIt3 editor (by F7).

That did the trick, but only for compite, got "go" it does not. But not that big of a deal. Thanks.

 

Spoiler

WinSizer 2.1 (01/04/2017) - Download - [ Windows Layout Manager ]
Folder+Program (12/23/2016) - Download - [ USB Shortcut Creator ]

 

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