> ¤â¤·¡¢PrivateExtractIcons °Ê³°¤Ç 48x48 ¥µ¥¤¥º¤Î¥¢¥¤¥³¥ó¤òÆÉ¤ß¹þ¤àÊýË¡¤¬¤¢¤ì¤Ð¶µ¤¨¤Æ²¼¤µ¤¤><
ľÀÜ48¡ß48¤Î¥¢¥¤¥³¥ó¤Ï¼èÆÀ¤Ç¤¤½¤¦¤â¤Ê¤¤¤È»×¤¤¤Þ¤¹¡£
¤½¤³¤Ç SHGetFileInfo ´Ø¿ô¤Ç32¡ß32¤Î¥¢¥¤¥³¥ó¤ò¼èÆÀ¤·¤Æ¡¢
DrawIconEx ´Ø¿ô¤Ç48¡ß48¤Î¥µ¥¤¥º³ÈÄ¥¤·¤ÆÉÁ²è¤¹¤ë¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡£
¢¬
32¡ß32¤ò48¡ß48¤Ë³ÈÄ¥¤¹¤ë¤Î¤Ç¸«±É¤¨¤ÏÎɤ¯¤Ê¤¤¤«¤â¤Í¡£
¤À¤«¤é exe ¥Õ¥¡¥¤¥ë¤À¤±¤Ï PrivateExtractIcons ¤Ç¼èÆÀ¤·¤Æ¡¢
¤½¤ì°Ê³°¤Î¥Ç¡¼¥¿¡¦¥Õ¥¡¥¤¥ë¤Ï SHGetFileInfo¡ÜDrawIconEx ¤Ë¤¹¤ë¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡£
//------------------------------------------------------------------------------
// 48¡ß48¥¢¥¤¥³¥ó¤Î¼èÆÀ¥µ¥ó¥×¥ë
//------------------------------------------------------------------------------
//--------------------------------------
// Win32API´Ø¿ô¤ÎÌ¿ÎáÅÐÏ¿
//--------------------------------------
#uselib "User32.dll"
	#func DrawIconEx		"DrawIconEx"		sptr,sptr,sptr,sptr,sptr,sptr,sptr,sptr,sptr
	#func DestroyIcon		"DestroyIcon"		sptr
	#func InvalidateRect	"InvalidateRect"	sptr,var,sptr
#uselib "Shell32.dll"
	#func ExtractIconEx		"ExtractIconExA"	sptr,sptr,sptr,sptr,sptr
	#func SHGetFileInfo		"SHGetFileInfoA"	sptr,sptr,var,sptr,sptr
//--------------------------------------
// Win32API´Ø¿ô¤Îµ¹æÄê¿ô
//--------------------------------------
#const NULL					$00000000
#
#const DI_MASK				$00000001
#const DI_IMAGE				$00000002
#const DI_NORMAL			$00000003
#const DI_COMPAT			$00000004
#const DI_DEFAULTSIZE		$00000008
#
#const SHGFI_LARGEICON		$00000000	;get large icon
#const SHGFI_SMALLICON		$00000001	;get small icon
#const SHGFI_ICON			$00000100	;get icon
//--------------------------------------
// ÎóµóÄê¿ô(SHFILEINFO)
//--------------------------------------
#enum sfi_hIcon=0						;icon
#enum sfi_iIcon							;icon index
#enum sfi_dwAttributes					;SFGAO_ flags
#enum sfi_szDisplayName					;display name
#enum sfi_szTypeName=sfi_szDisplayName+(260/4)
#enum DIM_SHFILEINFO=sfi_szTypeName+(80/4)
#enum SIZE_SHFILEINFO=(DIM_SHFILEINFO*4)
//--------------------------------------
// ¥á¥¤¥óÉô
//--------------------------------------
*Init
	n=-1
	n++:strFile(n)=dir_exe+"\\common\\hspext.as"
	n++:strFile(n)=dir_exe+"\\common\\a2d.hsp"
	n++:strFile(n)=dir_exe+"\\common\\common.txt"
	n++:strFile(n)=dir_exe+"\\hsp3.exe"
	n++:strFile(n)=dir_exe+"\\hsptv.exe"
*Main
	title "48¡ß48¥¢¥¤¥³¥ó¤Î¼èÆÀ¥µ¥ó¥×¥ë"
	foreach strFile
		pos cnt*100+20, 20:mes "32¡ß32":DrawFileInfoIcon strFile(cnt),32,32,1
		pos cnt*100+20,120:mes "48¡ß48":DrawFileInfoIcon strFile(cnt),48,48,1
		pos cnt*100+20,220:mes "64¡ß64":DrawFileInfoIcon strFile(cnt),64,64,1
	loop
	stop
//--------------------------------------
// ¥Õ¥¡¥¤¥ë¤Î¥¢¥¤¥³¥ó¤òÉÁ²è
//--------------------------------------
#deffunc DrawFileInfoIcon str _fname_,int _sx_,int _sy_,int _redraw_,\
	local BMSCR,\
	local SHFILEINFO,\
	local rc
	
	mref BMSCR,67
	dim SHFILEINFO,DIM_SHFILEINFO
	SHGetFileInfo _fname_,0,SHFILEINFO,SIZE_SHFILEINFO,(SHGFI_ICON|SHGFI_LARGEICON)
	if(stat==0){
		ExtractIconEx "SHELL32.dll",109,varptr(SHFILEINFO.sfi_hIcon),NULL,1
	}
	DrawIconEx hDC,ginfo_cx,ginfo_cy,SHFILEINFO.sfi_hIcon,_sx_,_sy_,0,NULL,DI_NORMAL
	DestroyIcon SHFILEINFO.sfi_hIcon
	if(_redraw_){
		dim rc,4
		rc(0)=BMSCR(27)
		rc(1)=BMSCR(28)
		rc(2)=BMSCR(27)+_sx_
		rc(3)=BMSCR(28)+_sy_
		InvalidateRect hWnd,rc,1
	}
	return
//------------------------------------------------------------------------------
// End of sample77.hsp
//------------------------------------------------------------------------------
¢¬
¤³¤ó¤Ê´¶¤¸¤Ç¤¹¤Í¡£