JanetTerra
May 28, 2006
- "end function was missing last 'n'"
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.
function MakeButtonGraphic(hBttn,hGfx)
calldll #user32, "GetWindowLongA",hBttn as ulong,_
_GWL_STYLE as long,style as long
style=style or _BS_BITMAP
calldll #user32, "SetWindowLongA",hBttn as ulong,_
_GWL_STYLE as long,style as long,ret as long
calldll #user32, "SendMessageA",hBttn as ulong,_
_BM_SETIMAGE as long,0 as long,hGfx as ulong,_
MakeButtonGraphic as long
endfunctio function
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.
function MakeButtonGraphic(hBttn,hGfx)
calldll #user32, "GetWindowLongA",hBttn as ulong,_
_GWL_STYLE as long,style as long
style=style or _BS_BITMAP
calldll #user32, "SetWindowLongA",hBttn as ulong,_
_GWL_STYLE as long,style as long,ret as long
calldll #user32, "SendMessageA",hBttn as ulong,_
_BM_SETIMAGE as long,0 as long,hGfx as ulong,_
MakeButtonGraphic as long
end