I'm creating a free Icon library in C# with source code include, it already
support .ico/.dll../exe and I'd like to support .ICL format too, I need to
load a file .ICL (Icon Library) that basically it is a 16-bit dll and then
after that I can extracts and insert icons inside.
I tried the only function in Win32API left for 16bit (LoadModule), it loads
the library but Windows starts to give strange message boxes, as "Not enough
memory to run 16-bit applications" or things like that.
So, do you know a way to load 16bit dll (New Executable format) in Win32? Or
how to read/write .ICL files?
Any kind of information RFC/Articles/News everything related to ICL file can
be useful and will be apreciated.
Thanks a lot.
Gustavo.
"MsNews" <som...@hotmail.com> wrote in message
news:uwKRmM%237GH...@TK2MSFTNGP02.phx.gbl...
193 - ERROR_BAD_EXE_FORMAT (Is not a valid application.)
Then to make sure was not because of the ICL, I uncompress a Win3.1
installation and I tried to load some dlls as PBRUSH.DLL and I got the same
result.
So, I don't know what else to use to load this kind of resources.
Gustavo.
"Chris Becke" <chris...@gmail.com> wrote in message
news:uMVBGdT8...@TK2MSFTNGP02.phx.gbl...
>When I tried that, the library (ICL) did not load and it gives, the
>following error on GetLastError();
>
>193 - ERROR_BAD_EXE_FORMAT (Is not a valid application.)
>
>Then to make sure was not because of the ICL, I uncompress a Win3.1
>installation and I tried to load some dlls as PBRUSH.DLL and I got the same
>result.
>
>So, I don't know what else to use to load this kind of resources.
The NE file format is not really very complicated. Just open the file
using the standard file APIs and read it yourself. There must still be a
bunch of NE resources on the web.
--
- Tim Roberts, ti...@probo.com
Providenza & Boekelheide, Inc.
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q65122
Doesn't look too complicate, the problem is if I open and process the file I
won't get a valid Windows Handle, and will not be able to use the APIs like
LoadResource, FindResource, BeginUpdateResource, LoadIcon, etc.
I was reading that those APIs works under 32 and 16 bits, the problem is how
to get a handle to the module.
If I don't load the NE in the way Windows does, then I will have to
implement all those APIs myself, that means also I have to know and parse
the Resources format too inside the NE.
If I can get a 16bits load in memory as a DataFile and get a HMODULE handle
to it, the rest should be piece of cake using standards Windows APIs
Gustavo.
"Tim Roberts" <ti...@probo.com> wrote in message
news:7vbbj2t269pupqp2l...@4ax.com...
By parsing the file yourself, you would need to write your own LoadResource
function, however after reading the raw data into memory you can still use
for example CreateIconFromResource for all the image manipulation.
All the functions that work on HMODULEs are designed for PE-format
executables.
>
> I was reading that those APIs works under 32 and 16 bits, the problem is
> how to get a handle to the module.
The file doesn't contain a PE module.
>
> If I don't load the NE in the way Windows does, then I will have to
> implement all those APIs myself, that means also I have to know and parse
> the Resources format too inside the NE.
The way Windows loads 16-bit programs is through wowexec. You can probably
use its APIs. See http://www.microsoft.com/msj/0898/hood0898.aspx
I just wanted to create a .ico file and now I'm swimming in deep waters to
understand MZ files and how to parse obsolete executables....
How I came here :)... the worst think is that the curiosity doesn't let me
go back to the library, I'm not interested in continue or publish it without
first at least know how to parse an ICL file.
Gustavo.
"Ben Voigt" <r...@nospam.nospam> wrote in message
news:%23LP16kt...@TK2MSFTNGP03.phx.gbl...
You could just write a 16-bit helper program that opens the dll, extracts
all the icons into standard format .ico files, then use those from your main
program.
If I can extract the icons from the ICL is one big step, but still it is not
useful, because provide an application/library to open/read ICL (Icon
libraries) without able to change it, doesn't worth too much.
"Ben Voigt" <r...@nospam.nospam> wrote in message
news:uBz2DWv8...@TK2MSFTNGP05.phx.gbl...
http://www.codeproject.com/useritems/IconLib.asp
Regards,
Gustavo.
"MsNews" <som...@hotmail.com> wrote in message
news:uwKRmM%237GH...@TK2MSFTNGP02.phx.gbl...
Take a look at:
http://benoit.papillault.free.fr/c/disc2/exefmt.txt
http://www.itee.uq.edu.au/~csmweb/decompilation/new_exe.html
They appear to document the MZ/NE executable format.
1. Open a binary file to the executable/dll.
2. Find the NE header by looking at the MZ header.
3. Locate the resource table segment in the NE header.
4. You should then be able to iterate over the resources one by one.
Haven't completed any work like that for a while and certainly not in .NET
but it should be fairly trivial once you get into it.
Looking in the Platform SDK in WINNT.H; if you search for MZ below that it
defines the structures referenced in the above documents.
HTH
- Andy
"MsNews" <som...@hotmail.com> wrote in message
news:uwKRmM%237GH...@TK2MSFTNGP02.phx.gbl...
Those kind of source is exactly what I used to read/write ICL files.
Take a look at the article I wrote about Icons.
http://www.codeproject.com/useritems/IconLib.asp
Regards,
Gustavo.
"Andy Bates" <an...@ussdev.com> wrote in message
news:%23EIN2i5...@TK2MSFTNGP04.phx.gbl...
I read your article. Much impressed!
Regards,
Cyril Gupta
- You can do anything with a little bit of 'magination.
- I've been programming so long, my brain is now soft-ware.
M> Yep,
M>
M> Those kind of source is exactly what I used to read/write ICL files.
M>
M> Take a look at the article I wrote about Icons.
M>
M> http://www.codeproject.com/useritems/IconLib.asp
M>
M> Regards,
M> Gustavo.
M> "Andy Bates" <an...@ussdev.com> wrote in message
M> news:%23EIN2i5...@TK2MSFTNGP04.phx.gbl...
M>