[SB_SetIcon] How can i display my own ico. file Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
ZakMcKrackenDE
Posts: 11
Joined: 28 Sep 2022, 07:48

[SB_SetIcon] How can i display my own ico. file

Post by ZakMcKrackenDE » 05 Oct 2022, 04:22

Hello, AHK-Humans,

i try to implement a yellow circle ico.file in my Statusbar.

Code: Select all

Gui, Add, StatusBar
SB_SetParts(60,800)
SB_SetIcon(yellow.ico,1)
SB_SetText("Hinweis",2)
Two questions:
1. How use i SB_Seticon with a path?
2. How can i show my icon?

If i use the code below, i have two segments one with 60 pixels and the other with 800 pixel. The Text shows correct, but my icon doesn´t show.

Who can me explain, what is wrong?

Thanks for help.

Best regards

Zak

User avatar
boiler
Posts: 16771
Joined: 21 Dec 2014, 02:44

Re: [SB_SetIcon] How can i display my own ico. file  Topic is solved

Post by boiler » 05 Oct 2022, 05:20

You need quotation marks around a literal string in an expression, which function parameters are:

Code: Select all

SB_SetIcon("yellow.ico",1)
(just like the line below it)

User avatar
ZakMcKrackenDE
Posts: 11
Joined: 28 Sep 2022, 07:48

Re: [SB_SetIcon] How can i display my own ico. file

Post by ZakMcKrackenDE » 05 Oct 2022, 05:42

Thanks, for the really quick answer.

Now it works. I missed the "", but how can i use a path or is this here not possible?

User avatar
boiler
Posts: 16771
Joined: 21 Dec 2014, 02:44

Re: [SB_SetIcon] How can i display my own ico. file

Post by boiler » 05 Oct 2022, 06:13

ZakMcKrackenDE wrote: how can i use a path or is this here not possible?
By using the path instead of just the filename. Why do you think it's not possible? Did you try it (with quotation marks)?

User avatar
ZakMcKrackenDE
Posts: 11
Joined: 28 Sep 2022, 07:48

Re: [SB_SetIcon] How can i display my own ico. file

Post by ZakMcKrackenDE » 07 Oct 2022, 17:17

boiler wrote:
05 Oct 2022, 06:13
ZakMcKrackenDE wrote: how can i use a path or is this here not possible?
By using the path instead of just the filename. Why do you think it's not possible? Did you try it (with quotation marks)?
Thanks, your solution works fine...

Post Reply

Return to “Ask for Help (v1)”