I have created a dll file using your Rod-Ex program:
http://www.autohotkey.com/forum/topic30228.html
it contains all png files except 9012 which is a jpg
I can not get any of them to display. Here is my code - i created a loop to display all the images so that i knew which was which:
Code:
Gui, Margin, 0, 0
resfile:=A_ScriptDir . "\resource.dll"
rescount:=9000
maxres:=9013
hModule := DllCall( "GetModuleHandle", Str, resfile )
loop
{
if (rescount>=maxres)
break
hResource := DllCall("FindResource", UInt,hModule, UInt,rescount, UInt,10)
;msgbox,,, hresource%rescount% : %errorlevel%,.5
nSize := DllCall("SizeofResource", UInt,hModule, UInt, hResource)
;msgbox,,, nsize : %errorlevel%,.5
hResData := DllCall("LoadResource", UInt,hModule, UInt,hResource )
;msgbox,,, hresdata : %errorlevel%,.5
Buffer := DllCall("LockResource", UInt, hResData )
;msgbox,,, buffer : %errorlevel%,.5
; Converting Image data to hBITMAP ; Thanks Sean
; http://www.autohotkey.com/forum/viewtopic.php?t=22999
hData := DllCall("GlobalAlloc", UInt,2, UInt, nSize )
;msgbox,,, hdata : %errorlevel%,.5
pData := DllCall("GlobalLock", UInt,hData )
;msgbox,,, pdata : %errorlevel%,.5
DllCall( "RtlMoveMemory", UInt,pData, UInt,Buffer, UInt,nSize )
;msgbox,,, rtlmovememory : %errorlevel%,.5
DllCall( "GlobalUnlock", UInt,hData )
;msgbox,,, globalunlock : %errorlevel%,.5
DllCall( "ole32\CreateStreamOnHGlobal", UInt,hData, Int,True, UIntP,pStream )
;msgbox,,, ole32 : %errorlevel%,.5
DllCall( "LoadLibrary", Str,"gdiplus" )
;msgbox,,, loadlibrary : %errorlevel%,.5
VarSetCapacity(si, 16, 0), si := Chr(1)
DllCall( "gdiplus\GdiplusStartup", UIntP,pToken, UInt,&si, UInt,0 )
;msgbox,,, gdiplusstartup : %errorlevel%,.5
DllCall( "gdiplus\GdipCreateBitmapFromStream", UInt,pStream, UIntP,pBitmap )
;msgbox,,, gdipluscreatebitmap : %errorlevel%,.5
DllCall( "gdiplus\GdipCreateHBITMAPFromBitmap", UInt,pBitmap, UIntP,hBitmap, UInt,0 )
;msgbox,,, gdipluscreatebitmapfrombitmap : %errorlevel%,.5
pichandlename:="pic" . rescount
gui,add,text,,%rescount%
Gui, Add, Text, +0xE hWnd%Pichandlename% ; +0xE is SS_BITMAP
pichandle:=%pichandlename%
SendMessage, (STM_SETIMAGE:=0x172), (IMAGE_BITMAP:=0x0), hBitmap,, ahk_id %Pichandle%
msgbox ,,,pichandle:%pichandle%.%pichandlename%.%rescount%,3
rescount++
}
Gui, Show,h600 w1000, SoggyDog
;msgbox pauseing
DllCall( "gdiplus\GdipDisposeImage", UInt,pBitmap )
DllCall( "gdiplus\GdiplusShutdown", UInt,pToken )
DllCall( NumGet(NumGet(1*pStream)+8 ), UInt,pStream )
Return
GuiClose:
GuiEscape:
ExitApp
Return
here is a link to my resource.dll :
http://www.mediafire.com/?4zsmv9eyljj
However, when I embed the same images into the exe, they do display, which must mean something is wrong with the dll?