Code: Select all
IconPath.S = #PB_Compiler_Home + "examples/sources/Data/CdPlayer.ico"
OpenWindow(0, 0, 0, 300, 100, "<-- Changed titlebar icon", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
CompilerIf #PB_Compiler_OS = #PB_OS_Linux
gtk_window_set_icon_from_file_(WindowID(0), PeekS(@IconPath), IconError)
CompilerElse
IconPath = ReplaceString(IconPath, "/", "\")
If LoadImage(0, IconPath)
SendMessage_(WindowID(0), #WM_SETICON, 0, ImageID(0))
EndIf
CompilerEndIf
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow