ll_libload user, "user32.dll"
ll_getproc GetWindowLong, "GetWindowLongA", user
ll_getproc SetWindowLong, "SetWindowLongA", user
ll_getproc LoadImage, "LoadImageA", user
#module
#deffunc loadbuttonimage int, str
mref id, 0 : mref file, 33
mref bmscr, 67
getpath k, file, 2
if k = ".bmp" : flg = 0 : else : flg = 1
i = id + 41 : i = bmscr.i
prm = i, -16
ll_callfunc prm, 2, GetWindowLong@
ll_ret i
prm.2 = 0x0080 - (0x0040 * flg) | i
ll_callfunc prm, 3, SetWindowLong@
ll_getptr file : ll_ret i
prm = 0, i, flg, 0, 0, 0x0010 // LR_LOADFROMFILE
ll_callfunc prm, 6, LoadImage@
ll_ret i
objsend id, 0x00F7, flg, i, 1 // BM_SETIMAGE
return
#global
objsize 120, 90
pos 10, 10 : button "画像指定", *change
stop
*change
dialog "bmp;*.ico;*.cur", 16, "ボタンに表示する画像"
if stat = 1 {
loadbuttonimage 0, refstr
}
stop
|