ll_libload user, "user32.dll"
ll_getproc DestroyIcon, "DestroyIcon", user
ll_getproc DrawIconAPI, "DrawIcon", user // 関数名に使いたいので末尾にAPIを付けた
ll_libload shell, "shell32.dll"
ll_getproc ExtractIcon, "ExtractIconA", shell
#module
#deffunc drawicon str, int
mref file, 32 : mref no, 1
mref bmscr, 67
prm = bmscr.14, 0, no
ll_getptr file : ll_ret prm.1
ll_callfunc prm, 3, ExtractIcon@ : ll_ret h
if h {
prm = bmscr.4, csrx, csry, h
ll_callfunc prm, 4, DrawIconAPI@
ll_callfunc h, 1, DestroyIcon@
redraw 1 // APIから直接描画した場合は画面を更新しなければならない
}
return
#global
dialog "ico", 16, "読み込むアイコン"
if stat : pos 50, 50 : drawicon refstr // アイコン読込
stop
|