
I would like to ask , when I compile my executable file of my game(s) , how I would able to change the icon of the .exe file and put something else than the default one?
Thank you.
Sorry to bump this thread, but could this setting be done programmatically?MachineCode wrote:Compiler menu -> Compiler Options.
Code: Select all
wFlags = #WS_OVERLAPPEDWINDOW | #WS_VISIBLE | 1
OpenWindow(1, 0, 0, 300, 200, "No Window Icon", wFlags)
SetWindowLong_(WindowID(1), #GWL_EXSTYLE, #WS_EX_DLGMODALFRAME)
HideWindow(1, 0)
While WaitWindowEvent() ! #PB_Event_CloseWindow : Wend
You mean something like that ?TI-994A wrote:Should we assume that it would not be possible to have a window with no icon if we set the EXE icon?
Code: Select all
; directly from RSBasic's WinAPI Library
If OpenWindow(0,0,0,500,250,"Window",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
SendMessage_(WindowID(0),#WM_SETICON,#False,5)
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
Code: Select all
Procedure SetWindowIcon(Window, Image) ; Set a new window icon
If IsWindow(Window) And IsImage(Image)
SendMessage_(WindowID(Window),#WM_SETICON,#False,ImageID(Image))
EndIf
EndProcedure
Hi Bisonte. Thank you for the examples (both of them show icons in the window). Setting the icon for the window is not a problem. I was trying to find a way to set the icon of the compiled executable (the EXE file) as it appears in the Windows Explorer by code. Currently, this is done using PureBasic's Compiler Menu --> Compiler Options --> Use Icon.Bisonte wrote:So I can set an icon by compiler options and have a window with no - icon... or have I something misunderstood ?