When I try to compile my program using RadASM, I get an error saying my icon file is not in 3.0 format.

How can I fix this?

My icon is 32x32 @ 16 colors, created using Paint. :tongue:

bad idea?
Posted on 2003-03-21 04:41:47 by Homer
I'm not sure Paint has proper suport for ICO files. You should download an ico-editor like Microangelo.
Posted on 2003-03-21 05:19:58 by Delight
Thanks!
That's an excellent program you pointed me to.

Well I've got the icon working for my .exe but the window icon is still the default Windows icon.
I can't find where this setting is in WNDCLASSEX. Am I looking in the right place?
Posted on 2003-03-21 06:18:12 by Homer
That's right Homer,

The window icon is in the hIcon and hIconSm fields of WNDCLASSEX. You can alternatively send the WM_SETICON message to you're window if want to change the Icon at runtime.

Donkey
Posted on 2003-03-21 06:42:17 by donkey
Hey Donkey,
I don't know why it's not working



invoke LoadIcon,hwnd,IDI_MYICON
mov wc.hIcon,eax
mov wc.hIconSm,eax

:confused:

I can see the icon in explorer, but it's not on the window... just that blasted Windows icon...

i made a really nice icon too :mad:
Posted on 2003-03-21 07:35:52 by Homer
invoke LoadIcon,hInstance,IDI_MYICON

Be sure that IDI_MYICON has the right value as well
Posted on 2003-03-21 07:38:04 by donkey
You're the best. :cool:

Sometimes I hate ASM but then I come here and all of a sudden...

ASM's so funnnnn :tongue:

btw.. RadASM is very nice. Now, my eyes aren't twitching from CVS as much.
Posted on 2003-03-21 07:41:30 by Homer
I'm trying to create a splash screen.
What's it mean when my .res file compiles to be around the size of my bmp but the .dll file is way smaller (definately not holding the Bitmap)?

Using RadASM (DLL Project), I tried using the Iczelion example source and same thing happens.

It must be my RadASM setting no? I just can't see how it creates the .res file and the .DLL file, yet the DLL file seems empty.
Posted on 2003-03-21 09:28:08 by Homer
It probably means that you are not linking the RES file after the assembly. Check the following :

From the PROJECT menu select "Project Options"

a dialog will appear, in the "Link" box it will say something like:

7,O,$B\LINK.EXE /SUBSYSTEM:WINDOWS /RELEASE /DLL /DEF:$6 /LIBPATH:"$L",3

add a ",4" to this line so it reads

7,O,$B\LINK.EXE /SUBSYSTEM:WINDOWS /RELEASE /DLL /DEF:$6 /LIBPATH:"$L",3,4

Donkey
Posted on 2003-03-21 09:45:20 by donkey
Nice.
:alright:



DllEntry proc hInst:DWORD, reason:DWORD, reserved1:DWORD
.if reason==DLL_PROCESS_ATTACH ; When the dll is loaded
push hInst
pop hInstance
call ShowBitMap
.endif
mov eax,TRUE
ret
DllEntry Endp

I see that Iczelion used ShowBitMap to show the bmp. Is there a method for showing jpgs?
Posted on 2003-03-21 20:39:59 by Homer
You would have to convert the JPG to a bitmap handle. There are plenty of threads on this, most end up using the IPicture OLE interface. See the RadASM\MASM\Projects\image\imagelib folder for Ernie's implementation of the interface. Conversely if you are going to put the image in you RES file, you can just convert it to a BMP before you add it using Irfanview or some other image handling software. I believe that V8 of MASM32 has new image handling commands that were derived directly from Ernie's imagelib routines.

Donkey

Here's one thread that demonstrates a method to do this

EDIT : I checked MASM32, It has the BitmapFromResource function that will probably meet your needs. RadASM has the IMAGE resource type available in the Resource utility that you have to use.
Posted on 2003-03-21 21:12:55 by donkey