#include "llmod.as" #include "img.as" #include "progbox.as" #include "trackbox.as" #include "obj.as" ;アイコンファイルを含んでいるファイルを調べるプログラム ;---------------------------------------------------- ;1つめのwindowに配置するオブジェクト screen 0,780,560 objmode 2 font "FixedSys" objsize winx/2,25 button "アイコン検索",sel_wnd2 sdim files,1024*512 ;ファイルリストを保存する変数 sdim s, 1024*64 sdim buf, 1024*64 last_y=csry combox cbx_select_item,300,files : cbx_id=1 ;ファイルリスト表示用 pos winx/2,last_y button "リストクリア",clr_list last_y=csry pos winx/2,0 button "終了",endp ;---------------------------------------------------- ;2つめのwindowに配置するオブジェクト #define SECOND_WINDOW 2 screen SECOND_WINDOW,680,400 objmode 2 font "FixedSys" cls 1 sdim dir, 256 getptr prm,dir prm.1=64 dllproc "GetSystemDirectoryA",prm,2,D_KERNEL mask="*.exe" s="" mesbox s,winx,40,2 : mesbox0_id=0 pos 0,40 input dir,300,30 ;検索するフォルダを入力する所 input mask,300,30 ;マスクを入力する所 py=csry button "検索",search_icon sdim ffile,1024*128 ;検索結果を入れるバッファ sdim ffile_copy,1024*128 ;検索結果を入れるバッファ2 pos 0,csry+5 x=winx-6 y=winy-csry-27 mesbox ffile,x,y : mesbox1_id=4 ;検索結果を表示する所 pos 80,py+5 progbox 200,20 ;プログレスバーの作成 pos 100+200,py-60 s="1個以上のアイコンを持つファイルを探す" mesbox s,350,25,2 : mesbox2_id=5 pos 100+200,py-30 trackbox 350,25,$100 ;トラックバーの作成(ツールチップを持たせる) track_id=stat trackrng 1,200 ;範囲を1から100に設定 objsize 180,22 pos 100+200,py button "結果をリストに加える",add_to_list pos 300+190,py button "終了",endp gsel 0,1 goto main_loop *x1 ; ;アイコンの表示 ; gsel 0 color 255,255,255 boxf 0,0,winx,winy color sdim filename, 256 notesel files noteget filename,cbx_select_item ;ファイルリストで選択されているものを取得 instr c, filename, "\"" : if c>0 : poke filename, c, 0 get_icon hicon,filename,-1 ;もっているアイコンの数を取得 n=stat DEFY=last_y+10 x=0:y=DEFY:i=0 repeat n ;if cnt<70 : continue ;数が多いと表示しきれない^^; y=64*i+DEFY get_icon hicon,filename,cnt ;大きいアイコン取得 draw_icon hicon,x,y,1 ;(x,y)に描画 get_icon hicon,filename,cnt,1 ;小さいアイコン取得 draw_icon hicon,x,y+32,1 ;(x,y+32)に描画 pos x+32,y mes cnt i+ if y>460 : y=DEFY : i=0 : x+=50 loop redraw ;redrawを行わないと表示されないので注意! last_cbx_select_item=cbx_select_item last_track_pos=1 *main_loop wait 10 if cbx_select_item!last_cbx_select_item : goto x1 trackpos ,1 ;トラックボックスの位置を取得 if stat!last_track_pos { last_track_pos=stat s=""+stat+"個以上のアイコンを持つファイルを探す" objprm mesbox2_id,s _objsel track_id } goto main_loop *sel_wnd2 ffile="" ffile_copy="" gsel SECOND_WINDOW,1 ;stop goto main_loop *search_icon ; ;アイコンをもっているファイルの検索 ; gsel SECOND_WINDOW,1 strlen l,dir : peek c,dir,l-1 : if c!='\\' : dir+="\\" dirlist ffile,dir+mask ffile_copy=ffile notesel ffile notemax mx repeat 7,1 : objgray cnt : loop : objgray track_id ;objectを使用不可にする progrng 0,mx ;範囲を(0,mx)にセット progset 1 ;進ませる量を1にセット trackpos ,1 ;トラックボックスの位置を取得 track_pos=stat s="'"+dir+mask+"'を調べています(ファイル数:"+mx+") ESCキーで中断\n" s+="(アイコンを"+track_pos+"個以上もっているもの)" objprm mesbox0_id,s i=0 m=0 repeat mx getkey kESC,27 if kESC { notemax m repeat m-i notedel i notesel ffile_copy notedel i notesel ffile loop m=cnt break } noteget buf,i get_icon hicon,buf,-1 ;アイコンの数を取得 if stat