Re: win32lib, LV's and icons
- Posted by cafromsw at yahoo.com Jan 14, 2003
- 464 views
Update; I have just tested extractIconEx() on a Win98 2nd edition system and it seems to work just fine. I haven't been able to test on Win98 1st edition. I think that there might be some problems if font or icon sizes have been changed markedly from the Windows defaults. Other than that most people should see improved results though. Chris cafromsw at yahoo.com --- cafromsw at yahoo.com wrote: > > I have just found out that my extractIconEx() routine > isn't working under Win98. I have tested it on > WinME > and on WinXP, and it seems to run ok on those > platforms. As soon as I get a system loaded with 98 > I > will try to figure out and fix the problem. Chris > cafromsw at yahoo.com > > --- cafromsw at yahoo.com wrote: > > > > Wolf pointed out to me that I was incorrectly use > > peek4signed when I should have been using > > peek4unsigned which could have caused some > problems > > with error checking, thanks. I also realized that > > my > > extractIconEx didn't cohabitate with win32libs > > addIcon(extractIcon()) pair. I have slightly > > rewritten the routine to take both of these things > > into account. It can still be found here; > > http://home.attbi.com/~sea.star/code/lvextras.ew > > I have converted the tabs to spaces so it should > > copy > > better now, or a right-click save would work. As > > before it need to be pasted into win32lib.ew. I > will > > also paste it into this post per Dan's suggestion. > > > Yahoo mail has a really narrow text box for > writing > > emails so it breaks the lines in wierd places. I > > have > > also rewritten the routine to test extractIconEx. > > It > > now calls addIcon(extractIcon()) then > > extractIconEx() > > so you can see the difference between the two > calls. > > > > Any problems or suggestions are always welcome. > > Chris > > cafromsw at yahoo.com > > > > --paste into win32lib.ew-------------- > > -- Version 2003.01.12a CMA > > -- Routines to extract both large (32x32) and > small > > (16x16) icons from .ico, .dll and .exe files > > -- for use in ListViews that need both sizes. Can > > also be used as a replacement for > > -- NewIco &= > addIcon(extractIcon({"shell32.dll",1})) > > -- Example: > > -- NewIco &= extractIconEx({"shell32.dll", 1}) > > -- both examples return an index to the image list > > for > > use in ListViews etc. > > -- can be used as a replacement for or in > conjuction > > with addIcon(extractIcon()) > > > > > > global constant > > xExtractIconEx = registerw32Function(shell32, > > "ExtractIconEx", {C_POINTER, C_INT, C_POINTER, > > C_POINTER, C_INT}, C_INT) > > > > --global function extractIcon( sequence Filename ) > > > > > -- REM'd by CMA 1.10.03 > > global function extractIconEx( sequence Filename ) > > > > > -- added by CMA 1.10.03 > > atom icon > > > > > -- REM'd by CMA 1.12.03 > > integer lIdx > > > > atom lgico, smico > > > > > -- added by CMA 1.10.03 > > object hIcon > > > > > -- added by CMA 1.12.03 > > > > lIdx = 0 > > if length(Filename) > 0 then > > if sequence(Filename[1]) then > > lIdx = Filename[2]-1 > > Filename = Filename[1] > > end if > > end if > > > > lgico = acquire_mem(0, Long) > <snip> > > > >