WinWatch recognizes several other types of resources that you probably won’t need to use in Visual Basic.
For example, most programs written in C and other languages have dialog resources. You can load these with the CreateDialog (modeless) or DialogBox (modal) function. You can see the dialog boxes on screen, but you would still need a window procedure to handle all the dialog events. You could probably attach a window procedure using the AddressOf operator, but if you didn’t create the dialog resource, you wouldn’t know how to write the window procedure. Of course, you could design your own dialog boxes with a resource editor, embed the resource in your Visual Basic program, and write a window procedure to handle the dialog events. But what’s the point? Forms are better. If you have a good reason to try this, you’re on your own.
The same with accelerators and menus. You probably won’t know how to use somebody else’s, and you won’t need to use your own. Despite the obvious foolishness of loading the menus of another program, it’s so easy that I couldn’t resist doing it in WinWatch. I’m not going to show you how to install a menu resource with LoadMenu, GetMenu, and SetMenu, but you can see the code in the ShowMenu procedure in WINWATCH.FRM. The effect of seeing the normal WinWatch File menu replaced with the menus of some foreign program is disconcerting but amusing.
WinWatch could probably handle fonts using techniques similar to those shown for icons and bitmaps. There is an OleCreateFontIndirect API function that promises to work a lot like OleCreatePictureIndirect. I didn’t try it, partly because I’ve never encountered a 32-bit executable file that has a font embedded as a resource. Generally, I’ve found the Visual Basic font mechanism adequate, but I’m sure you could find some use for API functions to deal with fonts.
The situation is similar for metafiles. Nothing prevents you from embedding them as resources, although I’ve never found a metafile resource in any of the programs I’ve looked at with WinWatch. If you ever did find such a resource, you could load it with LoadImage and convert it to a picture with my MetafileToPicture function (PICTOOL.BAS).
If you use WinWatch to compare programs written in Visual Basic with those written in C and other languages, you’ll notice an important difference. Visual Basic programs have menus, dialogs, and accelerators, but they don’t store the data in resources. This is a change. If you used the old 16-bit version of WinWatch to examine Visual Basic version 3 programs, forms appeared to be some type of dialog resource. The current Visual Basic apparently implements menus, dialogs, and accelerators by creating them at run time rather than using resources.