Loaders
Loaders ...
Be aware that, because of some bugs in older Win32 Versions, your Resources should not exceed 0FFFF size. So, avoid loading big sound files or big BitMaps in Resources. Let them reside in files. The fitting equivalent functions do exist.
BitMap Loader
To allow BitMaps now, I have just written a little Loader instead of an Editor. I am unsure that, in this particular case (as there are so many good Editors available for free), that it would be of no interest to write another Editor for RosAsm.
RCDATA Loader
RC data are undefined resources. You can store what you want under this general purpose type. To retrieve RC Data resources, do:
GetRcDataPtr:
api 'KERNEL32.FindResourceA' D§hInstance eax &RT_RCDATA
api 'KERNEL32.LoadResource' D§hInstance eax
api 'KERNEL32.LockResource' eax
mov esi eax
ret
mov eax 1 ; ID number
call GetRcDataPtr ; >>> esi = Pointer to Data
Wave Loader
Like it says. To play a Resource Wave:
api 'WINMM.PlaySound' ID D§hInstance &SND_ASYNC__&SND_RESOURCE
Again, take care of size. I cannot implement an alert MessageBox because the limit size may vary depending on the Memory state and on the various Win32 releases. Resources are not a good place to store full Wave Files. You have the disk for this. See the File version of PlaySound in mmedia.hlp and MCI functions for files larger than 100 Kb.
Since V.2.004c, this Resources Size limitation has been removed, it remains nevertheless better to keep huge Resources on Disk.
Avi Loader
Avi in resources can only be silent ones (without sound). For the ones with sounds, see in Ron Thomas demo (AviDemo).
To play a Resource Avi, see ACM_OPEN / ACM_PLAY in Win32.hlp. Other files functions (with sounds are in WinMM.hlp).
Cursors Loader
As it says. To load a custom cursor from resources:
api 'User32.LoadCursorA' D§hInstance ID | mov D§CustomCursorHandle eax
To assign a Cursor to some Window at run time:
api 'User32.SetClassLongA' D§MyWindowHandle &GCL_HCURSOR D§CustomCursorHandle
Icons Loader
RosAsm manages two features for icons: the main Icon_Editor and an Icons loader for other Icons. Both work on the same resources Type. Main Icon ID is 1. The first 'other icon' ID is 2. The main Icon Editor is able to retrieve the fitting icon inside multi-icons files. The loader deals only with mono-icons file but they can be of any icon type.
~~~~~~~