How would I create a static window that functions as a picture box?
include SS_BITMAP style
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
it works thanks alot!
glad it worked for you... ignore the (..) in the CreateWindow functions.. I always do that hahaha..