Aggg, that didnt work! :)
Grisu's code archive:-
; -------------------------------------------------------------------------------
; Simple demo to demonstrate how to change the Window and Taskbar Icon in Blitz
; -------------------------------------------------------------------------------
;
; Instructions:
; 1. Copy the "user32.decls" at bottom in your userlib folder
; 2. Place a "demo.ico" in your program folder
; 3. Compile this source code
; 4. Use "TAB" to switch between tasks
;
; Thanks to BinaryMoon to point that out!
;
; P.S.: Tested with B+ and B3D
Graphics 640,480,16,2 ; set GFX Window
AppTitle "Icon Demo" ; App-Name
If FileType("demo.ico")= 1 Then appicon("demo.ico") ; If icon exisits display it in Taskbar and Window Title
While Not KeyHit (1) ; main loop
Cls
If FileType("demo.ico")= 1 Then Text 10,10,"Icon 'demo.ico' has been installed!"
Text 10,40, "Press ESC to exit"
Wend ; end of mainloop
End ; end of program
; ------------------------------------------------------------------------------
; Set the current application icon by BinaryMoon
; ------------------------------------------------------------------------------
Function AppIcon(icon$)
hWND=User32_GetActiveWindow()
icon=LoadIcon(hwnd,icon,0)
User32_SetClassLong hwnd,-14,icon
End Function
; ------------------------------------------------------------------------------
; 1. Save the following lines as "user32.decls"
; 2. place it into your userlib folder
; ------------------------------------------------------------------------------
;
; .lib "user32.dll"
; User32_GetActiveWindow%():"GetActiveWindow"
; User32_SetClassLong%( hWnd, nIndex, dwNewLong ):"SetClassLongA"
;
; .lib "Shell32.dll"
; LoadIcon%(hWND%,File$,Index%) : "ExtractIconA"
Dabz
Grisu's code archive:-
; -------------------------------------------------------------------------------
; Simple demo to demonstrate how to change the Window and Taskbar Icon in Blitz
; -------------------------------------------------------------------------------
;
; Instructions:
; 1. Copy the "user32.decls" at bottom in your userlib folder
; 2. Place a "demo.ico" in your program folder
; 3. Compile this source code
; 4. Use "TAB" to switch between tasks
;
; Thanks to BinaryMoon to point that out!
;
; P.S.: Tested with B+ and B3D
Graphics 640,480,16,2 ; set GFX Window
AppTitle "Icon Demo" ; App-Name
If FileType("demo.ico")= 1 Then appicon("demo.ico") ; If icon exisits display it in Taskbar and Window Title
While Not KeyHit (1) ; main loop
Cls
If FileType("demo.ico")= 1 Then Text 10,10,"Icon 'demo.ico' has been installed!"
Text 10,40, "Press ESC to exit"
Wend ; end of mainloop
End ; end of program
; ------------------------------------------------------------------------------
; Set the current application icon by BinaryMoon
; ------------------------------------------------------------------------------
Function AppIcon(icon$)
hWND=User32_GetActiveWindow()
icon=LoadIcon(hwnd,icon,0)
User32_SetClassLong hwnd,-14,icon
End Function
; ------------------------------------------------------------------------------
; 1. Save the following lines as "user32.decls"
; 2. place it into your userlib folder
; ------------------------------------------------------------------------------
;
; .lib "user32.dll"
; User32_GetActiveWindow%():"GetActiveWindow"
; User32_SetClassLong%( hWnd, nIndex, dwNewLong ):"SetClassLongA"
;
; .lib "Shell32.dll"
; LoadIcon%(hWND%,File$,Index%) : "ExtractIconA"
Dabz