TitleBar Icon

BlitzMax Forums/BlitzMax Programming/TitleBar Icon

FantomKite(Posted 2009) [#1]
Hi. Prompt please how to insert the icon here

preferably with an example.


klepto2(Posted 2009) [#2]
Sorry, prompt answer: Use the search function.


markcw(Posted 2009) [#3]
Hi, window icon guides (Win/Mac).

> Proper BMax Icon Support - Win
> Adding an application icon (Win32 executable)
> Creating Universal Binary Distributable files - Mac
> Mac: Setting the icon the "proper" way


nawi(Posted 2009) [#4]
You can change that using resource hacker on Windows.


SLotman(Posted 2009) [#5]
Any way to do this on Linux? (Without MaxGUI?)


Ked(Posted 2009) [#6]
Brucey's Bah.GTKMaxGUI module lets you set the window icon only, but you said without MaxGUI. :)


FantomKite(Posted 2009) [#7]
Many thanks!
Helped code
'----------------------------------------------------------------------------
' ccSetIcon
'-----------------------------------------------------------------------------
Function ccSetIcon(iconname$, TheWindow%)	
	?Win32
	Local icon=ExtractIconA(TheWindow,iconname,0)
	Local WM_SETICON = $80
	Local ICON_SMALL = 0
	Local ICON_BIG = 1
'	sendmessage(TheWindow, WM_SETICON, ICON_SMALL, icon) 'don't need this
	sendmessage(TheWindow, WM_SETICON, ICON_BIG, icon)
'	SetClassLongA(TheWindow,-14,icon)'obsolete as it doesn't work with Windows XP Theme!
	?
End Function

'call it like this
ccSetIcon("test.ico", GetActiveWindow())


'and the externs:


?win32
Extern "win32"
	Function ExtractIconA%(hWnd%,File$z,Index%)
	Function GetActiveWindow%()
	Function SendMessage:Int(hWnd:Int,MSG:Int,wParam:Int,lParam:Int) = "SendMessageA@16"
End Extern
?