Hi, i need to display a little bmp image in a window just on a certain event. I would like to do this without calling BeginPaint in the Paint event, becouse this involve paint structures and hdc. Maybe there is an easy way. Thanks Angelo
Posted on 2001-03-07 17:43:00 by angelo
Dunno if its really any easier, but you could define a dialog resouce with only the bitmap (defined in the resource) then call DailogBoxParam to display the dialog box.. You will need to create a DlgProc.. but you only have to support for messages you need to.. (in this case you will need to initialize the Bitmap labeled in your resouce in a INITDIALOG messaged.. Dialog Proc..

 .if diMsg==WM_INITDIALOG
              
       invoke GetModuleHandle, NULL
       invoke LoadBitmap, eax, 100 ; resource ref.
       mov hBitmap, eax
              
       invoke GetDlgItem, DWnd, ID_THIS
       invoke SendMessage,eax,BM_SETIMAGE,IMAGE_BITMAP,hBitmap
   ...
  .else
     xor eax, eax
     ret
  .endif
  mov eax, 1
  ret
In your resouce file:

     100     BITMAP "nan.bmp"
     LTEXT    "", ID_THIS, 	4,52,60,28, BS_BITMAP
I didnt test this.. but i think it should work.. NaN
Posted on 2001-03-07 18:24:00 by NaN
Nan thanks a lot, i'm going to try
Posted on 2001-03-08 13:54:00 by angelo