Displaying resource bitmaps

Started by paulDiagnos, February 19, 2009, 12:38:01 PM

Previous topic - Next topic

paulDiagnos

Hi guys, me again

why doesnt the below code work :-(

ImageHandle = SendMessage( HWND_messagebox_Logo, %STM_GETIMAGE, %IMAGE_BITMAP, 0)
If ImageHandle Then DeleteObject ImageHandle
ImageHandle = LoadImage(App.hInstance,"21", %IMAGE_BITMAP,100, 100,0)       
SendMessage  HWND_messagebox_Logo, %STM_SETIMAGE, %IMAGE_BITMAP, ImageHandle   


the idea is that resource 21 is loaded directly and displayed , rather than my usual trick of extracting the bitmap then loading that. (long winded way i know )

below is the resource line.

21 RCDATA DISCARDABLE "..\images\question.bmp"   

for some reason the file just wont display in the picture window.

Paul.

TechSupport

Instead of "21" use "#21".

Instead of "RCDATA" use "BITMAP".

Make sure that the SS_BITMAP property is set in the "WindowStyles" property for the PictureBox.

paulDiagnos

christ.

I spent about 2 days before xmas trying to do an icon version of it, and eventually worked out the # thing!! grrr

oh well if I learned from my mistakes id pester you guys less.

thanks again Paul.
your a trooper.

Paul