A while ago I asked if anyone knew how draw a bitmap onto a dialog box, to achieve the same sort of affect as the large 'icon' in the WinWord About box. Thanks to everyone who replied. The following is the method I used:
[ABOUT.DLG - The dialog definition file]
DLGINCLUDE RCDATA DISCARDABLE
BEGIN
"ABOUT.H\0"
END
/* ABOUT.H #defines IDI_ABOUT 101 */
/* This line references a bitmap file to be used on the dialog */
Hopefully, the above code is fairly simple to follow. The first 3 lines initialise the working variables for this section of code. hAboutBitmap is a handle to the bitmap, while hDCAbout and hDCMem are DCs for the About box and a memory block respectively.
The next line is the only method I could use to get a DC for the about frame. If anyone knows of less ugly method, please let me know (I have an aversion to functions which use information from functions in their parameter list). Then the program creates a compatible memory DC into which the bitmap can be selected.
The bitmap is then loaded. Note that "About" is the name assigned to the bitmap in the .dlg file earlier. We then select the bitmap into memory DC, ready for blitting. Bitblt then blits the contents of the memory DC (the bitmap) onto the about frame DC. Is this the simplest way of doing it, or is there a method of blitting without the need to first select the bitmap into the memory DC? It does seem to be a longwinded way of going about it.
The last three lines just delete the three resources that were used by the program.
My thanks again to those who responded to my original posting.
Rgds, Nik
---
_/ _/ _/_/_/ _/ _/ For those who are wondering why,
_/_/ _/ _/ _/ _/ What we call SF ain't Sci-Fi,
_/ _/ _/ _/ _/_/ It's just there a fine line
_/ _/_/ _/ _/ _/ Between Robert Heinlein,
_/ _/ _/_/_/ _/ _/ And "Son of the Two Headed Fly"