What file to change?

Miscellaneous Forums/General Discussion/What file to change?

Hey, i'm messing with that icon changer in the toolbox under misc. is there a tutorial or can someone tell me how to go about changing the .exe icon of a blitz3D compiled program?

Dont know if this is what you want:-

http://web.archive.org/web/20040808052027/www.blitzcoder.com/cgi-bin/articles/show_article.pl?f=gamezipperhead07082002.html

I keep on forgetting some of BC stuff is archived! :)

Dabz

Google for Microangelo. I believe someone else recently found a free tool that's supposedly just as good.

Hmm, thanks Dabz... i thought you just change a bitmap image in a blitz3d .res file... then compile the program and it takes that image... is there a way to do this?

I believe someone else recently found a free tool that's supposedly just as good.
Wasn't this, was it?

Its a great icon creator but it doesn't let you embed icons into EXEs.

I normally use resourcehacker to change the icon. I didn't know there was a way to do it at compilation time (unless some custom IDEs allow it?)

http://www.angusj.com/resourcehacker/

Alright, well whats a good tool to turn a 32x32 bmp image (ico) into a .ico file? can i just use that bmp image?

Well, theres the code archives:-

http://blitzbasic.com/codearcs/codearcs.php?code=805

:)

Dabz

Its a great icon creator but it doesn't let you embed icons into EXEs.
Ah, okay. Microangelo it is then.

Dabz!! thanks ! thats perfect, so simple!

\o/

Hmm, how about getting the icon on the window? in windowed mode?

http://web.archive.org/web/20040824012458/http://www.blitzcoder.com/

:)

Dabz

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

There's a freeware "ResourceHacker" that does the job.

What about Alpha? it seems that bitmap -> .ico in the code archives doesnt do alpha? how do i pull alpha off? not a blocky image, but parts where the background shows through

Erm, last but not least:-

http://www.blitzbasic.com/toolbox/toolbox.php?tool=159

:)

Dabz

Dabz, kinda a late responce but: i must be doing somthing wrong with the .decls file... i copy and paste that bottom thing into notepad, (got rid of the ";"'s) saved the file as user32.decls and put it in the userlibs folder, and added the functions ect into the program like normal, but when trying to compile i get " function getactivewindow doesnt exsit" or somthing along those lines.

I've tried it and it works fine here:-


.lib "user32.dll"
User32_GetActiveWindow%():"GetActiveWindow"
User32_SetClassLong%( hWnd, nIndex, dwNewLong ):"SetClassLongA"

.lib "Shell32.dll"
LoadIcon%(hWND%,File$,Index%) : "ExtractIconA"


Make sure you have actually saved it as blah.decls, not, blah.decls.txt, which sometimes happens when saving it in notepad and not selecting 'All Files' in the 'save as type' drop down list box.

Dabz

am i missing some .dll file? i notice ".lib "user32.dll"" ??

That should be in your C:/WINDOWS/System32 folder! I highly doubt its missing though?

Dabz

If you go here:-

http://www.syntaxbomb.com/forum/index.php/topic,517.0.html

And scroll a little down, you should see a link for a little thing I posted for someone, try that! :)

Dabz

OK, i got the .decls file to work, it highlights in blitz as if its a part of the command set, and it compiles fine, but whats this? it doesnt work!! no icon on the window :( :(

i think it shows it in the tray down there, (because this a a fresh compiled program i didnt change the exe icon yet) and its showing the icon i made in photoshop down at the bottom, still the same wierd "window" looking icon in the window though


even when using the above code:

; -------------------------------------------------------------------------------
; 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"


So...why isn't this basic feature part of the IDE, then? I've had trouble getting this to work as well.

I shouldn't have to hack the exe or jump through any hoops to do something as simple as this.

Still have not been able to get this to work, all .decls are installed, everything works, it puts the icon in the task tray down there, but not in the window itself... here is the code:

; -------------------------------------------------------------------------------
; 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"


and does the above example work on your pc ? i may just be me

any ideas? :\

resourcehacker is what i use for b3d and max

But resH doesnt change the icon in the window... how do i change that ... :(