How would I create a static window that functions as a picture box?
Posted on 2000-11-27 13:05:00 by plu
include SS_BITMAP style
Posted on 2000-11-27 19:06:00 by Iczelion
After creating a STATIC window using the SS_BITMAP stlye.. you load the bitmap using LoadImage or LoadBitmap function. you send the STM_SETIMAGE message to the static window. well I will try to give an example.. .data StaticClass db 'STATIC', 0 MyBmpPicture db 'c:\somwhere\thereis\thepic.bmp', 0 .data? mainHinst HANDLE ? mainHandle HWND ? staticHwnd HWND ? bmpHandle HBITMAP ? .code ; normal start program stuff invoke CreateWindow(ADDR staticClass, NULL, SS_BITMAP or WS_CHILD or WS_VISIBLE, 0,0,50,50, mainHandle, NULL, mainHinst, NULL); mov staticHwnd, eax invoke LoadImage, NULL, ADDR MyBmpPicture, IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR or LR_LOADFROMFILE ;should check to see if eax is null.. mov bmpHandle, eax ;well, if I didn't forget anything????? ;We should be able to load the ;bmp into the static control. invoke SendMessage, StaticHwnd, STM_SETIMAGE, IMAGE_BITMAP, bmpHandle
Posted on 2000-11-27 22:42:00 by tudisco
it works thanks alot!
Posted on 2000-11-27 23:56:00 by plu
glad it worked for you... ignore the (..) in the CreateWindow functions.. I always do that hahaha..
Posted on 2000-11-28 12:20:00 by tudisco