Icon it top left corner of window

BlitzMax Forums/BlitzMax Beginners Area/Icon it top left corner of window

Joe90(Posted 2011) [#1]
Using blitzmax Gui is there any way of changing the icon in the top left corner of the title bar of your window to something else.
Cant seem to find anything to change the icon.
Thankyou
Kind Regards
Joe


degac(Posted 2011) [#2]
SetGadgetPixmap should do the work


jsp(Posted 2011) [#3]
If you only need the GUI icon of the window and not the application icon you can use:
Local Pixmap_Window1:TPixmap = LoadPixmapPNG:TPixmap ( "C:/YourPicture.PNG" )
SetGadgetPixmap( Window1:TGadget , Pixmap_Window1:TPixmap ,GADGETPIXMAP_ICON )

degac was quicker:)

Last edited 2011


Joe90(Posted 2011) [#4]
ok thanks guys i tried putting that code in my program and it runs ok but the icon in the top left of the application when i run it still shows the same icon. How do i change this or do i need to code something else.
Thanks


jsp(Posted 2011) [#5]
What size is your icon picture, if I remember correctly it should be 16x16 pixel.


Pyrael(Posted 2011) [#6]
Do you mean the Icon of the window bar in the upper left corner??

you can change it by inserting an selfmade icon with this code:



but first you have to convert an standard windows-icon file to an ".o" file.

when you save the .o file in the same directory where the .bmx file of your code is than will blitzmax by compiling choose the .o -file as icon in the linked.exe file for the upper left corner of the window.


sorry for my horrible english

Last edited 2011

Last edited 2011


jsp(Posted 2011) [#7]
For the window icon only it is not a must to create an .o file, the SetGadgetPixmap should be enough.

Using a .o file gives actually more control, as you include a windows manifest. If that is what you want have a look at this:
http://www.blitzmax.com/Community/posts.php?topic=71485#801572


Johnsprogram(Posted 2011) [#8]
Can I be able to show a new upper-left icon showing when I'm not using BlitzMaxGUI? If so, how? I've done importing the .o file through the steps, but still no icon on the upper-left corner of the window.


jsp(Posted 2011) [#9]
@JP
search the forums for "resourcehacker"


GfK(Posted 2011) [#10]
This is by far the best method. It changes the icon in the app window, taskbar, alt-tab - everything. I use it in my games.

A little fiddly for first-time setup but dead easy after that.