Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: SFML Icon - Pin To Taskbar Problem - Bug???  (Read 2530 times)

0 Members and 2 Guests are viewing this topic.

Marius_Suiram

  • Newbie
  • *
  • Posts: 3
    • View Profile
SFML Icon - Pin To Taskbar Problem - Bug???
« on: June 17, 2017, 08:05:47 pm »
I am a beginner at SFML and I am loving it so far. I have recently made a little game where you move a cube around and it collides with the walls so you can't go past them. I am quite happy and proud with it at this point. I have made an icon for it, and it works. But with one exception.

I see it on the task bar when it is open. The green square is the icon: http://imgur.com/a/PHRTs

But when I pin it to the task bar: http://imgur.com/a/POOgG

The icon just turns into an executable extension icon on the taskbar: http://imgur.com/a/jxCc1

I wonder if I am setting the icon the wrong way or if it is a bug and will eventually be fixed in a later update to SFML. Here is the snippet of code for setting the icon: https://pastebin.com/nNrnuuFg

I wish to get any response as soon as possible :)
Thank you for any further response.
« Last Edit: June 17, 2017, 11:09:32 pm by eXpl0it3r »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: SFML Icon - Pin To Taskbar Problem - Bug???
« Reply #1 on: June 17, 2017, 08:21:19 pm »
There are two different icons involved.
The one you see on the window in the top left corner (and on the taskbar) and the one you see when you browse to your executable (and you see when you pin something to the taskbar).
The first one you can change through SFML, the second one you can only change by using Windows' resource compiler. If you google it, you can find out how.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Sub

  • Full Member
  • ***
  • Posts: 159
    • View Profile
Re: SFML Icon - Pin To Taskbar Problem - Bug???
« Reply #2 on: June 17, 2017, 08:35:02 pm »
Not sure if there's a more generic way to do this, but for Windows, you need to create a resource file specifying your icon and add it to visual studio.  Then when you compile next, it'll be added to the exe.  The replies here should help you out

https://stackoverflow.com/questions/320677/how-do-i-set-the-icon-for-my-application-in-visual-studio-2008

Marius_Suiram

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: cant remove this post
« Reply #3 on: June 17, 2017, 09:13:19 pm »
Thank you for the response. But it turned out to be fairly difficult when using a g++ compiler.

I have found a program named Resource Hacker where you can change the OS specific icon, and it seems to be working. You still need to use the SFML icon implementation for the other part of the icon.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: SFML Icon - Pin To Taskbar Problem - Bug???
« Reply #4 on: June 17, 2017, 11:11:39 pm »
It's not really more difficult with GCC than with VS, it's just that it's overall a pretty annoying process.
Having to define some weird resource file and then using some resource compiler to handle all the work.

Yes, the Resource Hacker way, is another possibility, but can be annoying, as you'll have to do it every time you create a new executable.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Marius_Suiram

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: SFML Icon - Pin To Taskbar Problem - Bug???
« Reply #5 on: June 18, 2017, 11:42:13 am »
That is true.

I will just have to take a deeper look in to making a resource file.