KcDan
May 27, 2006
- "Fixed the way the code looked"
Some people may desire a different style of bitmap buttons. The kind LB has native when pressed inverts the color and nothing happens when you roll over the button, so it may look a bit ugly in some applications. The Windows native way of doing this is having a button with the style _BS_BITMAP and the sending the message _BM_SETIMAGE with the handle of the graphic. Heres a function I made that simplifies this process, all you have to do is supply that with the handle of the button and the handle to the graphic and it will do everything for you.|| functionfunction MakeButtonGraphic(hBttn,hGfx)calldllcalldll #user32, "GetWindowLongA",hBttn as ulong,__GWL_STYLE_GWL_STYLE as long,style as longstyle=stylestyle=style or _BS_BITMAPcalldllcalldll #user32, "SetWindowLongA",hBttn as ulong,__GWL_STYLE_GWL_STYLE as long,style as long,ret as longcalldllcalldll #user32, "SendMessageA",hBttn as ulong,__BM_SETIMAGE_BM_SETIMAGE as long,0 as long,hGfx as ulong,_MakeButtonGraphicMakeButtonGraphic as longend function ||end functio