Check-in [13b7203622]

Not logged in
Overview
SHA1 Hash:13b720362245d14896c56eceaa328ad095439687
Date: 2011-02-23 12:48:03
User: kinaba
Comment:Initial import.
Timelines: family | ancestors | trunk
Downloads: Tarball | ZIP archive
Other Links: files | file ages | manifest
Tags And Properties
Changes
hide diffs unified diffs patch

Added ArcACE.cpp version [eeea8ebd808979ec]

> 1 > 2 #include "stdafx.h" > 3 #include "ArcAce.h" > 4 #include "NoahApp.h" > 5 > 6 > 7 int CArcAce::v_load() > 8 { > 9 if( hDLL = kiSUtil::loadLibrary("UnAceV2") ) > 10 { > 11 if( (aceInit = (FI)::GetProcAddress( hDLL,"ACEInitDll" )) > 12 && (aceHead = (FR)::GetProcAddress( hDLL,"ACEReadArchiveData" ) > 13 && (aceList = (FL)::GetProcAddress( hDLL,"ACEList" )) > 14 && (aceTest = (FT)::GetProcAddress( hDLL,"ACETest" )) > 15 && (aceExtr = (FE)::GetProcAddress( hDLL,"ACEExtract" )) ) > 16 { > 17 tACEInitDllStruc ini; > 18 ki_memzero( &ini, sizeof(ini) ); > 19 > 20 ini.GlobalData.Obj = this; > 21 ini.GlobalData.MaxArchiveTestBytes = 0x2ffFF; > 22 ini.GlobalData.MaxFileBufSize = 0x2ffFF; > 23 ini.GlobalData.InfoCallbackProc = callback_info; > 24 ini.GlobalData.ErrorCallbackProc = callback_error; > 25 ini.GlobalData.RequestCallbackProc = callback_request; > 26 ini.GlobalData.StateCallbackProc = callback_state; > 27 ini.GlobalData.DecryptPassword = pwdBuf; > 28 > 29 if( 0 == aceInit( &ini ) ) > 30 return aCheck|aMelt|aList|aMeltEach; > 31 } > 32 > 33 ::FreeLibrary( hDLL ); > 34 hDLL = NULL; > 35 } > 36 return 0; > 37 } > 38 > 39 bool CArcAce::v_ver( kiStr& str ) > 40 { > 41 str = "UnAceV2.dll "; > 42 > 43 //-- 存在確認 > 44 char buf[40]; > 45 if( hDLL ) > 46 if( GetVersionInfoStr( "UnAceV2", buf, sizeof(buf) ) ) > 47 str += buf; > 48 else > 49 str += "OK!"; > 50 else > 51 str += "----"; > 52 > 53 return true; > 54 } > 55 > 56 bool CArcAce::v_check( const kiPath& aname ) > 57 { > 58 //-- 書庫情報を読み込んでみる > 59 tACEReadArchiveDataStruc dt; > 60 ki_memzero( &dt, sizeof(dt) ); > 61 return ( 0==aceHead( const_cast<char*>((const char*)aname), &dt ) > 62 && NULL!=dt.ArchiveData ); > 63 } > 64 > 65 bool CArcAce::v_list( const arcname& aname, aflArray& files ) > 66 { > 67 list = &files; > 68 > 69 //-- リスティング開始! > 70 tACEListStruc lst; > 71 ki_memzero( &lst, sizeof(lst) ); > 72 lst.Files.SourceDir = ""; > 73 lst.Files.FileList = "*"; > 74 lst.Files.ExcludeList = ""; > 75 lst.Files.FullMatch = FALSE; > 76 > 77 char anm[MAX_PATH]; > 78 ki_strcpy( anm, aname.basedir ); > 79 ki_strcat( anm, aname.lname ); > 80 > 81 return ( 0==aceList( anm, &lst ) ); > 82 } > 83 > 84 int CArcAce::v_contents( const kiPath& aname, kiPath& dname ) > 85 { > 86 list = NULL; > 87 aCnt = aUnknown; > 88 dName = &dname; > 89 > 90 //-- リスティング開始! > 91 tACEListStruc lst; > 92 ki_memzero( &lst, sizeof(lst) ); > 93 lst.Files.SourceDir = ""; > 94 lst.Files.FileList = "*"; > 95 lst.Files.ExcludeList = ""; > 96 lst.Files.FullMatch = TRUE; > 97 if( 0!=aceList( const_cast<char*>((const char*)aname), &lst ) ) > 98 return aMulti; > 99 return aCnt; > 100 } > 101 > 102 int CArcAce::v_melt( const arcname& aname, const kiPath& ddir, const aflArray* f > 103 { > 104 pathCheck = new CArcPathCheckDlg; > 105 > 106 //-- 渡すファイルリスト作成 > 107 kiStr lst; > 108 if( files ) > 109 { > 110 dlg = NULL; > 111 for( unsigned int i=0; i!=list->len(); i++ ) > 112 if( (*files)[i].selected ) > 113 lst += (*files)[i].inf.szFileName, lst += '\xd'; > 114 } > 115 else > 116 lst = "*", dlg = new CArcProgressDlg( 32768 ); > 117 > 118 //-- 展開開始! > 119 ::SetCurrentDirectory( ddir ); > 120 > 121 m_aname = aname.lname; > 122 pwdBuf[0] = -1; > 123 > 124 tACEExtractStruc ex; > 125 ki_memzero( &ex, sizeof(ex) ); > 126 ex.Files.SourceDir = ""; > 127 ex.Files.FileList = const_cast<char*>((const char*)lst); > 128 ex.Files.ExcludeList = ""; > 129 ex.Files.FullMatch = files==NULL; > 130 ex.DestinationDir = const_cast<char*>((const char*)ddir); > 131 ex.ExcludePath = FALSE; > 132 ex.DecryptPassword = ""; > 133 > 134 char anm[MAX_PATH]; > 135 ki_strcpy( anm, aname.basedir ); > 136 ki_strcat( anm, aname.lname ); > 137 > 138 m_bCanceled = false; > 139 bool ans = ( 0==aceExtr( anm, &ex ) ); > 140 if( dlg && ans ) > 141 { > 142 dlg->change(NULL,32768); > 143 ::Sleep(100); > 144 } > 145 delete dlg; > 146 delete pathCheck; > 147 return ans ? 0 : (m_bCanceled?0x8020:0xffff); > 148 } > 149 > 150 int __stdcall CArcAce::callback_error( pACEErrorCallbackProcStruc Error ) > 151 { > 152 return ACE_CALLBACK_RETURN_OK; > 153 } > 154 > 155 int __stdcall CArcAce::callback_info( pACEInfoCallbackProcStruc Info ) > 156 { > 157 return ACE_CALLBACK_RETURN_OK; > 158 } > 159 > 160 int __stdcall CArcAce::callback_request( pACERequestCallbackProcStruc Request ) > 161 { > 162 // パスワード要求@解凍 ... ArchivedFile > 163 if( Request->Global.Code == ACE_CALLBACK_REQUEST_PASSWORD > 164 && Request->Global.Operation == ACE_CALLBACK_OPERATION_EXTRACT ) > 165 { > 166 CArcAce* ace = (CArcAce*)(Request->Global.GlobalData->Obj); > 167 if( ace->pwdBuf[0] == -1 ) > 168 { > 169 ace->pwdBuf[0]=0; > 170 > 171 CArcPwdDlg pwd( ace->dlg ? ace->dlg->hwnd() : NULL, ace- > 172 if( IDCANCEL == pwd.getEndCode() ) > 173 { > 174 ace->m_bCanceled = true; > 175 return ACE_CALLBACK_RETURN_CANCEL; > 176 } > 177 > 178 Request->Global.GlobalData->DecryptPassword = ace->pwdBu > 179 } > 180 } > 181 > 182 if( Request->Global.Code == ACE_CALLBACK_REQUEST_CHANGEVOLUME ) > 183 if( !kiSUtil::exist(Request->Archive.ArchiveData->ArchiveName) ) > 184 return ACE_CALLBACK_RETURN_CANCEL; > 185 > 186 return ACE_CALLBACK_RETURN_OK; > 187 } > 188 > 189 int __stdcall CArcAce::callback_state( pACEStateCallbackProcStruc State ) > 190 { > 191 // ファイル処理開始@解凍orリスト > 192 if( State->Progress.Code == ACE_CALLBACK_STATE_STARTFILE ) > 193 { > 194 CArcAce* ptr = (CArcAce*)(State->ArchivedFile.GlobalData->Obj); > 195 > 196 if( State->Progress.Operation == ACE_CALLBACK_OPERATION_LIST ) > 197 { > 198 if( !ptr->listup( *(State->ArchivedFile.FileData) ) ) > 199 return ACE_CALLBACK_RETURN_CANCEL; > 200 } > 201 else if( State->Progress.Operation == ACE_CALLBACK_OPERATION_EXT > 202 { > 203 if( ptr->dlg ) > 204 ptr->dlg->change( State->ArchivedFile.FileData-> > 205 if( ptr->pathCheck ) > 206 if( containsDangerPath( State->ArchivedFile.File > 207 if( ! ptr->pathCheck->is_ok_to_extract( > 208 return ACE_CALLBACK_RETURN_CANCE > 209 } > 210 } > 211 // 進展状況グラフ@解凍 > 212 else if( State->Progress.Code == ACE_CALLBACK_STATE_PROGRESS ) > 213 { > 214 CArcAce* ptr = (CArcAce*)(State->ArchivedFile.GlobalData->Obj); > 215 > 216 if( State->Progress.Operation == ACE_CALLBACK_OPERATION_EXTRACT > 217 { > 218 unsigned long prs = (unsigned long)State->Progress.Progr > 219 unsigned long ttl = (unsigned long)State->Progress.Progr > 220 ptr->dlg->change( NULL, ttl ? (int)((((__int64)prs)<<15) > 221 if( !ptr->dlg->msgloop() ) > 222 { > 223 ptr->m_bCanceled = true; > 224 return ACE_CALLBACK_RETURN_CANCEL; > 225 } > 226 } > 227 } > 228 // CRCチェック@解凍 > 229 else if( State->Progress.Code == ACE_CALLBACK_STATE_ENDCRCCHECK ) > 230 { > 231 if( !State->CRCCheck.CRCOk ) > 232 ::DeleteFile( State->CRCCheck.FileData->SourceFileName ) > 233 } > 234 > 235 return ACE_CALLBACK_RETURN_OK; > 236 } > 237 > 238 bool CArcAce::listup( tACEFileDataStruc& f ) > 239 { > 240 if( list ) // 全ファイルリスティングモード > 241 { > 242 arcfile x; > 243 > 244 ki_strcpy( x.inf.szFileName, f.SourceFileName ); > 245 x.isfile = ( 0== (f.Attributes & 0x10) ); //_A_SUBDIR > 246 x.inf.dwCompressedSize = (unsigned long)f.CompressedSize; > 247 x.inf.dwOriginalSize = (unsigned long)f.Size; > 248 x.inf.wDate = (unsigned short)(f.Time>>16); > 249 x.inf.wTime = (unsigned short)(f.Time); > 250 > 251 if( f.Method==0 ) ki_strcpy( x.inf.szMode, "store" > 252 else if( f.Method&2 ) ki_strcpy( x.inf.szMode, "ace2" ); > 253 else if( f.Method&1 ) ki_strcpy( x.inf.szMode, "ace1" ); > 254 else ki_strcpy( x.inf.szMode, > 255 > 256 list->add( x ); > 257 return true; > 258 } > 259 > 260 // 書庫内ファイル構成検索モード > 261 for( const char* p=f.SourceFileName; *p; p=kiStr::next(p) ) > 262 if( *p=='\\' || *p=='/' ) > 263 return true; // ルートのファイルのみ処理対象… > 264 > 265 if( aCnt != aUnknown ) > 266 return false; > 267 > 268 aCnt = (f.Attributes & 0x10) ? aSingleDir : aSingleFile; > 269 if( aCnt == aSingleDir ) > 270 *dName = f.SourceFileName; > 271 > 272 return true; > 273 }

Added ArcACE.h version [c407465455d14dd7]

> 1 #ifndef AFX_ARCACE_H__84B9CB87_29F7_428D_A3E7_F239213B127C__INCLUDED_ > 2 #define AFX_ARCACE_H__84B9CB87_29F7_428D_A3E7_F239213B127C__INCLUDED_ > 3 > 4 #include "Archiver.h" > 5 #include "SubDlg.h" > 6 > 7 #include "unacedef.h" > 8 > 9 class CArcAce : public CArchiver > 10 { > 11 public: //-- CArchiver 実装 -------------------------------- > 12 > 13 CArcAce() : CArchiver("ace."), hDLL( NULL ) {} > 14 virtual ~CArcAce() > 15 { > 16 if(hDLL) > 17 ::FreeLibrary(hDLL); > 18 } > 19 private: > 20 int v_load(); > 21 bool v_ver( kiStr& str ); > 22 bool v_check( const kiPath& aname ); > 23 int v_contents( const kiPath& aname, kiPath& dname ); > 24 int v_melt( const arcname& aname, const kiPath& ddir, const aflArray* f > 25 bool v_list( const arcname& aname, aflArray& files ); > 26 kiStr v_name(const char*) const { return "Unace32"; } > 27 > 28 private: //-- UnAceV2.DLL 操作 ------------------------------ > 29 > 30 HINSTANCE hDLL; > 31 static int __stdcall callback_error( pACEErrorCallbackProcStruc Error ); > 32 static int __stdcall callback_request( pACERequestCallbackProcStruc Requ > 33 static int __stdcall callback_state( pACEStateCallbackProcStruc State ); > 34 static int __stdcall callback_info( pACEInfoCallbackProcStruc Info ); > 35 bool listup( tACEFileDataStruc& f ); > 36 aflArray* list; > 37 CArcProgressDlg* dlg; > 38 CArcPathCheckDlg* pathCheck; > 39 char pwdBuf[100]; > 40 const char* m_aname; > 41 int aCnt; > 42 kiPath* dName; > 43 bool m_bCanceled; > 44 > 45 private: //-- UnAce.h --------------------------------------- > 46 > 47 // API > 48 typedef int (__stdcall *FI)( pACEInitDllStruc ); > 49 typedef int (__stdcall *FR)( LPSTR, pACEReadArchiveDataStruc ); > 50 typedef int (__stdcall *FL)( LPSTR, pACEListStruc ); > 51 typedef int (__stdcall *FT)( LPSTR, pACETestStruc ); > 52 typedef int (__stdcall *FE)( LPSTR, pACEExtractStruc ); > 53 FI aceInit; FR aceHead; FL aceList; FT aceTest; FE aceExtr; > 54 }; > 55 > 56 #endif

Added ArcB2e.cpp version [6032eb8a0710b17d]

> 1 > 2 #include "stdafx.h" > 3 #include "ArcB2e.h" > 4 #include "resource.h" > 5 #include "NoahApp.h" > 6 > 7 //----------------- ArcB2eクラス全体的な処理 ------------------------------ > 8 > 9 char CArcB2e::st_base[MAX_PATH]; > 10 int CArcB2e::st_life=0; > 11 CArcB2e::CB2eCore* CArcB2e::rvm=NULL; > 12 > 13 const char* CArcB2e::init_b2e_path() > 14 { > 15 kiPath dir( kiPath::Exe ); > 16 ki_strcpy( st_base, dir+="b2e\\" ); > 17 return st_base; > 18 } > 19 > 20 CArcB2e::CArcB2e( const char* scriptname ) : CArchiver( scriptname ) > 21 { > 22 st_life++; > 23 exe = NULL; > 24 m_LstScr = m_DcEScr = m_EncScr = > 25 m_DecScr = m_SfxScr = m_LoadScr= m_ScriptBuf = NULL; > 26 } > 27 > 28 CArcB2e::~CArcB2e() > 29 { > 30 if( !(--st_life) ) > 31 delete rvm; > 32 delete [] m_ScriptBuf; > 33 } > 34 > 35 //------------------- スクリプト側にあまり関係しない部分 ------------------------- > 36 > 37 bool CArcB2e::v_ver( kiStr& str ) > 38 { > 39 if( !exe ) > 40 return false; > 41 exe->ver( str ); > 42 > 43 kiStr tmp; > 44 for( int i=0,e=m_subFile.len(); i<e; ++i ) > 45 { > 46 str += "\r\n"; > 47 CArcModule(m_subFile[i]).ver( tmp ); > 48 str += tmp; > 49 } > 50 return true; > 51 } > 52 > 53 bool CArcB2e::v_check( const kiPath& aname ) > 54 { > 55 return exe ? exe->chk( aname ) : false; > 56 } > 57 > 58 int CArcB2e::v_contents( const kiPath& aname, kiPath& dname ) > 59 { > 60 return exe ? exe->cnt( aname, dname ) : aUnknown; > 61 } > 62 > 63 //------------------- スクリプトを読み込み&eval( load: ) ------------------- > 64 > 65 bool CArcB2e::load_module( const char* name ) > 66 { > 67 exe = new CArcModule( name, m_usMode ); > 68 return exe->exist(); > 69 } > 70 > 71 int CArcB2e::v_load() > 72 { > 73 //-- 拡張スクリプトファイルを開く > 74 kiStr fname( st_base ); fname += mlt_ext(); > 75 kiFile fp; > 76 if( fp.open( fname ) ) > 77 { > 78 //-- ファイル全体を読み込み > 79 unsigned int ln=fp.getSize(); > 80 m_ScriptBuf = new char[ ln+1 ]; > 81 ln = fp.read( (unsigned char*)m_ScriptBuf, ln ); > 82 m_ScriptBuf[ ln ] = '\0'; > 83 > 84 //-- section毎に切り分ける > 85 bool pack1,chk=false; > 86 for( char* p=m_ScriptBuf; *p; p++ ) > 87 { > 88 switch( *p ) > 89 { > 90 case 'c': case 'd': case 'e': case 'l': case 's': > 91 if( ki_memcmp(p,"load:",5) ) > 92 *p='\0', m_LoadScr = (p+=4)+1; > 93 else if( ki_memcmp(p,"encode:",7) ) > 94 *p='\0', m_EncScr = (p+=6)+1, pack1=fals > 95 else if( ki_memcmp(p,"encode1:",8) ) > 96 *p='\0', m_EncScr = (p+=7)+1, pack1=true > 97 else if( ki_memcmp(p,"decode:",7) ) > 98 *p='\0', m_DecScr = (p+=6)+1; > 99 else if( ki_memcmp(p,"sfx:",4) ) > 100 *p='\0', m_SfxScr = (p+=3)+1, m_SfxDirec > 101 else if( ki_memcmp(p,"sfxd:",5) ) > 102 *p='\0', m_SfxScr = (p+=4)+1, m_SfxDirec > 103 else if( ki_memcmp(p,"check:",6) ) > 104 *p='\0', (p+=5), chk=true; > 105 else if( ki_memcmp(p,"decode1:",8) ) > 106 *p='\0', m_DcEScr = (p+=7); > 107 else if( ki_memcmp(p,"list:",5) ) > 108 *p='\0', m_LstScr = (p+=4); > 109 } > 110 while( *p && *p!='\n' && *p!='\r' ) > 111 p++; > 112 if( *p=='\0' ) > 113 break; > 114 } > 115 > 116 //-- [load:]を実行! > 117 if( m_LoadScr ) > 118 { > 119 //-- RythpVM 起動 > 120 if( !rvm ) > 121 rvm = new CB2eCore; > 122 > 123 //-- 初期化 > 124 m_Result=0; > 125 rvm->setPtr( this,mLod ); > 126 > 127 //-- 実行 > 128 rvm->eval( m_LoadScr ); > 129 > 130 //-- 結果 > 131 if( m_Result==0 ) > 132 return (m_DecScr?aMelt|(m_DcEScr?aList|aMeltEach > 133 | (m_EncScr?aCompress|(pack1?0:aArchive > 134 } > 135 } > 136 return 0; > 137 } > 138 > 139 int CArcB2e::exec_script( const char* scr, scr_mode mode ) > 140 { > 141 //-- 初期化 > 142 m_Result = 0; > 143 rvm->setPtr( this, mode ); > 144 > 145 //-- 実行 > 146 char* script = new char[ki_strlen(scr)+8]; > 147 ki_strcpy( script, "(exec " ); > 148 ki_strcat( script, scr ); > 149 ki_strcat( script, ")" ); > 150 rvm->eval( script ); > 151 delete [] script; > 152 > 153 //-- 結果 > 154 return m_Result; > 155 } > 156 > 157 //-------------------- リストアップ eval( list: ) ----------------------- > 158 > 159 bool CArcB2e::v_list( const arcname& aname, aflArray& files ) > 160 { > 161 //-- スクリプト無しで何とかできるならする。 > 162 if( !exe ) > 163 return false; > 164 else if( exe->isdll() ) > 165 return exe->lst_dll( aname, files ); > 166 else if( !m_LstScr ) > 167 return false; > 168 > 169 //-- リスティングスクリプトに必要なデータ > 170 > 171 // 書庫名 > 172 m_psArc = &aname; > 173 // ファイルリスト > 174 m_psAInfo = &files; > 175 > 176 //-- 実行! --------------------- > 177 > 178 return 0==exec_script( m_LstScr, mLst ); > 179 } > 180 > 181 //-------------------- 展開処理 eval( decode: ) ----------------------- > 182 > 183 int CArcB2e::v_melt( const arcname& aname, const kiPath& ddir, const aflArray* f > 184 { > 185 //-- 解凍スクリプトに必要なデータ > 186 > 187 // カレント > 188 ::SetCurrentDirectory( ddir ); > 189 // 書庫名 > 190 m_psArc = &aname; > 191 // 出力先ディレクトリ > 192 m_psDir = &ddir; > 193 // ファイルリスト > 194 m_psAInfo = files; > 195 > 196 //-- 実行! --------------------- > 197 > 198 return exec_script( files ? m_DcEScr : m_DecScr, > 199 files ? mDc1 : mDec ); > 200 } > 201 > 202 //-------------------- 圧縮処理 eval( encode: sfx: ) ----------------------- > 203 > 204 int CArcB2e::cmpr( const char* scr, const kiPath& base, const wfdArray& files, c > 205 { > 206 //-- 圧縮スクリプトに必要なデータ > 207 > 208 arcname aname( > 209 ddir, > 210 files[0].cAlternateFileName, > 211 files[0].cFileName ); > 212 int mhd=method+1; > 213 > 214 // カレント > 215 ::SetCurrentDirectory( base ); > 216 // 書庫名 > 217 m_psArc = &aname; > 218 // ベースディレクトリ > 219 m_psDir = &base; > 220 // メソッド > 221 m_psMhd = &mhd; > 222 // リスト > 223 m_psList = &files; > 224 > 225 //-- 実行! -------------------- > 226 > 227 return exec_script( scr, mEnc ); > 228 } > 229 > 230 bool CArcB2e::arc2sfx( const kiPath& temp, const kiPath& dest ) > 231 { > 232 //-- SFX変換スクリプトに必要なデータ > 233 > 234 kiFindFile f; > 235 WIN32_FIND_DATA fd; > 236 kiPath wild( temp ); > 237 f.begin( wild += "*" ); > 238 if( !f.next( &fd ) ) > 239 return false; > 240 kiPath from, to, oldname( fd.cFileName ); > 241 arcname aname( temp, fd.cAlternateFileName[0] ? fd.cAlternateFileName : > 242 > 243 // カレント > 244 ::SetCurrentDirectory( temp ); > 245 // 書庫名 > 246 m_psArc = &aname; > 247 // ディレクトリ > 248 m_psDir = &temp; > 249 > 250 //-- 実行! ---------------------- > 251 > 252 if( 0x8000<=exec_script( m_SfxScr, mSfx ) ) > 253 return false; > 254 > 255 //-- コピー ---------------------- > 256 > 257 bool skipped=false, ans=false; > 258 f.begin( wild ); > 259 while( f.next( &fd ) ) > 260 { > 261 if( !skipped && oldname == fd.cFileName ) // テンポラリ書庫はコピーしない。 > 262 { > 263 skipped=true; > 264 continue; > 265 } > 266 from = temp, from += fd.cFileName; > 267 to = dest, to += fd.cFileName; > 268 if( ::CopyFile( from, to, FALSE ) ) > 269 ans = true; > 270 } > 271 return ans; > 272 } > 273 > 274 int CArcB2e::v_compress( const kiPath& base, const wfdArray& files, const kiPath > 275 { > 276 const char* theScript = m_EncScr; > 277 > 278 if( sfx ) > 279 { > 280 if( m_SfxDirect ) > 281 theScript = m_SfxScr; > 282 else > 283 { > 284 kiPath tmp; > 285 myapp().get_tempdir( tmp ); > 286 > 287 // テンポラリへ圧縮 > 288 int ans = cmpr( m_EncScr, base, files, tmp, method ); > 289 if( ans < 0x8000 ) > 290 // テンポラリに落ちてるファイルをSFXに変換&コピー! > 291 ans = (arc2sfx( tmp, ddir ) ? 0 : 0x8020); > 292 > 293 // カレントを戻しておかないと削除できない…(;_;) > 294 ::SetCurrentDirectory( base ); > 295 tmp.remove(); > 296 return ans; > 297 } > 298 } > 299 > 300 // 出力先へ普通に圧縮 > 301 return cmpr( theScript, base, files, ddir, method ); > 302 } > 303 > 304 //-----------------------------------------------------------------// > 305 //-------------------- RythpVMの方の実務 --------------------------// > 306 //-----------------------------------------------------------------// > 307 > 308 bool CArcB2e::CB2eCore::exec_function( const kiVar& name, const CharArray& a, co > 309 { > 310 bool processed = false; > 311 > 312 if( m_mode==mLod ){ //**ロード時専用functions**************************** > 313 if( name=="name" ){ > 314 processed=true; > 315 > 316 //---------------------------// > 317 //-- (name module_filename)--// > 318 //---------------------------// > 319 if( c>=2 ) > 320 { > 321 x->m_usMode = false; > 322 if( c>=3 ) > 323 { > 324 getarg( a[2],b[2],&t ); > 325 x->m_usMode = ( t=="us" ); > 326 } > 327 > 328 getarg( a[1],b[1],&t ); > 329 if( x->load_module(t) ) > 330 *r = "exec"; > 331 else > 332 *r = "", x->m_Result=0xffff; > 333 } > 334 > 335 }else if( name=="type" ){ > 336 processed=true; > 337 > 338 //-----------------------------------// > 339 //-- (type ext method1 method2 ...)--// > 340 //-----------------------------------// > 341 for( int i=1; i<c; i++ ) > 342 { > 343 getarg( a[i],b[i],&t ); > 344 if( i==1 ) > 345 x->set_cmp_ext( t ); > 346 else > 347 { > 348 const char* ptr=t; > 349 x->add_cmp_mhd( *ptr=='*' ? ptr+1 : ptr, > 350 } > 351 } > 352 }else if( name=="use" ){ > 353 processed=true; > 354 > 355 //-------------------------------// > 356 //-- (use module1 module2 ...) --// > 357 //-------------------------------// > 358 for( int i=1; i<c; i++ ) > 359 { > 360 getarg( a[i],b[i],&t ); > 361 x->m_subFile.add( t ); > 362 } > 363 } > 364 }else{//************ ロード時には使えないfunctions ********************* > 365 if( ki_memcmp( (const char*)name, "arc", 3 ) ){ > 366 processed=true; > 367 > 368 //---------------------------// > 369 //-- (arc[+-].xxx [slfrd]) --// > 370 //---------------------------// > 371 arc( ((const char*)name)+3, a, b, c, r ); > 372 > 373 }else if( ki_memcmp( (const char*)name, "list", 4 ) ){ > 374 processed=true; > 375 > 376 //----------------------------// > 377 //-- (list[\*|\*.*] [slfn]) --// > 378 //----------------------------// > 379 list( ((const char*)name)+4, a, b, c, r ); > 380 > 381 }else if( name=="method" ){ > 382 processed=true; > 383 > 384 //-------------------// > 385 //-- (method [no]) --// > 386 //-------------------// > 387 if( c>=2 ) > 388 { > 389 getarg( a[1],b[1],&t ); > 390 *r = t.getInt()==*x->m_psMhd ? "1" : "0"; > 391 } > 392 else > 393 r->setInt( *x->m_psMhd ); > 394 > 395 }else if( name=="dir" ){ > 396 processed=true; > 397 > 398 //-----------// > 399 //-- (dir) --// > 400 //-----------// > 401 *r = (x->m_psDir ? *x->m_psDir : (const char*)""); > 402 > 403 }else if( name=="del" ){ > 404 processed=true; > 405 > 406 //-------------------// > 407 //-- (del filenam) --// > 408 //-------------------// > 409 if( c>=2 ) > 410 { > 411 getarg( a[1],b[1],&t ); > 412 ::DeleteFile( kiPath( t.unquote() ) ); > 413 } > 414 > 415 }else if( ki_memcmp( (const char*)name, "resp", 4 ) > 416 || ki_memcmp( (const char*)name, "resq", 4 ) ){ > 417 processed=true; > 418 > 419 //----------------------------// > 420 //-- (resp[@|-o] (list a)) ---// > 421 //----------------------------// > 422 resp( name[3]=='p', ((const char*)name)+4, a, b, c, r ); > 423 > 424 }else if( name=="cd" ){ > 425 processed=true; > 426 > 427 //-------------------// > 428 //-- (cd directory)--// > 429 //-------------------// > 430 if( c>=2 ) > 431 { > 432 getarg( a[1],b[1],&t ); > 433 ::SetCurrentDirectory( t.unquote() ); > 434 } > 435 > 436 }else if( name=="cmd" || name=="xcmd" ){ > 437 processed=true; > 438 > 439 //----------------------------// > 440 //-- (cmd command line ...)---// > 441 //-- (xcmd command line ...)--// > 442 //----------------------------// > 443 if( name[0]=='x' && c<2 ) > 444 x->m_Result = 0xffff; > 445 else > 446 { > 447 CArcModule* xxx = x->exe; > 448 kiVar cmd; > 449 int i=1; > 450 > 451 if( name[0] == 'x' ) > 452 { > 453 kiVar mm; > 454 getarg( a[i],b[i],&mm ); > 455 i++; > 456 xxx = new CArcModule( mm, x->m_usMode ); > 457 } > 458 for( ; i<c; i++ ) > 459 getarg( a[i],b[i],&t ), cmd+=t, cmd+=' ' > 460 > 461 bool m = (mycnf().miniboot() || m_mode==mDc1); > 462 x->m_Result = xxx->cmd( cmd, m ); > 463 r->setInt( x->m_Result ); > 464 > 465 if( name[0] == 'x' ) > 466 delete xxx; > 467 } > 468 }else if( name=="scan" || name=="xscan" ){ > 469 processed=true; > 470 > 471 //----------------------------------------// > 472 //-- (scan BL BSL EL SL dx cmd...) -------// > 473 //-- (xscan BL BSL EL SL dx CMD cmd...) --// > 474 //----------------------------------------// > 475 if( c<6 || (name[0]=='x'&&c<7) ) > 476 x->m_Result = 0xffff; > 477 else > 478 { > 479 CArcModule* xxx = x->exe; > 480 > 481 kiVar BL, EL; > 482 getarg( a[1],b[1],&BL ); > 483 getarg( a[2],b[2],&t ); > 484 int BSL = t.getInt(); > 485 getarg( a[3],b[3],&EL ); > 486 getarg( a[4],b[4],&t ); > 487 int SL = t.getInt(); > 488 getarg( a[5],b[5],&t ); > 489 int dx = t.getInt(); > 490 > 491 int i=6; > 492 if( name[0] == 'x' ) > 493 { > 494 kiVar mm; > 495 getarg( a[i],b[i],&mm ); > 496 i++; > 497 xxx = new CArcModule( mm, x->m_usMode ); > 498 } > 499 > 500 kiVar cmd; > 501 for( ; i<c; ++i ) > 502 getarg( a[i],b[i],&t ), cmd+=t, cmd+=' ' > 503 > 504 x->m_Result = xxx->lst_exe( > 505 cmd, *const_cast<aflArray*>(x->m_psAInfo > 506 BL, BSL, EL, SL, dx ) ? 0 : -1; > 507 > 508 if( name[0] == 'x' ) > 509 delete xxx; > 510 } > 511 }else if( name=="input" ){ > 512 processed=true; > 513 > 514 //-------------------------// > 515 //-- (input MSG DEFUALT) --// > 516 //-------------------------// > 517 kiVar msg, defval; > 518 if( c>=2 ) > 519 getarg( a[1],b[1],&msg ); > 520 if( c>=3 ) > 521 getarg( a[2],b[2],&defval ); > 522 input( msg, defval, r ); > 523 }else if( name=="size" ){ > 524 processed=true; > 525 > 526 //---------------------// > 527 //-- (size FILENAME) --// > 528 //---------------------// > 529 if( c>=2 ) > 530 { > 531 kiVar fnm; > 532 getarg( a[1],b[1],&fnm ); > 533 r->setInt( kiFile::getSize( fnm.unquote() ) ); > 534 } > 535 }else if( name=="is_file" ){ > 536 processed=true; > 537 > 538 //---------------------// > 539 //-- (is_file) --------// > 540 //---------------------// > 541 if( c==1 ) > 542 *r = (x->m_psList->len()==1 > 543 && !kiSUtil::isdir( (*x->m_psList)[0]. > 544 }else if( name=="is_folder" ){ > 545 processed=true; > 546 > 547 //---------------------// > 548 //-- (is_folder) ------// > 549 //---------------------// > 550 if( c==1 ) > 551 *r = (x->m_psList->len()==1 > 552 && kiSUtil::isdir( (*x->m_psList)[0].c > 553 }else if( name=="is_multiple" ){ > 554 processed=true; > 555 > 556 //---------------------// > 557 //-- (is_multiple) ----// > 558 //---------------------// > 559 if( c==1 ) > 560 *r = x->m_psList->len()>1 ? "1" : "0"; > 561 }else if( name=="find" ){ > 562 processed=true; > 563 > 564 //---------------------// > 565 //-- (find FILENAME) --// > 566 //---------------------// > 567 if( c>=2 ) > 568 { > 569 kiVar fnm; > 570 getarg( a[1],b[1],&fnm ); > 571 char buf[MAX_PATH]; > 572 if( 0==::SearchPath( NULL,fnm.unquote(),NULL,MAX > 573 *r = ""; > 574 else > 575 *r = buf, r->quote(); > 576 } > 577 } > 578 } > 579 > 580 return processed ? true : kiRythpVM::exec_function(name,a,b,c,r); > 581 } > 582 > 583 void CArcB2e::CB2eCore::arc( const char* opt, const CharArray& a, const BoolArra > 584 { > 585 //---------------------------// > 586 //-- (arc[+-].xxx [slfrd]) --// > 587 //---------------------------// > 588 > 589 // デフォルトオプション設定 > 590 const char* anm=x->m_psArc->lname; > 591 enum{ full, nam, dir } part=full; > 592 if( m_mode==mSfx ) part=nam; // sfx > 593 > 594 // 指定があれば上書 > 595 if( c>=2 ) > 596 { > 597 getarg( a[1],b[1],&t ); > 598 for( const char* p=t; *p; p++ ) > 599 switch(*p) > 600 { > 601 case 's': anm=x->m_psArc->sname; break; > 602 case 'l': anm=x->m_psArc->lname; break; > 603 case 'f': part=full; break; > 604 case 'n': part=nam; break; > 605 case 'd': part=dir; break; > 606 } > 607 } > 608 > 609 // ディレクトリ部分 > 610 *r = (part==nam ? (const char*)"" : x->m_psArc->basedir); > 611 > 612 // 名前部分 > 613 if( part != dir ) > 614 { > 615 if( *opt=='\0' || *opt=='+' ) > 616 { > 617 // (arc) : anmをそのまま返す > 618 *r += anm; > 619 // (arc+XXX) : anmXXXを返す > 620 if( *opt=='+' ) > 621 *r += (opt+1); > 622 } > 623 else > 624 { > 625 const char* ext = kiPath::ext(anm); > 626 const char* add = ""; > 627 if( opt[0]=='-' && opt[1]=='.' ) > 628 { > 629 // (arc-.XXX) : 末尾が.XXXだったら削除。 > 630 // : そうでなければ後ろに.decompressed > 631 if( 0!=ki_strcmpi( ext, opt+2 ) ) > 632 ext = anm + ki_strlen(anm), add = ".deco > 633 } > 634 else if( opt[1]!='\0' ) > 635 { > 636 // (arc.XXX) : 最後の拡張子を.XXXに取り替え > 637 add = opt; > 638 switch(mycnf().extnum()) > 639 { > 640 case 0: ext = anm + ::lstrlen(anm);break; > 641 case 1: ext = kiPath::ext(anm); break; > 642 default:ext = kiPath::ext_all(anm);break; > 643 } > 644 } > 645 else > 646 { > 647 // (arc.) : 拡張子を全て取り除く > 648 switch(mycnf().extnum()) > 649 { > 650 case 0: ext = anm + ::lstrlen(anm);break; > 651 case 1: ext = kiPath::ext(anm); break; > 652 default:ext = kiPath::ext_all(anm);break; > 653 } > 654 } > 655 if( *ext ) > 656 ext--; > 657 > 658 char buf[MAX_PATH]; > 659 ki_memcpy( buf, anm, ext-anm ); > 660 buf[ ext-anm ] = '\0'; > 661 *r += buf; > 662 *r += add; > 663 } > 664 > 665 // 必要ならくくる > 666 if( part==full ) > 667 r->quote(); > 668 } > 669 } > 670 > 671 static void selfR( > 672 const char* writedir, const char* fullpath, bool lfn, kiVar* r ) > 673 { > 674 kiFindFile f; > 675 WIN32_FIND_DATA fd; > 676 f.begin( kiStr(fullpath) += "\\*" ); > 677 > 678 kiVar t, t2, t3; > 679 while( f.next(&fd) ) > 680 { > 681 t = writedir; > 682 t+= '\\'; > 683 t+= (lfn ? fd.cFileName : fd.cAlternateFileName); > 684 if( fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ) > 685 { > 686 t2 = t; > 687 t = ""; > 688 t3 = fullpath; > 689 t3+= '\\'; > 690 t3+= (lfn ? fd.cFileName : fd.cAlternateFileName); > 691 selfR( t2, t3, lfn, &t ); > 692 } > 693 else > 694 { > 695 if( lfn ) > 696 t.quote(); > 697 } > 698 *r += t; > 699 *r += ' '; > 700 } > 701 } > 702 > 703 void CArcB2e::CB2eCore::list( const char* opt, const CharArray& a, const BoolArr > 704 { > 705 //---------------------------// > 706 //-- (list[r|\*.*] [slfn]) --// > 707 //---------------------------// > 708 > 709 if( m_mode!=mEnc ) // 解凍の場合 > 710 { > 711 *r = ""; > 712 > 713 for( unsigned int i=0; i!=x->m_psAInfo->len(); i++ ) > 714 if( (*x->m_psAInfo)[i].selected ) > 715 { > 716 // - で始まるヤツ対策をするか? > 717 t = (*x->m_psAInfo)[i].inf.szFileName; > 718 t.quote(); > 719 *r += t; > 720 *r += ' '; > 721 } > 722 } > 723 else // 圧縮の場合 > 724 { > 725 // デフォルトオプション設定 > 726 bool lfn=true; > 727 enum{ full, nam } part=nam; > 728 // 指定があれば上書 > 729 if( c>=2 ) > 730 { > 731 getarg( a[1],b[1],&t ); > 732 for( const char* p=t; *p; p++ ) > 733 switch(*p) > 734 { > 735 case 's': lfn=false; break; > 736 case 'l': lfn=true; break; > 737 case 'f': part=full; break; > 738 case 'n': part=nam; break; > 739 } > 740 } > 741 // 自前で再帰リストアップを行うか否か > 742 bool selfrecurse = (*opt=='r'); > 743 > 744 // ディレクトリ名の後ろに付け足すもの。 > 745 if( *opt=='\\' || *opt=='/' ) > 746 opt++; > 747 > 748 // リストアップ > 749 kiVar t2,t3; > 750 *r = ""; > 751 for( unsigned int i=0; i!=x->m_psList->len(); i++ ) > 752 { > 753 // ファイル名部分 > 754 t = ( part==full ? *x->m_psDir : (const char*)""); > 755 t += lfn ? (*x->m_psList)[i].cFileName : (*x->m_psList)[ > 756 > 757 if( selfrecurse && ((*x->m_psList)[i].dwFileAttributes & > 758 { > 759 // セルフ再帰 > 760 t2 = t; > 761 t = ""; > 762 t3 = *x->m_psDir; > 763 t3+= lfn ? (*x->m_psList)[i].cFileName : (*x->m_ > 764 selfR( t2, t3, lfn, &t ); > 765 } > 766 else > 767 { > 768 // ノーマル処理 > 769 if( *opt && ((*x->m_psList)[i].dwFileAttributes > 770 t += '\\', t += opt; > 771 if( lfn ) > 772 t.quote(); > 773 } > 774 *r += t; > 775 *r += ' '; > 776 } > 777 } > 778 > 779 r->removeTrailWS(); > 780 } > 781 > 782 void CArcB2e::CB2eCore::resp( bool needq, const char* opt, const CharArray& a, c > 783 { > 784 //-----------------------------// > 785 //-- (resp[@|-o] (list) ...) --// > 786 //-----------------------------// > 787 > 788 // レスポンスファイル名作成 > 789 kiPath rspfile; > 790 myapp().get_tempdir(rspfile); > 791 rspfile += "filelist"; > 792 > 793 // オプションと結合して返す > 794 *r = opt; > 795 *r += rspfile; > 796 > 797 // ファイルへ書き込み > 798 kiFile fp; > 799 if( !fp.open( rspfile,false ) ) > 800 return; > 801 > 802 kiVar tmp; > 803 for( int i=1; i<c; i++ ) > 804 { > 805 // fpへ各引数をsplitしながら書き込む > 806 getarg( a[i],b[i],&tmp ); > 807 > 808 for( const char *s,*p=tmp; *p; p++ ) > 809 { > 810 // 余分な空白はスキップ > 811 while( *p==' ' ) > 812 p++; > 813 if( *p=='\0' ) > 814 break; > 815 > 816 // 引数の終わりへ… > 817 s=p; > 818 for( int q=0; *p!='\0' && (*p!=' ' || (q&1)!=0); p++ ) > 819 if( *p=='"' ) > 820 q++; > 821 > 822 // "のつじつま合わせ一号 > 823 if( !needq && *s=='"' ) > 824 { > 825 s++; > 826 if( p!=s && *(p-1)=='"' ) > 827 p--; > 828 } > 829 > 830 fp.write( s, p-s ); > 831 fp.write( "\r\n", 2 ); > 832 > 833 // "のつじつま合わせ二号 > 834 if( *p=='"' ) > 835 p++; > 836 if( *p=='\0' ) > 837 break; > 838 } > 839 } > 840 } > 841 > 842 void CArcB2e::CB2eCore::input( const char* msg, const char* defval, kiVar* r ) > 843 { > 844 struct CB2eInputDlg : public kiDialog > 845 { > 846 const char* msg; > 847 const char* def; > 848 kiVar* res; > 849 > 850 CB2eInputDlg( const char* m, const char* d, kiVar* r ) > 851 : kiDialog( IDD_PASSWORD ), msg(m), def(d), res(r) {} > 852 BOOL onInit() > 853 { > 854 sendMsgToItem( IDC_EDIT, WM_SETTEXT, 0, (LPARAM) > 855 sendMsgToItem( IDC_MESSAGE, WM_SETTEXT, 0, (LPAR > 856 ::ShowWindow( item(IDC_MASK), SW_HIDE ); > 857 ::ShowWindow( item(IDCANCEL), SW_HIDE ); > 858 ::EnableWindow( item(IDC_MASK), FALSE ); > 859 ::EnableWindow( item(IDCANCEL), FALSE ); > 860 ::SetFocus( item(IDC_EDIT) ); > 861 return TRUE; > 862 } > 863 bool onOK() > 864 { > 865 char* buf = new char[32768]; > 866 sendMsgToItem( IDC_EDIT, WM_GETTEXT, 32768, (LPA > 867 *res = buf; > 868 delete [] buf; > 869 return true; > 870 } > 871 }; > 872 > 873 CB2eInputDlg d( msg, defval, r ); > 874 d.doModal( app()->mainhwnd() ); > 875 } > 876

Added ArcB2e.h version [f42371bc1f59bea6]

> 1 #ifndef AFX_ARCB2e_H__697CC1BD_2C28_434C_8C53_239D624227C3__INCLUDED_ > 2 #define AFX_ARCB2e_H__697CC1BD_2C28_434C_8C53_239D624227C3__INCLUDED_ > 3 > 4 #include "Archiver.h" > 5 > 6 class CArcB2e : public CArchiver > 7 { > 8 public: //--<action>-- > 9 > 10 CArcB2e( const char* scriptname ); > 11 virtual ~CArcB2e(); > 12 static const char* init_b2e_path(); > 13 > 14 private: //--<CArchiver>-- > 15 > 16 int v_load(); > 17 bool v_ver( kiStr& str ); > 18 bool v_check( const kiPath& aname ); > 19 int v_contents( const kiPath& aname, kiPath& dname ); > 20 int v_melt( const arcname& aname, const kiPath& ddir, const aflArray* f > 21 bool v_list( const arcname& aname, aflArray& files ); > 22 int v_compress( const kiPath& base, const wfdArray& files, const kiPath > 23 kiStr v_name(const char*) const { return exe ? exe->name() : kiStr(""); > 24 > 25 bool arc2sfx( const kiPath& temp, const kiPath& dest ); > 26 int cmpr( const char* scr, const kiPath& base, const wfdArray& files, c > 27 > 28 private: //--<RythpScript>-- > 29 > 30 // scripts > 31 char* m_ScriptBuf; > 32 char* m_LoadScr; > 33 const char* m_EncScr; > 34 const char* m_DecScr; > 35 const char* m_SfxScr; > 36 const char* m_DcEScr; > 37 const char* m_LstScr; > 38 bool m_SfxDirect; > 39 > 40 enum scr_mode { mLod, mEnc, mDec, mDc1, mSfx, mLst }; > 41 int exec_script( const char* scr, scr_mode mode ); > 42 > 43 // B2e Core > 44 class CB2eCore : public kiRythpVM > 45 { > 46 friend class CArcB2e; > 47 > 48 bool exec_function( const kiVar& name, const CharArray& a, const > 49 > 50 void arc( const char* opt, const CharArray& a, const BoolArray& > 51 void list( const char* opt, const CharArray& a, const BoolArray& > 52 void resp( bool needq, const char* opt, const CharArray& a, cons > 53 void input( const char* msg, const char* defval, kiVar* r ); > 54 > 55 void setPtr( CArcB2e* p, scr_mode m ){x=p;m_mode=m;} > 56 CArcB2e* x; > 57 scr_mode m_mode; > 58 kiVar t; > 59 }; > 60 friend class CB2eCore; > 61 static char st_base[MAX_PATH]; > 62 static int st_life; > 63 static CB2eCore* rvm; > 64 > 65 // module > 66 CArcModule* exe; > 67 kiArray<kiStr> m_subFile; > 68 > 69 // script連携 > 70 bool load_module( const char* name ); > 71 int m_Result; > 72 bool m_usMode; > 73 const arcname* m_psArc; > 74 const kiPath* m_psDir; > 75 const int* m_psMhd; > 76 const wfdArray* m_psList; > 77 const aflArray* m_psAInfo; > 78 }; > 79 > 80 #endif

Added ArcCpt.cpp version [de96d041f43cbd6f]

> 1 > 2 #include "stdafx.h" > 3 #include "ArcCpt.h" > 4 #include "NoahApp.h" > 5 > 6 //--- CArchiver -------------------------------------------------- > 7 > 8 bool CArcCpt::v_check( const kiPath& aname ) > 9 { > 10 bool ans = ( cpt.open( aname ) && read_main_hdr() && check_index_crc() ) > 11 cpt.close(); > 12 return ans; > 13 } > 14 > 15 bool CArcCpt::v_list( const arcname& aname, aflArray& files ) > 16 { > 17 ::SetCurrentDirectory( aname.basedir ); > 18 > 19 bool ans = ( cpt.open( aname.lname ) && read_main_hdr() && operation_for > 20 cpt.close(); > 21 return ans; > 22 } > 23 > 24 int CArcCpt::v_melt( const arcname& aname, const kiPath& ddir, const aflArray* f > 25 { > 26 ::SetCurrentDirectory( aname.basedir ); > 27 if( !cpt.open( aname.lname ) ) > 28 return 0xffff; > 29 > 30 ::SetCurrentDirectory( ddir ); > 31 bool ans = ( read_main_hdr() && operation_for_each( false, const_cast<af > 32 cpt.close(); > 33 return ans ? 0 : 0x8020; > 34 } > 35 > 36 int CArcCpt::v_contents( const kiPath& aname, kiPath& dname ) > 37 { > 38 int ans=aUnknown; > 39 if( cpt.open( aname ) && read_main_hdr() ) > 40 { > 41 if( cpt.read( tmp, 7 ) ) > 42 { > 43 WORD EntryNum = (tmp[4]<<8) + tmp[5]; > 44 if( EntryNum == 1 ) > 45 ans = aSingleFile; > 46 else > 47 { > 48 cpt.read( tmp, tmp[6] ); > 49 tmp[0] = cpt.getc(); > 50 if( tmp[0] & 0x80 ) // Folder > 51 { > 52 unsigned long size = (tmp[0]&0x3f) + 2; > 53 if( size == cpt.read( tmp+1, size ) ) > 54 if( EntryNum == 1 + (tmp[size-1] > 55 { > 56 dname = ""; > 57 tmp[ 1+tmp[0] ] = '\0'; > 58 for( char* pp=(char*)tmp > 59 { > 60 if( kiStr::isLea > 61 dname += > 62 else if( *pp<' ' > 63 dname += > 64 else switch( *pp > 65 { > 66 case '\\ > 67 case '?' > 68 > 69 default: > 70 > 71 } > 72 } > 73 > 74 ans = aSingleDir; > 75 } > 76 } > 77 } > 78 } > 79 } > 80 cpt.close(); > 81 return ans; > 82 } > 83 > 84 //--- CRC ---------------------------------------------------------- > 85 > 86 static unsigned long crctbl[256] = { 1 }; > 87 > 88 static void init_crc_table() > 89 { > 90 if( crctbl[0]==1 ) // uninitialized > 91 for( unsigned long c,n=0; n!=256; n++ ) > 92 { > 93 c = n; > 94 for( unsigned long k=8; k; k-- ) > 95 c = (c&1) ? ((0xedb88320L)^(c>>1)) : (c>>1); > 96 crctbl[n] = c; > 97 } > 98 } > 99 > 100 static unsigned long crc( unsigned long c, unsigned char* cp,int cnt ) > 101 { > 102 while( cnt-- ) > 103 c = (c>>8)^crctbl[(c&0xff)^*cp++]; > 104 return c; > 105 } > 106 > 107 //--- cpt ---------------------------------------------------------- > 108 > 109 bool CArcCpt::read_main_hdr() > 110 { > 111 //-- 先頭のバイトは MagicNumber : 0x01 なはず。 > 112 m_nMacBinOffset = 0; > 113 if( 8 != cpt.read( tmp, 8 ) ) > 114 return false; > 115 if( tmp[0] != 1 ) > 116 { > 117 if( 0 != tmp[0] > 118 || 120 != cpt.read( tmp, 120 ) > 119 || 8 != cpt.read( tmp, 8 ) > 120 || tmp[0] != 1 ) // MacBinスキップ > 121 return false; > 122 m_nMacBinOffset = 128; > 123 } > 124 > 125 //-- indexまで跳ぶ > 126 cpt.seek( (tmp[4]<<24) + (tmp[5]<<16) + (tmp[6]<<8) + (tmp[7]) - 8 ); > 127 return true; > 128 } > 129 > 130 bool CArcCpt::check_index_crc() > 131 { > 132 bool folder; > 133 unsigned int size; > 134 > 135 //-- CRC(DWORD), EntryNum(WORD), CommentLen(BYTE) > 136 if( !cpt.read( tmp, 7 ) ) > 137 return false; > 138 > 139 init_crc_table(); > 140 > 141 DWORD CRC = (tmp[0]<<24) + (tmp[1]<<16) + (tmp[2]<<8) + tmp[3]; > 142 WORD EntryNum = (tmp[4]<<8) + tmp[5]; > 143 if( tmp[6] != cpt.read( tmp+7, tmp[6] ) ) > 144 return false; > 145 DWORD chk_crc = crc( 0xffffffff, tmp+4, 3+tmp[6] ); > 146 > 147 //-- 全ヘッダを走査してCRC計算 > 148 for( WORD i=0; i!=EntryNum; i++ ) > 149 { > 150 tmp[0] = cpt.getc(); > 151 > 152 if( tmp[0] & 0x80 ) folder = true, size = (tmp[0]&0x3f) + 2 > 153 else folder = false, size = (tmp[0]) > 154 if( size != cpt.read( tmp+1, size ) ) return false; > 155 > 156 chk_crc = crc( chk_crc, tmp, 1+size ); > 157 } > 158 > 159 return CRC == chk_crc; > 160 } > 161 > 162 bool CArcCpt::operation_for_each( bool o_list, aflArray* files ) > 163 { > 164 //-- Entry数を得る > 165 if( !cpt.read( tmp, 7 ) ) > 166 return false; > 167 WORD EntryNum = (tmp[4]<<8) + tmp[5]; > 168 cpt.read( tmp, tmp[6] ); > 169 > 170 //-- ダイアログ準備 > 171 pdlg = files ? NULL : new CArcProgressDlg( EntryNum ); > 172 > 173 //-- 操作 > 174 kiPath path; > 175 m_nIndexPos = cpt.tell(); > 176 bool ans = recurse( o_list, files, path, 0, EntryNum ); > 177 delete pdlg; > 178 return ans; > 179 } > 180 > 181 bool CArcCpt::recurse( bool o_list, aflArray* files, kiPath& path, int base, int > 182 { > 183 bool folder; > 184 unsigned int size; > 185 kiPath pthtmp; > 186 > 187 for( int i=0; i<num; i++ ) > 188 { > 189 cpt.seekTo( m_nIndexPos ); > 190 > 191 //-- tmpへindex読み込み > 192 > 193 tmp[0] = cpt.getc(); > 194 if( tmp[0] & 0x80 ) folder = true, size = (tmp[0]&0x3f) + 2 > 195 else folder = false, size = (tmp[0]) > 196 if( size != cpt.read( tmp+1, size ) ) return false; > 197 m_nIndexPos = cpt.tell(); // 次のIndexの位置を記憶 > 198 > 199 //-- ヘッダ解析 > 200 > 201 // 0: filename_len (BYTE) > 202 // 1-n: filename (with no '\0') > 203 char filename[MAX_PATH]; > 204 ki_memcpy( filename, tmp+1, tmp[0] ); > 205 filename[ *tmp ] = '\0'; > 206 for( char* pp=filename; *pp; pp=kiStr::next(pp) ) > 207 { > 208 if( kiStr::isLeadByte(*pp) ) > 209 continue; > 210 if( *pp<' ' || *pp>'~' ) > 211 *pp = '_'; > 212 else switch( *pp ) > 213 { > 214 case '\\': case '/': case ':': case '*': > 215 case '?': case '\"': case '<': case '>': case '| > 216 *pp = '_'; > 217 } > 218 } > 219 // filenameが2個以上の.のみからなっていたら_に書き換え > 220 { > 221 int dots = 0; > 222 char* pp; > 223 for( pp=filename; *pp; pp=kiStr::next(pp) ) > 224 if( *pp == '.' ) { ++dots; } > 225 else { dots=-1; break; } > 226 if( dots >= 2 ) > 227 for( pp=filename; *pp; ++pp ) > 228 *pp = '_'; > 229 } > 230 > 231 //-- ダイアログ処理 > 232 > 233 pthtmp = path, pthtmp += filename; > 234 > 235 if( pdlg ) > 236 { > 237 pdlg->change( pthtmp, base+i+1 ); > 238 if( !pdlg->msgloop() ) > 239 return false; > 240 } > 241 > 242 //-- フォルダ処理 > 243 > 244 if( folder ) > 245 { > 246 unsigned long fldlen = (tmp[size-1]<<8) + tmp[size]; > 247 pthtmp += '\\'; > 248 > 249 if( o_list ) > 250 { > 251 files->forcelen( base+i+1 ); > 252 ki_strcpy( (*files)[base+i].inf.szFileName, ptht > 253 (*files)[base+i].isfile = false; > 254 } > 255 > 256 if( !recurse( o_list, files, pthtmp, base+i+1, fldlen ) > 257 return false; > 258 i += fldlen; > 259 } > 260 > 261 //-- ファイル処理 > 262 > 263 else > 264 { > 265 const unsigned char* hdr = tmp + (size+1) - 80; > 266 > 267 unsigned long rsrcSkip; bool lzhFlag; > 268 if( (hdr[68]<<24) + (hdr[69]<<16) + (hdr[70]<<8) + hdr[7 > 269 { > 270 // もし dataForkが存在するならば > 271 dataULen = (hdr[68]<<24) + (hdr[69]<<16) + (hdr[ > 272 dataCLen = (hdr[76]<<24) + (hdr[77]<<16) + (hdr[ > 273 rsrcSkip = (hdr[72]<<24) + (hdr[73]<<16) + (hdr[ > 274 lzhFlag = (hdr[63]&4) !=0; > 275 } > 276 else > 277 { > 278 // dataForkが存在しないならば > 279 dataULen = (hdr[64]<<24) + (hdr[65]<<16) + (hdr[ > 280 dataCLen = (hdr[72]<<24) + (hdr[73]<<16) + (hdr[ > 281 rsrcSkip = 0; > 282 lzhFlag = (hdr[63]&2) !=0; > 283 } > 284 > 285 if( o_list ) // リストへ加える > 286 { > 287 files->forcelen( base+i+1 ); > 288 ki_strcpy( (*files)[base+i].inf.szFileName, ptht > 289 ki_strcpy( (*files)[base+i].inf.szMode, lzhFlag > 290 (*files)[base+i].inf.dwCompressedSize = dataCLen > 291 (*files)[base+i].inf.dwOriginalSize = dataULen; > 292 (*files)[base+i].isfile = true; > 293 } > 294 else if( !files || (*files)[base+i].selected ) > 295 { > 296 if( !(hdr[63] & 1) ) > 297 { > 298 pthtmp.mkdir(); > 299 cpt.seekTo( (hdr[36]<<24) + (hdr[37]<<16 > 300 rsrcSkip + m_nMa > 301 if( out.open( pthtmp, false ) ) > 302 { > 303 cptmelt( lzhFlag ); > 304 out.close(); > 305 } > 306 } > 307 } > 308 } > 309 } > 310 > 311 return true; > 312 } > 313 > 314 //-- 解凍処理 ------------------------------------------------ > 315 > 316 #define ESC1 0x81 > 317 #define ESC2 0x82 > 318 #define NONESEEN 0 > 319 #define ESC1SEEN 1 > 320 #define ESC2SEEN 2 > 321 > 322 void CArcCpt::cptmelt( bool isRL ) > 323 { > 324 cpt_outstat = NONESEEN; > 325 cpt_LZptr = 0; > 326 cpt_blocksize = 0x1fff0; > 327 > 328 if( isRL ) > 329 cpt_rle_lzh(); > 330 else > 331 while( dataCLen-- ) > 332 cpt_outch( cpt.getc() ); > 333 } > 334 > 335 void CArcCpt::cpt_outch(unsigned char ch) > 336 { > 337 cpt_LZbuff[ cpt_LZptr++ & (CIRCSIZE-1) ] = ch; > 338 > 339 switch( cpt_outstat ) > 340 { > 341 case NONESEEN: > 342 if( ch==ESC1 ) > 343 cpt_outstat = ESC1SEEN; > 344 else > 345 dataULen--,out.putc( cpt_savechar=ch ); > 346 break; > 347 > 348 case ESC1SEEN: > 349 if( ch==ESC2 ) > 350 cpt_outstat = ESC2SEEN; > 351 else > 352 { > 353 dataULen--,out.putc( cpt_savechar=ESC1 ); > 354 if( ch!=ESC1 ) > 355 { > 356 cpt_outstat = NONESEEN; > 357 dataULen--,out.putc( cpt_savechar=ch ); > 358 } > 359 } > 360 break; > 361 > 362 case ESC2SEEN: > 363 cpt_outstat = NONESEEN; > 364 if( ch!=0 ) > 365 while( --ch ) > 366 dataULen--,out.putc(cpt_savechar); > 367 else > 368 { > 369 dataULen--,out.putc( ESC1 ); > 370 dataULen--,out.putc( cpt_savechar=ESC2 ); > 371 } > 372 } > 373 } > 374 > 375 void CArcCpt::cpt_rle_lzh() > 376 { > 377 int block_count; > 378 unsigned int bptr; > 379 int Huffchar, LZlength, LZoffs; > 380 > 381 cpt_LZbuff[CIRCSIZE - 3] = 0; > 382 cpt_LZbuff[CIRCSIZE - 2] = 0; > 383 cpt_LZbuff[CIRCSIZE - 1] = 0; > 384 cpt_LZptr = 0; > 385 > 386 while( dataULen!=0 ) > 387 { > 388 cpt_readHuff(256,cpt_Hufftree); > 389 cpt_readHuff( 64,cpt_LZlength); > 390 cpt_readHuff(128,cpt_LZoffs ); > 391 block_count = 0; > 392 cpt_newbits = (cpt.getc()<<8); > 393 cpt_newbits = cpt_newbits | cpt.getc(); > 394 cpt_newbits = cpt_newbits << 16; > 395 cpt_bitsavail = 16; > 396 while( block_count<cpt_blocksize && dataULen!=0 ) > 397 { > 398 if( cpt_getbit() ) > 399 { > 400 Huffchar = gethuffbyte(cpt_Hufftree); > 401 cpt_outch((unsigned char)Huffchar); > 402 block_count += 2; > 403 } > 404 else > 405 { > 406 LZlength = gethuffbyte(cpt_LZlength); > 407 LZoffs = gethuffbyte(cpt_LZoffs); > 408 LZoffs = (LZoffs << 6) | cpt_get6bits(); > 409 bptr = cpt_LZptr - LZoffs; > 410 while( LZlength-->0 ) > 411 cpt_outch(cpt_LZbuff[bptr++&(CIRCSIZE-1) > 412 block_count += 3; > 413 } > 414 } > 415 } > 416 } > 417 > 418 int CArcCpt::gethuffbyte(node* l_nodelist) > 419 { > 420 register node *np; > 421 np = l_nodelist; > 422 while(np->flag == 0) > 423 np = cpt_getbit() ? np->one : np->zero; > 424 return np->byte; > 425 } > 426 > 427 void CArcCpt::cpt_readHuff(int size,node* Hufftree) > 428 { > 429 sf_entry tree_entry[256 + SLACK]; > 430 int tree_entries; > 431 int tree_MaxLength; > 432 int treeBytes, i, len; > 433 sf_entry *ejm1; > 434 int j; > 435 sf_entry *entry; > 436 sf_entry tmp; > 437 int entries; > 438 unsigned a, b; > 439 int codelen, lvlstart, next, parents; > 440 int tree_count[32]; > 441 > 442 treeBytes = cpt.getc(); > 443 if( size<treeBytes*2 ) > 444 return; > 445 for( i=0; i!=32; i++ ) > 446 tree_count[i] = 0; > 447 i = 0; > 448 tree_MaxLength = 0; > 449 tree_entries = 0; > 450 while( treeBytes-->0 ) > 451 { > 452 int c=cpt.getc(); > 453 len = c >> 4; > 454 > 455 if(len != 0) > 456 { > 457 if(len > tree_MaxLength) > 458 tree_MaxLength = len; > 459 tree_count[len]++; > 460 tree_entry[tree_entries].Value = i; > 461 tree_entry[tree_entries++].BitLength = len; > 462 } > 463 i++; > 464 len = c & 0x0f; > 465 if(len != 0) > 466 { > 467 if(len > tree_MaxLength) > 468 tree_MaxLength = len; > 469 tree_count[len]++; > 470 tree_entry[tree_entries].Value = i; > 471 tree_entry[tree_entries++].BitLength = len; > 472 } > 473 i++; > 474 } > 475 > 476 j = 0; > 477 for( i=0; i<=tree_MaxLength; i++ ) > 478 j = (j << 1) + tree_count[i]; > 479 j = (1 <<tree_MaxLength) - j; > 480 for( i=0; i<j; i++ ) > 481 { > 482 tree_entry[tree_entries].Value = size; > 483 tree_entry[tree_entries++].BitLength = tree_MaxLength; > 484 } > 485 > 486 entry = &(tree_entry[0]); > 487 entries = tree_entries; > 488 for( i=0; ++i<entries; ) > 489 { > 490 tmp = entry[i]; > 491 b = tmp.BitLength; > 492 j = i; > 493 while((j > 0) && ((a = (ejm1 = &(entry[j - 1]))->BitLength) >= b > 494 { > 495 if((a == b) && (ejm1->Value <= tmp.Value)) > 496 break; > 497 *(ejm1 + 1) = *ejm1; > 498 --j; > 499 } > 500 entry[j] = tmp; > 501 } > 502 > 503 i = tree_entries - 1; > 504 lvlstart = next = size * 2 + SLACK - 1; > 505 for(codelen = tree_MaxLength; codelen >= 1; --codelen) > 506 { > 507 while((i >= 0) && (tree_entry[i].BitLength == codelen)) > 508 { > 509 Hufftree[next].byte = tree_entry[i].Value; > 510 Hufftree[next].flag = 1; > 511 next--; > 512 i--; > 513 } > 514 parents = next; > 515 if(codelen > 1) > 516 { > 517 for(j = lvlstart; j > parents + 1; j-= 2) > 518 { > 519 Hufftree[next].one = &(Hufftree[j]); > 520 Hufftree[next].zero = &(Hufftree[j - 1]); > 521 Hufftree[next].flag = 0; > 522 next--; > 523 } > 524 } > 525 lvlstart = parents; > 526 } > 527 Hufftree[0].one = &(Hufftree[next + 2]); > 528 Hufftree[0].zero = &(Hufftree[next + 1]); > 529 Hufftree[0].flag = 0; > 530 } > 531 > 532 int CArcCpt::cpt_get6bits() > 533 { > 534 int cn,b=(cpt_newbits >> 26) & 0x3f; > 535 cpt_bitsavail -= 6; > 536 cpt_newbits <<= 6; > 537 if(cpt_bitsavail < 16) > 538 { > 539 cn = (cpt.getc() << 8); > 540 cn |= cpt.getc(); > 541 cpt_newbits |= (cn << (16 - cpt_bitsavail)); > 542 cpt_bitsavail += 16; > 543 } > 544 return b; > 545 } > 546 > 547 int CArcCpt::cpt_getbit() > 548 { > 549 int b = (cpt_newbits >> 31) & 1; > 550 cpt_bitsavail--; > 551 if( cpt_bitsavail<16 ) > 552 { > 553 cpt_newbits |= (cpt.getc() << 8); > 554 cpt_newbits |= cpt.getc(); > 555 cpt_bitsavail += 16; > 556 } > 557 cpt_newbits <<= 1; > 558 return b; > 559 }

Added ArcCpt.h version [909c16b823b96e7b]

> 1 #ifndef AFX_ARCCPT_H__B5D13025_2DA9_4489_8BCB_ACB84B908A84__INCLUDED_ > 2 #define AFX_ARCCPT_H__B5D13025_2DA9_4489_8BCB_ACB84B908A84__INCLUDED_ > 3 > 4 #include "Archiver.h" > 5 #include "SubDlg.h" > 6 > 7 class CArcCpt : public CArchiver > 8 { > 9 public: > 10 CArcCpt() : CArchiver("cpt.bin.") {} > 11 > 12 private: > 13 int v_load(){return aCheck|aMelt|aList|aMeltEach;} > 14 bool v_check( const kiPath& aname ); > 15 int v_contents( const kiPath& aname, kiPath& dname ); > 16 int v_melt( const arcname& aname, const kiPath& ddir, const aflArray* f > 17 bool v_list( const arcname& aname, aflArray& files ); > 18 kiStr v_name(const char*) const { return "CPT"; } > 19 > 20 CArcProgressDlg* pdlg; > 21 > 22 //-- cpt archive operations ---------------- > 23 > 24 unsigned int m_nMacBinOffset; > 25 unsigned int m_nIndexPos; > 26 unsigned int dataULen, dataCLen; > 27 > 28 kiFile cpt,out; > 29 unsigned char tmp[270]; // temp > 30 > 31 bool read_main_hdr(); > 32 bool check_index_crc(); > 33 bool operation_for_each( bool o_list=true, aflArray* files=NULL ); > 34 bool recurse( bool o_list, aflArray* files, kiPath& path, int base, int > 35 void cptmelt( bool isRL ); > 36 > 37 //-- lzh - rle ------------------------------- > 38 > 39 #define CIRCSIZE 8192 > 40 class sf_entry > 41 { > 42 public: > 43 int Value; > 44 int BitLength; > 45 }; > 46 class node > 47 { > 48 public: > 49 int flag, byte; > 50 node *one, *zero; > 51 }; > 52 > 53 void cpt_outch( unsigned char ch ); > 54 BYTE cpt_outstat,cpt_savechar; > 55 void cpt_rle_lzh(); > 56 int cpt_get6bits(); > 57 int cpt_getbit(); > 58 void cpt_readHuff(int size,node* Hufftree); > 59 > 60 int gethuffbyte(node* l_nodelist); > 61 #define SLACK 6 > 62 node cpt_Hufftree[512 + SLACK],cpt_LZlength[128 + SLACK],cpt_LZoffs[256 > 63 unsigned char cpt_LZbuff[CIRCSIZE]; > 64 unsigned int cpt_LZptr; > 65 unsigned long cpt_newbits; > 66 int cpt_bitsavail; > 67 int cpt_blocksize; > 68 }; > 69 > 70 #endif

Added ArcDLL.cpp version [83474074d1b2482a]

> 1 > 2 #include "stdafx.h" > 3 #include "ArcDLL.h" > 4 #include "NoahApp.h" > 5 > 6 int CArcDLL::v_load() > 7 { > 8 // DLLの存在確認 > 9 if( !dll.exist() ) > 10 return 0; > 11 > 12 // 圧縮メソッドリストを設定 > 13 DWORD cp = set_cmpr_mhd(); > 14 > 15 // Abiltyを返す > 16 return (m_Ecmd ? aCheck|aMelt : 0) | (m_Xcmd ? aList|aMeltEach : 0) | cp > 17 } > 18 > 19 int CArcDLL::v_melt( const arcname& aname, const kiPath& ddir, const aflArray* f > 20 { > 21 // 出力先をカレントに > 22 ::SetCurrentDirectory( ddir ); > 23 > 24 // 解凍コマンド > 25 kiStr cmd = ( !files || files->len()==0 ) ? m_Ecmd : m_Xcmd; > 26 > 27 // 書庫名 > 28 cmd += " \"", cmd += aname.basedir, cmd += aname.lname, cmd += "\" \""; > 29 // 出力先ディレクトリ > 30 cmd += ddir, cmd += '"'; > 31 > 32 // ( もしあれば )ファイルリスト > 33 if( files ) > 34 for( unsigned int i=0; i!=files->len(); i++ ) > 35 if( (*files)[i].selected ) > 36 cmd += " \"", > 37 decorate_add_melt( cmd, (*files)[i].inf.szFileNa > 38 cmd += '"'; > 39 > 40 // コマンド実行! > 41 return dll.cmd( cmd ); > 42 } > 43 > 44 int CArcDLL::v_compress( const kiPath& base, > 45 const wfdArray& files, > 46 const kiPath& ddir, > 47 const int method, > 48 const bool sfx ) > 49 { > 50 // 基底はカレント > 51 ::SetCurrentDirectory( base ); > 52 > 53 // ファイル名リスト作成 > 54 kiStr lst; > 55 for( unsigned int i=0; i!=files.len(); i++ ) > 56 { > 57 lst += '"'; > 58 decorate_add_cmpr( lst, files[i].cFileName ); > 59 if( files[i].dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ) > 60 if( m_Wild==1 ) > 61 lst += "\\*"; > 62 else if( m_Wild==2 ) > 63 lst += "\\*.*"; > 64 lst += "\" "; > 65 } > 66 > 67 // 書庫名作成 > 68 > 69 // Ver 3.14 -- フォルダなら拡張子を除かない > 70 // b2eの方は今更どーしようもないので、ここだけ変更 > 71 // Ver 3.19 -- 削る拡張子は一個だけ > 72 kiStr aname; > 73 if( files[0].dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ) > 74 { > 75 aname = kiPath::name( files[0].cFileName ); > 76 } > 77 else > 78 { > 79 switch(mycnf().extnum()) > 80 { > 81 case 0: aname = files[0].cFileName;break; > 82 case 1: kiPath(files[0].cFileName).getBody_all(aname);break; > 83 default:kiPath(files[0].cFileName).getBody(aname);break; > 84 } > 85 } > 86 > 87 > 88 // 圧縮! > 89 if( sfx ) > 90 { > 91 kiPath tmp; > 92 myapp().get_tempdir( tmp ); > 93 > 94 kiPath tsfx(tmp); tsfx+=aname; tsfx+=".exe"; > 95 kiPath rsfx(ddir); rsfx+=aname; rsfx+=".exe"; > 96 > 97 int ans = cmpr( method, aname, tmp, lst ); > 98 if( ans < 0x8000 ) > 99 { > 100 ans = 0x8020; > 101 ::SetCurrentDirectory( tmp ); > 102 if( arc2sfx( aname ) ) > 103 if( ::CopyFile( tsfx, rsfx, FALSE ) ) > 104 ans = 0; > 105 // カレントを戻しておかないとあとで削除できない… > 106 ::SetCurrentDirectory( base ); > 107 } > 108 > 109 tmp.remove(); > 110 return ans; > 111 } > 112 else > 113 return cmpr( method, aname, ddir, lst ); > 114 } > 115 > 116 int CArcDLL::cmpr( int mhd, kiStr& aname,const kiPath& to,const kiStr& lst ) > 117 { > 118 aname += '.', aname+=get_cmpr_ext(mhd); > 119 > 120 kiStr cmd = get_cmpr_cmd(mhd); > 121 cmd += " \""; > 122 cmd += to; > 123 cmd += aname; > 124 cmd += "\" "; > 125 cmd += lst; > 126 return dll.cmd( cmd ); > 127 } > 128 > 129 bool CArcDLL::arc2sfx( const kiStr& aname ) > 130 { > 131 kiStr cmd=m_Scmd; cmd+=" \"", cmd+=aname, cmd+='"'; > 132 return 0x8000>dll.cmd( cmd ); > 133 } > 134 > 135 //----------------------------------------------------------------------// > 136 > 137 void CArcDLL::decorate_add_cmpr( kiStr& lst, const char* fname ) > 138 { > 139 lst += fname; > 140 } > 141 > 142 void CArcDLL::decorate_add_melt( kiStr& lst, const char* fname ) > 143 { > 144 lst += fname; > 145 } > 146 > 147 void CArcDLL_DotSlash::decorate_add_cmpr( kiStr& lst, const char* fname ) > 148 { > 149 // 先頭 - や @ 対策に、.\\ でエスケープする > 150 if( *fname=='-' || *fname=='@' ) > 151 lst += ".\\"; > 152 lst += fname; > 153 } > 154 > 155 void CArcLzh::decorate_add_cmpr( kiStr& lst, const char* fname ) > 156 { > 157 // UNLHA32.DLL にはこの問題回避用のオプション -gb が。 > 158 if( *fname=='-' ) > 159 lst += "-gb"; > 160 lst += fname; > 161 } > 162 > 163 void CArcLzh::decorate_add_melt( kiStr& lst, const char* fname ) > 164 { > 165 // UNLHA32.DLL にはこの問題回避用のオプション -gb が。 > 166 if( *fname=='-' ) > 167 lst += "-gb"; > 168 lst += fname; > 169 } > 170 > 171 void CArcZip::decorate_add_cmpr( kiStr& lst, const char* fname ) > 172 { > 173 // 先頭 - や @ 対策に、[-] [@] と置換する > 174 if( *fname=='-' || *fname=='@' ) > 175 lst+='[', lst+=*fname++, lst+=']'; > 176 > 177 // 途中の [ を [[] に置換する > 178 while( *fname ) > 179 if( kiStr::isLeadByte(*fname) ) > 180 { > 181 lst += *fname++, lst += *fname++; > 182 } > 183 else > 184 { > 185 lst += *fname; > 186 if( *fname++=='[' ) > 187 lst += "[]"; > 188 } > 189 } > 190 > 191 //----------------------------------------------------------------------// > 192 > 193 DWORD CArcLzh::set_cmpr_mhd() > 194 { > 195 set_cmp_ext( "lzh" ); > 196 add_cmp_mhd( "lh5" ), add_cmp_mhd( "lh6" ), add_cmp_mhd( "lh7" ); > 197 return aCompress|aArchive; > 198 } > 199 > 200 const char* CArcLzh::get_cmpr_cmd( int method ) > 201 { > 202 static char cmd[] = "a -d -jso1 -- -jm2"; > 203 cmd[ sizeof(cmd)-2 ] = (char)('2'+method); > 204 return cmd; > 205 } > 206 > 207 //----------------------------------------------------------------------// > 208 > 209 DWORD CArcZip::set_cmpr_mhd() > 210 { > 211 set_cmp_ext( "zip" ); > 212 add_cmp_mhd( "store" ), > 213 add_cmp_mhd( "normal", true ), add_cmp_mhd( "password" ); > 214 return aCompress|aArchive; > 215 } > 216 > 217 const char* CArcZip::get_cmpr_cmd( int method ) > 218 { > 219 switch( method ) > 220 { > 221 case 0: return "-rS0"; > 222 case 2: return "-rS9e"; > 223 } > 224 return "-rS9"; > 225 } > 226 > 227 //----------------------------------------------------------------------// > 228 > 229 DWORD CArcCab::set_cmpr_mhd() > 230 { > 231 set_cmp_ext( "cab" ); > 232 add_cmp_mhd( "MSZIP" ), add_cmp_mhd( "LZX21",true ); > 233 return aCompress|aArchive; > 234 } > 235 > 236 const char* CArcCab::get_cmpr_cmd( int method ) > 237 { > 238 return method==0 ? "-a -r -mz" : "-a -r -ml:21"; > 239 } > 240 > 241 //----------------------------------------------------------------------// > 242 > 243 DWORD CArcTar::set_cmpr_mhd() > 244 { > 245 set_cmp_ext( "tar" ); > 246 add_cmp_mhd( "normal" ), add_cmp_mhd( "gzip",true ), add_cmp_mhd( "bzip2 > 247 add_cmp_mhd( "xz" ), add_cmp_mhd( "lzma" ); > 248 return aCompress|aArchive; > 249 } > 250 > 251 const char* CArcTar::get_cmpr_ext( int method ) > 252 { > 253 switch( method ) > 254 { > 255 case 1: return "tgz"; > 256 case 2: return "tbz"; > 257 case 3: return "tar.xz"; > 258 case 4: return "tar.lzma"; > 259 } > 260 return "tar"; > 261 } > 262 > 263 const char* CArcTar::get_cmpr_cmd( int method ) > 264 { > 265 switch( method ) > 266 { > 267 case 1: return "-cvz9 --"; > 268 case 2: return "-cvB --"; > 269 case 3: return "-cvJ9 --"; > 270 case 4: return "-cv --lzma=9 --"; > 271 } > 272 return "-cv --"; > 273 } > 274 > 275 //----------------------------------------------------------------------// > 276 > 277 DWORD CArcBga::set_cmpr_mhd() > 278 { > 279 set_cmp_ext( "bga" ); > 280 add_cmp_mhd( "gzip" ), add_cmp_mhd( "bzip2",true ); > 281 return aCompress|aArchive; > 282 } > 283 > 284 const char* CArcBga::get_cmpr_ext( int method ) > 285 { > 286 return method==0 ? "gza" : "bza"; > 287 } > 288 > 289 const char* CArcBga::get_cmpr_cmd( int method ) > 290 { > 291 return "a -r -a"; > 292 } > 293 > 294 //----------------------------------------------------------------------// > 295 > 296 DWORD CArcYz1::set_cmpr_mhd() > 297 { > 298 set_cmp_ext( "yz1" ); > 299 add_cmp_mhd( "normal" ), add_cmp_mhd( "password" ); > 300 return aCompress|aArchive; > 301 } > 302 > 303 const char* CArcYz1::get_cmpr_cmd( int method ) > 304 { > 305 return method==0 ? "c --" : "c -p --"; > 306 } > 307 > 308 //----------------------------------------------------------------------// > 309 > 310 bool CArcRar::v_check( const kiPath& aname ) > 311 { > 312 // Unrar.dll のバグ?のため、ファイルハンドルが解放されないことが > 313 // あるので、自前のチェックルーチンを用いる > 314 // # Subset of XacRett #39 > 315 > 316 bool ans=false; > 317 kiFile rar; > 318 if( !rar.open(aname) ) > 319 return false; > 320 > 321 unsigned char mark[10]; > 322 if( 10!=rar.read(mark,10) ) > 323 return false; > 324 > 325 if( mark[0]==0x52 && mark[1]==0x45 && mark[2]==0x7e && mark[3]==0x5e ) > 326 return true; > 327 else if( mark[0]==0x52 && mark[1]==0x61 && > 328 mark[2]==0x72 && mark[3]==0x21 && > 329 mark[4]==0x1a && mark[5]==0x07 && > 330 mark[6]==0x00 && mark[9]==0x73 ) > 331 return true; > 332 else > 333 { > 334 unsigned char* mem=new unsigned char[0x20000]; > 335 int siz = rar.read( mem, 0x1FFF0 ); > 336 > 337 for( unsigned char* p=mem; p<mem+siz-9; p++ ) > 338 { > 339 if( *p!=0x52 )continue; > 340 if( p[1]==0x45 && p[2]==0x7e && p[3]==0x5e && > 341 mem[18]==0x52 && mem[19]==0x53 && > 342 mem[20]==0x46 && mem[21]==0x58) > 343 { ans=true; break; } > 344 > 345 if( p[1]==0x61 && p[2]==0x72 && p[3]==0x21 && > 346 p[4]==0x1a && p[5]==0x07 && p[6]==0x00 && > 347 p[9]==0x73 ) > 348 { ans=true; break; } > 349 } > 350 delete [] mem; > 351 } > 352 > 353 return ans; > 354 } > 355 > 356 int CArcRar::v_melt( const arcname& aname, const kiPath& ddir, const aflArray* f > 357 { > 358 // Unrarはコマンド指定でダイアログを消せないので、 > 359 // OwnerWindowを指定する > 360 > 361 if( files && files->len() ) > 362 dll.own( app()->mainhwnd() ); > 363 > 364 int ans = CArcDLL::v_melt( aname, ddir, files ); > 365 > 366 if( files && files->len() ) > 367 dll.fre(); > 368 > 369 return ans; > 370 } > 371 > 372 int CArcUnZip::v_melt( const arcname& aname, const kiPath& ddir, const aflArray* > 373 { > 374 // UnZip32.dllが妙なフォルダを作り出すバグ対策 > 375 > 376 int ans = CArcDLL::v_melt( aname, ddir, files ); > 377 dll.unload(); > 378 return ans; > 379 } > 380 > 381 //----------------------------------------------------------------------// > 382 > 383 DWORD CArc7z::set_cmpr_mhd() > 384 { > 385 set_cmp_ext( "7z" ); > 386 add_cmp_mhd( "LZMA", true ); > 387 add_cmp_mhd( "LZMA(std)" ); > 388 add_cmp_mhd( "LZMA(fast)" ); > 389 add_cmp_mhd( "PPMd" ); > 390 return aCompress|aArchive; > 391 } > 392 > 393 const char* CArc7z::get_cmpr_cmd( int method ) > 394 { > 395 if( m_SfxMode ) > 396 switch( method ) > 397 { > 398 case 0: return "a -t7z -sfx -m0=LZMA -r0 -mx=9 --"; > 399 case 1: return "a -t7z -sfx -m0=LZMA -r0 -mx=5 --"; > 400 case 2: return "a -t7z -sfx -m0=LZMA -r0 -mx=1 --"; > 401 default: return "a -t7z -sfx -m0=PPMd -r0 -mx=9 --"; > 402 } > 403 else > 404 switch( method ) > 405 { > 406 case 0: return "a -t7z -m0=LZMA -r0 -mx=9 --"; > 407 case 1: return "a -t7z -m0=LZMA -r0 -mx=5 --"; > 408 case 2: return "a -t7z -m0=LZMA -r0 -mx=1 --"; > 409 default: return "a -t7z -m0=PPMd -r0 -mx=9 --"; > 410 } > 411 } > 412 > 413 int CArc7z::v_compress( const kiPath& base, const wfdArray& files, const kiPath& > 414 { > 415 m_SfxMode = sfx; // 処理を横取りしてSFXモードを記憶 > 416 return CArcDLL::v_compress(base,files,ddir,method,false); > 417 } > 418 > 419 const char* CArc7z::get_cmpr_ext( int method ) > 420 { > 421 return m_SfxMode ? "exe" : "7z"; > 422 } > 423 > 424 //----------------------------------------------------------------------// > 425 > 426 DWORD CArc7zZip::set_cmpr_mhd() > 427 { > 428 set_cmp_ext( "zip" ); > 429 add_cmp_mhd( "7-zip", true ); > 430 return aCompress|aArchive; > 431 } > 432 > 433 const char* CArc7zZip::get_cmpr_cmd( int method ) > 434 { > 435 return "a -tzip -r0 -mx=9 --"; > 436 } > 437 > 438 int CArc7zZip::v_compress( const kiPath& base, const wfdArray& files, const kiPa > 439 { > 440 // 処理を横取りして通常圧縮 > 441 return CArcDLL::v_compress(base,files,ddir,method,false); > 442 } > 443

Added ArcDLL.h version [a694505ce13887ba]

> 1 #ifndef AFX_ARCDLL_H__911C109D_A40E_4722_A6F7_E3ACB8C2D2E3__INCLUDED_ > 2 #define AFX_ARCDLL_H__911C109D_A40E_4722_A6F7_E3ACB8C2D2E3__INCLUDED_ > 3 > 4 #include "Archiver.h" > 5 > 6 class CArcDLL : public CArchiver > 7 { > 8 public: > 9 CArcDLL( > 10 const char* Dllname, // DLL名 > 11 const char* Exts, // 対応拡張子 > 12 const char* Ecmd, // 解凍用コマンド > 13 const char* Xcmd, // 部分解凍用コマンド > 14 unsigned int Wild=1, // ワイルドカードの形式( 0=no(*) 1=* 2=*.* ) > 15 const char* Scmd=NULL )// SFX変換用コマンド > 16 : dll( Dllname ), CArchiver( Exts ), m_Ecmd( Ecmd ), > 17 m_Xcmd( Xcmd ), m_Wild( Wild ), m_Scmd( Scmd ) {} > 18 > 19 protected: //-- 派生してもよし > 20 virtual DWORD set_cmpr_mhd() > 21 { return 0; } > 22 virtual const char* get_cmpr_ext( int method ) > 23 { return cmp_ext(); } > 24 virtual const char* get_cmpr_cmd( int method ) > 25 { return ""; } > 26 virtual void decorate_add_cmpr( kiStr& lst, const char* fname ); > 27 virtual void decorate_add_melt( kiStr& lst, const char* fname ); > 28 > 29 protected: //-- 内部処理 > 30 CArcModule dll; > 31 bool v_ver( kiStr& str ){ dll.ver(str); return true; } > 32 bool v_check( const kiPath& aname ){ return dll.chk(aname); } > 33 int v_contents( const kiPath& aname, kiPath& dname ){ return dll.cnt(an > 34 bool v_list( const arcname& aname, aflArray& files ){ return dll.lst_dll > 35 > 36 int v_load(); > 37 int v_melt( const arcname& aname, const kiPath& ddir, const aflArray* f > 38 int v_compress( const kiPath& base, const wfdArray& files, const kiPath > 39 kiStr v_name(const char*) const { return dll.name(); } > 40 > 41 private: > 42 const char *m_Ecmd, *m_Xcmd, *m_Scmd; > 43 unsigned int m_Wild; > 44 int cmpr( int mhd, kiStr& aname,const kiPath& to,const kiStr& lst ); > 45 bool arc2sfx( const kiStr& aname ); > 46 }; > 47 > 48 //------------------------------------------------------------// > 49 > 50 class CArcDLL_DotSlash : public CArcDLL > 51 { > 52 // "./-" や "./@" とすることでとりあえず無理矢理圧縮する形式 > 53 virtual void decorate_add_cmpr( kiStr& lst, const char* fname ); > 54 > 55 protected: > 56 CArcDLL_DotSlash( > 57 const char* Dllname, > 58 const char* Exts, > 59 const char* Ecmd, > 60 const char* Xcmd, > 61 unsigned int Wild=1, > 62 const char* Scmd=NULL ) > 63 : CArcDLL( Dllname, Exts, Ecmd, Xcmd, Wild, Scmd ) {} > 64 }; > 65 > 66 //------------------------------------------------------------// > 67 > 68 class CArcRar : public CArcDLL > 69 { > 70 public: > 71 CArcRar() : CArcDLL( > 72 "Unrar32.dll", > 73 "rar.", > 74 "-x", > 75 "-x -s -y --" ) {} > 76 > 77 private: > 78 kiStr v_name(const char*) const { return "RAR"; } > 79 // 特別に派生 > 80 bool v_check( const kiPath& aname ); > 81 int v_melt( const arcname& aname, const kiPath& ddir, const aflArray* f > 82 }; > 83 > 84 //------------------------------------------------------------// > 85 > 86 class CArcUnZip : public CArcDLL > 87 { > 88 public: > 89 CArcUnZip() : CArcDLL( > 90 "UnZip32.dll", > 91 "zip.jar.", > 92 "-x", > 93 "-x --i -o" ) {} > 94 private: > 95 kiStr v_name(const char*) const { return "ZIP"; } > 96 // 特別に派生 > 97 int v_melt( const arcname& aname, const kiPath& ddir, const aflArray* f > 98 }; > 99 > 100 //------------------------------------------------------------// > 101 > 102 class CArcLzh : public CArcDLL > 103 { > 104 public: > 105 CArcLzh() : CArcDLL( > 106 "Unlha32.dll", > 107 "lzh.lha.lzs.", > 108 "x -a1 -jf0", > 109 "x -a1 -jf0 -jyo -p1 -n -gm --", > 110 0, > 111 "s -gw3 -x1" ) {} > 112 private: > 113 kiStr v_name(const char*) const { return "LZH"; } > 114 DWORD set_cmpr_mhd(); > 115 const char* get_cmpr_cmd( int method ); > 116 void decorate_add_cmpr( kiStr& lst, const char* fname ); > 117 void decorate_add_melt( kiStr& lst, const char* fname ); > 118 }; > 119 > 120 //------------------------------------------------------------// > 121 > 122 class CArcZip : public CArcDLL > 123 { > 124 public: > 125 CArcZip() : CArcDLL( > 126 "Zip32j.dll", > 127 "", > 128 NULL, > 129 NULL, > 130 1, > 131 "--sfx" ) {} > 132 private: > 133 DWORD set_cmpr_mhd(); > 134 const char* get_cmpr_cmd( int method ); > 135 void decorate_add_cmpr( kiStr& lst, const char* fname ); > 136 }; > 137 > 138 //------------------------------------------------------------// > 139 > 140 class CArcCab : public CArcDLL_DotSlash > 141 { > 142 public: > 143 CArcCab() : CArcDLL_DotSlash( > 144 "Cab32.dll", > 145 "cab.", > 146 "-x", > 147 "-x -i -o", > 148 1, > 149 "-f" ) {} > 150 private: > 151 kiStr v_name(const char*) const { return "CAB"; } > 152 DWORD set_cmpr_mhd(); > 153 const char* get_cmpr_cmd( int method ); > 154 }; > 155 > 156 //------------------------------------------------------------// > 157 > 158 class CArcTar : public CArcDLL_DotSlash > 159 { > 160 public: > 161 CArcTar() : CArcDLL_DotSlash( > 162 "Tar32.dll", > 163 "tar.tgz.tbz.gz.bz2.z.taz.rpm.deb.ar.xz.lzma.", > 164 "-xvf", > 165 "--check-all-path=1 --display-dialog=0 -xvf", > 166 2 ) {} > 167 private: > 168 #define ARCHIVETYPE_NORMAL 0 > 169 #define ARCHIVETYPE_TAR 1 > 170 #define ARCHIVETYPE_TARGZ 2 > 171 #define ARCHIVETYPE_TARZ 3 > 172 #define ARCHIVETYPE_GZ 4 > 173 #define ARCHIVETYPE_Z 5 > 174 #define ARCHIVETYPE_TARBZ2 6 > 175 #define ARCHIVETYPE_BZ2 7 > 176 > 177 #define ARCHIVETYPE_CPIO 32 > 178 #define ARCHIVETYPE_CPIOGZ 32+4 > 179 #define ARCHIVETYPE_CPIOZ 32+5 > 180 #define ARCHIVETYPE_CPIOBZ2 32+7 > 181 > 182 #define ARCHIVETYPE_AR 48 > 183 #define ARCHIVETYPE_ARGZ 48+4 > 184 #define ARCHIVETYPE_ARZ 48+5 > 185 #define ARCHIVETYPE_ARBZ2 48+7 > 186 kiStr v_name(const char* an) const { switch(dll.arctype(an)) { > 187 case ARCHIVETYPE_GZ: return "GZ"; > 188 case ARCHIVETYPE_Z: return "Z"; > 189 case ARCHIVETYPE_BZ2: return "BZ2"; > 190 case ARCHIVETYPE_TARGZ: return "TAR+GZ"; > 191 case ARCHIVETYPE_TARZ: return "TAR+Z"; > 192 case ARCHIVETYPE_TARBZ2: return "TAR+BZ2"; > 193 case ARCHIVETYPE_CPIOGZ: return kiStr("rpm").isSame(kiPath::ext( > 194 case ARCHIVETYPE_CPIOZ: return "CPIO+Z"; > 195 case ARCHIVETYPE_CPIOBZ2:return "CPIO+BZ2"; > 196 case ARCHIVETYPE_ARGZ: return "AR+GZ"; > 197 case ARCHIVETYPE_ARZ: return "AR+Z"; > 198 case ARCHIVETYPE_ARBZ2: return "AR+BZ2"; > 199 case ARCHIVETYPE_AR: return "AR"; > 200 case ARCHIVETYPE_CPIO: return "CPIO"; > 201 default: return "TAR"; > 202 }} > 203 const char* get_cmpr_ext( int method ); > 204 DWORD set_cmpr_mhd(); > 205 const char* get_cmpr_cmd( int method ); > 206 }; > 207 > 208 //------------------------------------------------------------// > 209 > 210 class CArcBga : public CArcDLL_DotSlash > 211 { > 212 public: > 213 CArcBga() : CArcDLL_DotSlash( > 214 "Bga32.dll", > 215 "gza.bza.", > 216 "x -a", > 217 "x -a -i -o", > 218 0, > 219 "s" ) {} > 220 private: > 221 kiStr v_name(const char* an) const { return dll.arctype(an)==2 ? "BZA" : > 222 const char* get_cmpr_ext( int method ); > 223 DWORD set_cmpr_mhd(); > 224 const char* get_cmpr_cmd( int method ); > 225 }; > 226 > 227 //------------------------------------------------------------// > 228 > 229 class CArcYz1 : public CArcDLL > 230 { > 231 public: > 232 CArcYz1() : CArcDLL( > 233 "Yz1.dll", > 234 "yz1.", > 235 "x", > 236 "x -y -z -i2 --", > 237 0, > 238 "s" ) {} > 239 private: > 240 kiStr v_name(const char*) const { return "YZ1"; } > 241 DWORD set_cmpr_mhd(); > 242 const char* get_cmpr_cmd( int method ); > 243 }; > 244 > 245 //------------------------------------------------------------// > 246 > 247 class CArcArj : public CArcDLL > 248 { > 249 public: > 250 CArcArj() : CArcDLL > 251 ( "Unarj32j.dll", "arj.", "x -jyc", "x -y -p -hm -i -!" ) {} > 252 > 253 private: > 254 kiStr v_name(const char*) const { return "ARJ"; } > 255 }; > 256 > 257 //------------------------------------------------------------// > 258 > 259 class CArcGca : public CArcDLL > 260 { > 261 public: > 262 CArcGca() : CArcDLL > 263 ( "UnGCA32.dll", "gca.", "e -sx1", "ex -xx1 -sx0 -yx0" ) {} > 264 > 265 private: > 266 kiStr v_name(const char*) const { return "GCA"; } > 267 }; > 268 > 269 //------------------------------------------------------------// > 270 > 271 class CArc7z : public CArcDLL_DotSlash > 272 { > 273 public: > 274 CArc7z() : CArcDLL_DotSlash( > 275 "7-zip32.dll", > 276 "7z.zip.jar.", > 277 "x --", > 278 "x -y -hide --", > 279 1, > 280 "" ) {} > 281 private: > 282 kiStr v_name(const char* an) const { return dll.arctype(an)==1 ? "ZIP" : > 283 DWORD set_cmpr_mhd(); > 284 const char* get_cmpr_cmd( int method ); > 285 const char* get_cmpr_ext( int method ); > 286 virtual int v_compress( const kiPath& base, const wfdArray& files, const > 287 bool m_SfxMode; > 288 }; > 289 > 290 //------------------------------------------------------------// > 291 > 292 class CArc7zZip : public CArcDLL_DotSlash > 293 { > 294 public: > 295 CArc7zZip() : CArcDLL_DotSlash( > 296 "7-zip32.dll", > 297 "",NULL,NULL,1,"" ) {} > 298 private: > 299 DWORD set_cmpr_mhd(); > 300 const char* get_cmpr_cmd( int method ); > 301 virtual bool v_ver( kiStr& ){return false;}//CArc7zに任せる > 302 virtual int v_compress( const kiPath& base, const wfdArray& files, const > 303 }; > 304 > 305 //------------------------------------------------------------// > 306 > 307 #endif

Added ArcMsc.cpp version [b142f0fccb14651d]

> 1 > 2 #include "stdafx.h" > 3 #include "ArcMsc.h" > 4 #include "NoahApp.h" > 5 > 6 bool CArcMsc::header( kiFile& fp, unsigned long* siz, char* ext ) > 7 { > 8 // 読み出す > 9 unsigned char p[14]; > 10 if( 14!=fp.read(p,14) ) > 11 return false; > 12 > 13 // ヘッダ構造:SZDD芋'3A [ext3rd] [orisiz(dword)] > 14 static const unsigned char head[9]={ 0x53,0x5A,0x44,0x44,0x88,0xF0,0x27, > 15 > 16 for( int i=0; i!=9; i++ ) > 17 if( p[i]!=head[i] ) > 18 return false; > 19 > 20 if( ext ) > 21 *ext = (char)p[9]; > 22 > 23 DWORD x = p[10]+(p[11]<<8)+(p[12]<<16)+(p[13]<<24); > 24 if( siz ) > 25 *siz=x; > 26 > 27 // 原理的に、16倍という圧縮率は出ない > 28 return (x <= fp.getSize()*16); > 29 } > 30 > 31 void CArcMsc::filename( char* oname, const char* ol, char ext ) > 32 { > 33 // コピー > 34 ki_strcpy( oname, ol ); > 35 > 36 // 最後が '_' なら消しておく。 > 37 bool bIs_=false; > 38 for( char* p=oname; *p; p=kiStr::next(p) ) > 39 bIs_ = (*p=='_'); > 40 if( bIs_ ) > 41 *(--p)='\0'; > 42 > 43 > 44 if( ext ) > 45 { > 46 // 拡張子復元 > 47 *p++ = ext; > 48 *p = '\0'; > 49 } > 50 else > 51 { > 52 // 拡張子自動補完 > 53 const char* x = kiPath::ext(oname); > 54 if( ki_strlen(x)==2 ) > 55 { > 56 ::CharLower(oname); > 57 > 58 if( 0==ki_strcmp(x,"ex") )(*p++)='e'; > 59 else if( 0==ki_strcmp(x,"co") )(*p++)='m'; > 60 else if( 0==ki_strcmp(x,"sc") )(*p++)='r'; > 61 > 62 else if( 0==ki_strcmp(x,"dl") )(*p++)='l'; > 63 else if( 0==ki_strcmp(x,"oc") )(*p++)='x'; > 64 else if( 0==ki_strcmp(x,"dr") )(*p++)='v'; > 65 else if( 0==ki_strcmp(x,"vx") )(*p++)='d'; > 66 else if( 0==ki_strcmp(x,"38") )(*p++)='6'; > 67 else if( 0==ki_strcmp(x,"sy") )(*p++)='s'; > 68 else if( 0==ki_strcmp(x,"cp") )(*p++)='l'; > 69 else if( 0==ki_strcmp(x,"li") )(*p++)='b'; > 70 else if( 0==ki_strcmp(x,"tt") )(*p++)='f'; > 71 > 72 else if( 0==ki_strcmp(x,"ch") )(*p++)='m'; > 73 else if( 0==ki_strcmp(x,"hl") )(*p++)='p'; > 74 else if( 0==ki_strcmp(x,"cn") )(*p++)='t'; > 75 else if( 0==ki_strcmp(x,"da") )(*p++)='t'; > 76 > 77 else if( 0==ki_strcmp(x,"tx") )(*p++)='t'; > 78 else if( 0==ki_strcmp(x,"wr") )(*p++)='i'; > 79 else if( 0==ki_strcmp(x,"wa") )(*p++)='v'; > 80 else if( 0==ki_strcmp(x,"mi") )(*p++)='d'; > 81 else if( 0==ki_strcmp(x,"rm") )(*p++)='i'; > 82 else if( 0==ki_strcmp(x,"bm") )(*p++)='p'; > 83 else if( 0==ki_strcmp(x,"rl") )(*p++)='e'; > 84 else if( 0==ki_strcmp(x,"cu") )(*p++)='r'; > 85 else if( 0==ki_strcmp(x,"do") )(*p++)='c'; > 86 else if( 0==ki_strcmp(x,"ic") )(*p++)='o'; > 87 else if( 0==ki_strcmp(x,"re") )(*p++)='g'; > 88 else if( 0==ki_strcmp(x,"rt") )(*p++)='f'; > 89 else if( 0==ki_strcmp(x,"ht") )(*p++)='m'; > 90 else (*p++ > 91 > 92 *p = '\0'; > 93 } > 94 } > 95 } > 96 > 97 bool CArcMsc::v_check( const kiPath& aname ) > 98 { > 99 kiFile fp; > 100 if( fp.open( aname ) ) > 101 return header( fp,NULL,NULL ); > 102 return false; > 103 } > 104 > 105 bool CArcMsc::v_list( const arcname& aname, aflArray& files ) > 106 { > 107 kiPath fname(aname.basedir); fname+=aname.lname; > 108 > 109 arcfile x; > 110 kiFile fp; > 111 char ext; > 112 if( !fp.open( fname ) || !header( fp, &x.inf.dwOriginalSize, &ext ) ) > 113 return false; > 114 ki_strcpy( x.inf.szMode, "-msc-" ); > 115 filename( x.inf.szFileName, aname.lname, ext ); > 116 x.inf.dwCompressedSize = fp.getSize(); > 117 x.isfile = true; > 118 > 119 // TODO: 日時をどうする? > 120 > 121 files.add( x ); > 122 return true; > 123 } > 124 > 125 int CArcMsc::v_melt( const arcname& aname, const kiPath& ddir, const aflArray* f > 126 { > 127 kiFile fp; > 128 kiPath fname(aname.basedir); fname+=aname.lname; > 129 kiPath oname(ddir); > 130 char tmp[MAX_PATH]; > 131 > 132 // ヘッダ読み込み > 133 char ext; > 134 unsigned long alllen; > 135 if( !fp.open( fname ) || !header(fp,&alllen,&ext) ) > 136 return 0xffff; > 137 fp.close(); > 138 filename( tmp, aname.lname, ext ); > 139 oname += tmp; > 140 > 141 // 書庫・出力先を開く > 142 OFSTRUCT of; > 143 of.cBytes = sizeof(of); > 144 int FROM = ::LZOpenFile( const_cast<char*>((const char*)fname),&of,OF_RE > 145 int TO = ::LZOpenFile( const_cast<char*>((const char*)oname),&of,OF_WR > 146 if( FROM<0 || TO<0 ) > 147 return 0xffff; > 148 // 解凍 > 149 bool ans = (0<=::LZCopy( FROM,TO )); > 150 // 終了 > 151 ::LZClose( TO ); > 152 ::LZClose( FROM ); > 153 return ans?0:0xffff; > 154 } > 155 > 156 int CArcMsc::v_compress( const kiPath& base, const wfdArray& files, const kiPath > 157 { > 158 ::SetCurrentDirectory( base ); > 159 > 160 // 元ファイルを開く > 161 kiFile in; > 162 if( !in.open( files[0].cFileName ) ) > 163 return 0xffff; > 164 > 165 // ヘッダ情報・圧縮先ファイル名 > 166 char h_Ext3 = '\0'; > 167 unsigned long h_Len = in.getSize(); > 168 > 169 char aname[MAX_PATH]; > 170 ki_strcpy( aname, files[0].cFileName ); > 171 for( char *x=aname, *last=aname; *x; x=kiStr::next(x) ) > 172 last = x; > 173 if( !IsDBCSLeadByte(*last) ) > 174 h_Ext3=*last; > 175 *last = '_', *(last+1) = '\0'; > 176 > 177 // 圧縮先開く > 178 ::SetCurrentDirectory( ddir ); > 179 > 180 // 圧縮先を開く > 181 kiFile out; > 182 if( !out.open( aname, false ) ) > 183 return 0xffff; > 184 > 185 // タイムスタンプコピー > 186 FILETIME ct, at, mt; > 187 ::GetFileTime(in.getHandle(), &ct, &at, &mt); > 188 ::SetFileTime(out.getHandle(), &ct, &at, &mt); > 189 > 190 // ヘッダ書き込み > 191 unsigned char head[14]={ 0x53,0x5A,0x44,0x44,0x88,0xF0,0x27,0x33,0x41,(u > 192 (unsigned char)(h_Len&0 > 193 (unsigned char)((h_Len> > 194 out.write( head, 14 ); > 195 > 196 // 圧縮作業 > 197 CArcProgressDlg dlg( h_Len, true ); > 198 dlg.change( files[0].cFileName ); > 199 if( !do_lzss( in, out, dlg ) ) > 200 { > 201 out.close(); > 202 ::DeleteFile(aname); > 203 return 0x8020; > 204 } > 205 return 0; > 206 } > 207 > 208 > 209 //-- 12bit LZSS -----------------------------------------------// > 210 > 211 > 212 #define N 4096 // slide窓のサイズ 2^12 bytes > 213 #define F 18 // 最長一致長 2^(16-12)+2 bytes > 214 > 215 static unsigned char window[N+F-1]; > 216 static int dad[N+1], lson[N+1], rson[N+257]; > 217 static int matchpos, matchlen; > 218 > 219 static void init_tree() > 220 { > 221 //-- 木を初期化 > 222 > 223 int i; > 224 for( i=N+1; i<=N+256; i++ ) // root: 0x00 -- 0xff > 225 rson[i] = N; > 226 for( i=0; i<N ; i++ ) > 227 dad[i] = N; > 228 } > 229 > 230 static void insert_node( int r ) > 231 { > 232 //-- [位置r]から始まる[列str]を木に登録 > 233 unsigned char* str = window + r; > 234 rson[r] = lson[r] = N; > 235 > 236 //-- ついでに一致長・位置も記録する > 237 matchlen = 2; > 238 > 239 // 一文字目でrootを選ぶ > 240 int i, p = N+1+str[0], cmp=1; > 241 for(; ;) > 242 { > 243 if( cmp >= 0 ) > 244 { > 245 // 右に進む > 246 if( rson[p] != N ) > 247 p = rson[p]; > 248 // 右にはもうnodeがないのでそこに登録して終了 > 249 else > 250 { > 251 rson[p] = r; > 252 dad[r] = p; > 253 return; > 254 } > 255 } > 256 else > 257 { > 258 // 左に進む > 259 if( lson[p] != N ) > 260 p = lson[p]; > 261 // 左にはもうnodeがないのでそこに登録して終了 > 262 else > 263 { > 264 lson[p] = r; > 265 dad[r] = p; > 266 return; > 267 } > 268 } > 269 > 270 // 現在のnodeとstrを比較( i==一致長 ) > 271 for( i=1; i<F; i++ ) > 272 if( cmp = str[i] - window[p+i] ) > 273 break; > 274 > 275 // 今まで見つけたものの中で最長だったら記憶 > 276 if( i > matchlen ) > 277 { > 278 matchpos = p; > 279 if( (matchlen=i) == F ) > 280 break; > 281 } > 282 } > 283 > 284 // [位置p]の列と長さFで一致した場合、ここに来る > 285 // p の在ったところを r で置き換える > 286 > 287 dad[r] = dad[p]; > 288 lson[r] = lson[p]; > 289 rson[r] = rson[p]; > 290 dad[lson[p]] = r; > 291 dad[rson[p]] = r; > 292 > 293 if( rson[dad[p]]==p ) > 294 rson[dad[p]] = r; > 295 else > 296 lson[dad[p]] = r; > 297 > 298 dad[p] = N; > 299 } > 300 > 301 static void delete_node( int p ) > 302 { > 303 //-- [位置p]の要素を木から削除 > 304 > 305 if( dad[p] == N ) // 既に木に入ってないのでおしまい > 306 return; > 307 > 308 int q; > 309 > 310 if( rson[p] == N ) > 311 q = lson[p]; // 唯一の子を上に持ち上げる > 312 else if( lson[p] == N ) > 313 q = rson[p]; // 唯一の子を上に持ち上げる > 314 else > 315 { > 316 q = lson[p]; > 317 > 318 if( rson[q] != N ) > 319 { > 320 // 左の枝の最右、つまり自分より一つ小さいnodeを持ち上げる > 321 do > 322 q = rson[q]; > 323 while( rson[q] != N ); > 324 > 325 rson[dad[q]] = lson[q]; > 326 dad[lson[q]] = dad[q]; > 327 lson[q] = lson[p]; > 328 dad[lson[p]] = q; > 329 } > 330 rson[q] = rson[p]; > 331 dad[rson[p]] = q; > 332 } > 333 > 334 dad[q] = dad[p]; > 335 if( rson[dad[p]] == p ) > 336 rson[dad[p]] = q; > 337 else > 338 lson[dad[p]] = q; > 339 dad[p] = N; > 340 } > 341 > 342 bool CArcMsc::do_lzss( kiFile& in, kiFile& out, CArcProgressDlg& dlg ) > 343 { > 344 int i, c, len, r, s; > 345 unsigned char code[17]={0}, mask=1, codeptr=1; > 346 > 347 s = 2; // s = データ読込位置 > 348 r = N - 16; // r = 木への挿入位置 > 349 > 350 // クリア > 351 init_tree(); > 352 ki_memset( window+2, ' ', N-F ); > 353 > 354 // 先頭18bytes入力 > 355 for( len=0 ; len<F ; len++ ) > 356 { > 357 if( -1 == (c = in.getc()) ) > 358 break; > 359 window[r+len] = c; > 360 } > 361 window[0] = window[r+16]; > 362 window[1] = window[r+17]; > 363 if( len==0 ) > 364 return true; > 365 > 366 // 木へ挿入 > 367 for( i=F ; i>=0 ; i-- ) > 368 insert_node( r-i ); > 369 > 370 // ループ > 371 unsigned int total_read=18,prgr_read=0; > 372 > 373 do > 374 { > 375 if( prgr_read > 5000 ) > 376 { > 377 dlg.change( NULL, total_read+=prgr_read ); > 378 prgr_read-=5000; > 379 if( !dlg.msgloop() ) > 380 { > 381 prgr_read=0xffffffff; > 382 break; > 383 } > 384 } > 385 > 386 if( matchlen > len ) > 387 matchlen=len; > 388 > 389 if( matchlen < 3 ) // 一致なし > 390 { > 391 matchlen = 1; > 392 code[0] |= mask; > 393 code[codeptr++] = window[r]; > 394 } > 395 else // 一致あり > 396 { > 397 // [pos&0xff] [pos&0xf00 | len-3] > 398 code[codeptr++] = (unsigned char)matchpos; > 399 code[codeptr++] = (unsigned char)(((matchpos>>4)&0xf0) | > 400 } > 401 > 402 if( (mask<<=1)==0 ) // code が 8Block になっていたら出力 > 403 { > 404 out.write( code, codeptr ); > 405 // コードバッファ初期化 > 406 code[0] = 0; > 407 codeptr = mask = 1; > 408 } > 409 > 410 // 出力した分読み込む > 411 int lastmatchlen = matchlen; > 412 for( i=0 ; i<lastmatchlen; i++ ) > 413 { > 414 if( -1 == (c=in.getc()) ) > 415 break; > 416 prgr_read++; > 417 > 418 // [位置s]に一文字書き込み > 419 delete_node( s ); > 420 window[s] = c; > 421 if( s < F-1 ) window[ N+s ] = c; > 422 > 423 s = (s+1) & (N-1); // s++ > 424 r = (r+1) & (N-1); // r++ > 425 > 426 // 木に[位置r]のデータを挿入 > 427 insert_node( r ); > 428 } > 429 > 430 // EOF後処理 > 431 while( i++ < lastmatchlen ) > 432 { > 433 delete_node( s ); > 434 s = (s+1) & (N-1); // s++ > 435 r = (r+1) & (N-1); // r++ > 436 if( --len ) > 437 insert_node( r ); > 438 } > 439 > 440 } while( len > 0 ); > 441 > 442 if( prgr_read==0xffffffff ) > 443 return false; > 444 > 445 // 8block境界に揃える > 446 if( mask != 1 ) > 447 { > 448 while( mask<<=1 ) > 449 code[codeptr++] = 0; > 450 out.write( code, codeptr ); > 451 } > 452 > 453 return true; > 454 } > 455

Added ArcMsc.h version [3dbc15b093e50358]

> 1 #ifndef AFX_ARCMSC_H__1891072B_44D7_4577_AF05_6D221A2FD0DD__INCLUDED_ > 2 #define AFX_ARCMSC_H__1891072B_44D7_4577_AF05_6D221A2FD0DD__INCLUDED_ > 3 > 4 #include "Archiver.h" > 5 #include "SubDlg.h" > 6 > 7 class CArcMsc : public CArchiver > 8 { > 9 public: > 10 CArcMsc() : CArchiver("") {} > 11 > 12 private: > 13 int v_load() > 14 { > 15 set_cmp_ext( "??_" ), add_cmp_mhd( "MSCompress" ); > 16 return aCheck|aMelt|aList|aMeltEach|aCompress; > 17 } > 18 int v_contents( const kiPath& aname, kiPath& dnam ){return aSingleFile; > 19 > 20 bool v_check( const kiPath& aname ); > 21 int v_melt( const arcname& aname, const kiPath& ddir, const aflArray* f > 22 bool v_list( const arcname& aname, aflArray& files ); > 23 int v_compress( const kiPath& base, const wfdArray& files, const kiPath > 24 kiStr v_name(const char*) const { return "MSCompress"; } > 25 > 26 private: > 27 bool header( kiFile& fp, unsigned long* siz, char* ext ); > 28 void filename( char* oname, const char* ol, char ext ); > 29 bool do_lzss( kiFile& in, kiFile& out, CArcProgressDlg& dlg ); > 30 }; > 31 > 32 #endif

Added Archiver.cpp version [10de0296b1be04cd]

> 1 // Archiver.cpp > 2 //-- CArchiver -- common interface in 'Noah' for archiving routine -- > 3 > 4 #include "stdafx.h" > 5 #include "Archiver.h" > 6 #include "NoahApp.h" > 7 > 8 > 9 > 10 CArcModule::CArcModule( const char* name, bool us ) > 11 : m_dll(NULL) > 12 { > 13 // SearchPathの前にカレントディレクトリをnoah.exeと同じ場所へ > 14 char prev_cur[MAX_PATH]; > 15 ::GetCurrentDirectory(MAX_PATH, prev_cur); > 16 kiSUtil::switchCurDirToExeDir(); > 17 > 18 if( 0!=::SearchPath( NULL,name,NULL,MAX_PATH,m_name,NULL ) ) > 19 { > 20 const char* xt=kiPath::ext(name); > 21 if( 0!=ki_strcmpi("dll",xt) ) > 22 { > 23 // EXEの場合 > 24 m_type = us ? EXEUS : EXE; > 25 } > 26 else > 27 { > 28 // DLLの場合 > 29 m_dll = new kiArcDLLRaw(name); > 30 m_type = DLL; > 31 if(name<=xt-8&&xt[-6]=='G'&&xt[-5]=='C'&&xt[-4]=='A' ) > 32 m_type = DLLGCA; > 33 else if(name==xt-6&&xt[-6]=='B'&&xt[-5]=='g'&&xt[-4]=='a > 34 m_type = DLLBGA; > 35 } > 36 } > 37 else > 38 { > 39 // ファイルが無いか、シェルのコマンドの場合 > 40 // バッファオーバーフローの危険…(^^; > 41 ki_strcpy( m_name, name ); > 42 m_type = SHLCMD; > 43 } > 44 > 45 // カレントを戻す > 46 ::SetCurrentDirectory(prev_cur); > 47 } > 48 > 49 CArcModule::~CArcModule() > 50 { > 51 delete m_dll; > 52 } > 53 > 54 int CArcModule::cmd( const char* cmd, bool mini ) > 55 { > 56 if( m_dll ) > 57 { > 58 // アーカイバDLLモードなら簡単に終了 > 59 char buf[1024]; > 60 return m_dll->command( NULL, cmd, buf, sizeof(buf) ); > 61 } > 62 > 63 // NTかどうかのチェック等 > 64 kiPath tmpdir; > 65 static const bool isNT = > 66 (app()->osver().dwPlatformId==VER_PLATFORM_WIN32_NT); > 67 static const char* const closeShell = > 68 (isNT ? "cmd.exe /c " : "command.com /c "); > 69 > 70 // コマンド文字列作成 > 71 kiVar theCmd( m_name ); > 72 theCmd.quote(); > 73 theCmd += ' '; > 74 theCmd += cmd; > 75 > 76 if( m_type==SHLCMD ) > 77 { > 78 // シェルコマンドの場合 > 79 theCmd = closeShell + theCmd; > 80 } > 81 else if( m_type==EXEUS ) > 82 { > 83 // USモードの場合 > 84 if( isNT ) > 85 { > 86 ::SetEnvironmentVariable( "NOAHCMD", theCmd ); > 87 theCmd = "%NOAHCMD%"; > 88 } > 89 > 90 // 切替バッチファイル生成 > 91 myapp().get_tempdir(tmpdir); > 92 kiPath batname(tmpdir); > 93 batname += "ncmd.bat"; > 94 kiFile bat; > 95 bat.open( batname,false ); > 96 bat.write( "@CHCP 437\r\n@", 12 ); > 97 bat.write( theCmd, theCmd.len() ); > 98 bat.write( "\r\n@CHCP 932\r\n", 13 ); > 99 > 100 theCmd = closeShell; > 101 theCmd += batname; > 102 } > 103 > 104 // プロセス開始 > 105 PROCESS_INFORMATION pi; > 106 STARTUPINFO si={sizeof(STARTUPINFO)}; > 107 si.dwFlags =STARTF_USESHOWWINDOW; > 108 si.wShowWindow=mini?SW_MINIMIZE:SW_SHOW; > 109 if( !::CreateProcess( NULL,const_cast<char*>((const char*)theCmd), > 110 NULL,NULL,FALSE,CREATE_NEW_PROCESS_GROUP|NORMAL_PRIORITY_CLASS, > 111 NULL,NULL, &si,&pi ) ) > 112 return 0xffff; > 113 > 114 // 終了待機 > 115 ::CloseHandle( pi.hThread ); > 116 while( WAIT_OBJECT_0 != ::WaitForSingleObject( pi.hProcess, 500 ) ) > 117 kiWindow::msg(); > 118 int ex; > 119 ::GetExitCodeProcess( pi.hProcess, (DWORD*)&ex ); > 120 ::CloseHandle( pi.hProcess ); > 121 > 122 // 後始末 > 123 if( m_type==EXEUS ) > 124 tmpdir.remove(); > 125 return ex; > 126 } > 127 > 128 void CArcModule::ver( kiStr& str ) > 129 { > 130 // バージョン情報を整形して表示 > 131 char *verstr="----", buf[200]; > 132 if( m_dll ) > 133 { > 134 if( WORD ver=m_dll->getVer() ) > 135 { > 136 WORD sub=m_dll->getVerSub(); > 137 ::wsprintf( verstr=buf, "%d.%02d%c", ver/100, ver%100, ( > 138 } > 139 } > 140 else if( m_type != NOTEXIST ) > 141 { > 142 // 可能ならリソースからの取得を試みる > 143 if( CArchiver::GetVersionInfoStr( m_name, buf, sizeof(buf) ) ) > 144 verstr = buf; > 145 else > 146 verstr = "OK!"; > 147 } > 148 > 149 char ans[300]; > 150 ::wsprintf( ans, "%-12s %s", kiPath::name(m_name), verstr ); > 151 str = ans; > 152 } > 153 > 154 bool CArcModule::lst_dll( const arcname& aname, aflArray& files, const char* wil > 155 { > 156 if( !m_dll ) > 157 return false; > 158 kiPath nm(aname.basedir); nm+=aname.lname; > 159 HANDLE h = m_dll->openArc( app()->mainhwnd(), nm, M_CHECK_FILENAME_ONLY| > 160 if( !h ) return false; > 161 > 162 int ct=0; > 163 files.forcelen( 1 ); > 164 if( 0==m_dll->findfirst( h, wild, &files[0].inf ) ) > 165 { > 166 do > 167 { > 168 INDIVIDUALINFO& iii = files[ct].inf; > 169 files[ct].isfile = > 170 ( *files[ct].inf.szAttribute!='d' > 171 && !kiPath::endwithyen(files[ct].inf.szFileName) > 172 && !(m_dll->getAttr( h )&FILE_ATTRIBUTE_DIRECTOR > 173 files.forcelen( 1+(++ct) ); > 174 } while( 0==m_dll->findnext( h, &files[ct].inf ) ); > 175 } > 176 files.forcelen( ct ); > 177 > 178 m_dll->closeArc( h ); > 179 return true; > 180 } > 181 > 182 int CArcModule::cnt( const kiPath& aname, kiPath& dname, const char* wild ) > 183 { > 184 int ans = aUnknown; > 185 > 186 if( m_dll ) > 187 if( HANDLE h = m_dll->openArc( app()->mainhwnd(), aname, M_CHECK > 188 { > 189 INDIVIDUALINFO inf1st, inf; > 190 if( 0==m_dll->findfirst( h, wild, &inf1st ) ) > 191 { > 192 for( const char* y=inf1st.szFileName; *y && *y!= > 193 if( y!=inf1st.szFileName ) > 194 { > 195 if( 0!=m_dll->findnext( h, &inf ) ) > 196 ans = *y ? aSingleDir : aSingleF > 197 else if( *y && (y-inf1st.szFileName!=1 | > 198 { > 199 ans = aSingleDir; > 200 do > 201 if( !ki_memcmp( inf1st.s > 202 { > 203 ans = aUnknown; > 204 break; > 205 } > 206 while( 0==m_dll->findnext( h, &i > 207 } > 208 if( ans==aSingleDir ) > 209 inf1st.szFileName[y-inf1st.szFil > 210 } > 211 } > 212 m_dll->closeArc( h ); > 213 } > 214 > 215 return ans; > 216 } > 217 > 218 bool CArcModule::lst_exe( const char* lstcmd, aflArray& files, > 219 const char* BL, int BSL, const char* EL, int SL, int dx ) > 220 // BeginLine, BeginSkipLine, EndLine, SkipLine, delta-x > 221 { > 222 files.forcelen(0); > 223 > 224 // 作業変数 > 225 const int BLLEN = ki_strlen(BL); > 226 const int ELLEN = ki_strlen(EL); > 227 int /*ct=0,*/ step=BSL; > 228 > 229 // EXE以外のものではダメ > 230 if( m_type!=EXE && m_type!=EXEUS ) > 231 return false; > 232 > 233 // コマンド文字列作成 > 234 kiVar theCmd( m_name ); > 235 theCmd.quote(); > 236 theCmd += ' '; > 237 theCmd += lstcmd; > 238 > 239 // パイプ作成(両方とも継承ON。DupHanするの面倒いので…(^^;) > 240 HANDLE rp, wp; > 241 SECURITY_ATTRIBUTES sa = {sizeof(SECURITY_ATTRIBUTES),NULL,TRUE}; > 242 ::CreatePipe( &rp, &wp, &sa, 4096 ); > 243 > 244 // プロセス開始 > 245 PROCESS_INFORMATION pi; > 246 STARTUPINFO si = {sizeof(STARTUPINFO)}; > 247 si.dwFlags = STARTF_USESHOWWINDOW|STARTF_USESTDHANDLES; > 248 si.wShowWindow = SW_MINIMIZE; > 249 si.hStdOutput = si.hStdError = wp; > 250 BOOL ok = > 251 ::CreateProcess( NULL,const_cast<char*>((const char*)theCmd),NUL > 252 NULL, TRUE, CREATE_NEW_PROCESS_GROUP|NORMAL_PRIORITY_CLA > 253 NULL, NULL, &si,&pi ); > 254 ::CloseHandle( wp ); > 255 > 256 // 失敗したらパイプを閉じて即終了 > 257 if( !ok ) > 258 { > 259 ::CloseHandle( rp ); > 260 return false; > 261 } > 262 ::CloseHandle( pi.hThread ); > 263 > 264 // 解析作業etc(バッファのサイズはパイプのサイズの倍以上でなくてはならない) > 265 char buf[8192], *end=buf; > 266 for( bool endpr=false; !endpr; ) > 267 { > 268 // 終了待機 > 269 endpr = (WAIT_OBJECT_0==::WaitForSingleObject(pi.hProcess,500)); > 270 kiWindow::msg(); > 271 > 272 // パイプから読みとり > 273 DWORD red; > 274 ::PeekNamedPipe( rp, NULL, 0, NULL, &red, NULL ); > 275 if( red==0 ) > 276 continue; > 277 ::ReadFile( rp, end, buf+sizeof(buf)-end, &red, NULL ); > 278 end += red; > 279 > 280 // 行に分解 > 281 char *lss=buf; > 282 for( char *ls, *le=buf; le<end; ++le ) > 283 { > 284 // 行末を探す > 285 for( lss=ls=le; le<end; ++le ) > 286 if( *le=='\n' ) > 287 break; > 288 if( le==end ) > 289 break; > 290 > 291 // 先頭行スキップ処理 > 292 if( *BL ) > 293 { > 294 if( BLLEN<=le-ls && ki_memcmp(BL,ls,BLLEN) ) > 295 BL = ""; > 296 } > 297 // 行ステップ処理 > 298 else if( --step<=0 ) > 299 { > 300 step = SL; > 301 > 302 // 終端行処理 > 303 if( ELLEN==0 ) > 304 { if( le-ls<=1 ) break; } > 305 else if( ELLEN<=le-ls && ki_memcmp(EL,ls,ELLEN) > 306 break; > 307 > 308 // 文字スキップ処理 > 309 if( dx>=0 ) > 310 ls += dx; > 311 // 引数ブロックスキップ処理 > 312 else > 313 { > 314 for( ;ls<le;++ls ) > 315 if( *ls!=' ' && *ls!='\t' && *ls > 316 break; > 317 for( int t=dx; ++t; ) > 318 { > 319 for( ;ls<le;++ls ) > 320 if( *ls==' ' || *ls=='\t > 321 break; > 322 for( ;ls<le;++ls ) > 323 if( *ls!=' ' && *ls!='\t > 324 break; > 325 } > 326 } > 327 // ファイル名コピー > 328 if( ls<le ) > 329 { > 330 arcfile af; ki_memzero(&af, sizeof(af)); > 331 af.inf.dwOriginalSize = 0xffffffff; > 332 // ki_memzero( &files[ct].inf, sizeof(files > 333 // files[ct].inf.dwOriginalSize = 0xfffffff > 334 > 335 int i=0; > 336 bool prev_is_space=false; > 337 while( i<FNAME_MAX32 && ls<le ) > 338 { > 339 if( *ls==' ' ) > 340 { > 341 if( prev_is_space ) > 342 break; > 343 prev_is_space = true; > 344 } > 345 else if( *ls=='\t' || *ls=='\r' > 346 break; > 347 else > 348 prev_is_space = false; > 349 > 350 af.inf.szFileName[i++] = *ls++; > 351 // files[ct].inf.szFileName[i++] = > 352 } > 353 if( prev_is_space ) > 354 --i; > 355 if( i ) > 356 { > 357 /* > 358 files[ct].inf.szFileName[i] = '\ > 359 files[ct].isfile = true; > 360 files.forcelen( 1+(++ct) ); > 361 */ > 362 af.inf.szFileName[i] = '\0'; > 363 af.isfile = true; > 364 files.add(af); > 365 } > 366 } > 367 } > 368 } > 369 // バッファシフト > 370 if( lss != buf ) > 371 ki_memmov( buf, lss, end-lss ), end=buf+(end-lss); > 372 else if( end==buf+sizeof(buf) ) > 373 end = buf; > 374 } > 375 > 376 // お終い > 377 ::CloseHandle( pi.hProcess ); > 378 ::CloseHandle( rp ); > 379 return true; > 380 } > 381 > 382 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ > 383 // バージョン情報リソース取得 > 384 > 385 bool CArchiver::GetVersionInfoStr( char* name, char* buf, size_t cbBuf ) > 386 { > 387 static bool old = mycnf().oldver(); > 388 if( old ) > 389 return false; > 390 > 391 DWORD dummy = 0; > 392 DWORD siz = ::GetFileVersionInfoSize( name, &dummy ); > 393 if( siz == 0 ) > 394 return false; > 395 > 396 bool got = false; > 397 BYTE* vbuf = new BYTE[siz]; > 398 if( 0 != ::GetFileVersionInfo( name, 0, siz, vbuf ) ) > 399 { > 400 WORD* tr = NULL; > 401 UINT cbTr = 0; > 402 > 403 // 最初に見つけた言語とコードページで情報取得 > 404 if( ::VerQueryValue( vbuf, > 405 "\\VarFileInfo\\Translation", (void**)&tr, &cbTr ) > 406 && cbTr >= 4 ) > 407 { > 408 char blockname[500]=""; > 409 ::wsprintf( blockname, > 410 "\\StringFileInfo\\%04x%04x\\ProductVersion", > 411 tr[0], tr[1] ); > 412 > 413 char* inf = NULL; > 414 UINT cbInf = 0; > 415 if( ::VerQueryValue( vbuf, blockname, (void**)&inf, &cbI > 416 && cbInf < cbBuf-1 ) > 417 { > 418 for( char* v=buf; *inf && cbInf; ++inf,--cbInf ) > 419 if( *inf != ' ' ) > 420 *v++ = (*inf==',' ? '.' : *inf); > 421 *v = '\0'; > 422 got = true; > 423 } > 424 } > 425 else > 426 { > 427 void* fi = NULL; > 428 UINT cbFi = 0; > 429 VS_FIXEDFILEINFO vffi; > 430 if( ::VerQueryValue( vbuf, "\\", &fi, &cbFi ) > 431 && sizeof(vffi)<=cbFi ) > 432 { > 433 ki_memcpy( &vffi, fi, sizeof(vffi) ); > 434 if( vffi.dwFileVersionLS >= 0x10000 ) > 435 ::wsprintf( buf, "%d.%d.%d", vffi.dwFile > 436 vffi.dwFileVersionMS&0xffff, vff > 437 else > 438 ::wsprintf( buf, "%d.%d", vffi.dwFileVer > 439 vffi.dwFileVersionMS&0xffff ); > 440 got = true; > 441 } > 442 } > 443 } > 444 > 445 delete [] vbuf; > 446 return got; > 447 }

Added Archiver.h version [6f288846948232f7]

> 1 // Archiver.h > 2 //-- CArchiver -- common interface in 'Noah' for arhiving routine -- > 3 > 4 #ifndef AFX_ARCHIVER_H__359A2ED3_2F97_480E_BC94_24834EBA6498__INCLUDED_ > 5 #define AFX_ARCHIVER_H__359A2ED3_2F97_480E_BC94_24834EBA6498__INCLUDED_ > 6 > 7 enum { > 8 aCheck = 1, aMelt = 2, aList = 4, aMeltEach = 8, aCompress = 16, aArchiv > 9 }; > 10 enum { > 11 aUnknown=0, aSingleFile, aSingleDir, aMulti > 12 }; > 13 > 14 struct arcname { > 15 arcname( const kiPath& b,const char *s,const char *l ) > 16 : basedir(b),sname(s),lname(l) {} > 17 const kiPath& basedir; > 18 const char* lname; > 19 const char* sname; > 20 }; > 21 > 22 struct arcfile { > 23 INDIVIDUALINFO inf; > 24 union { > 25 bool selected; > 26 bool isfile; > 27 }; > 28 }; > 29 > 30 #define aflArray kiArray<arcfile> > 31 #define wfdArray kiArray<WIN32_FIND_DATA> > 32 > 33 class CArchiver > 34 { > 35 public: //--< attribute >-- > 36 > 37 int ability(); > 38 int cancompressby( const char* ext, const char* mhd, bool sfx ); > 39 > 40 const char* mlt_ext(); > 41 const kiStr& cmp_ext(); > 42 const StrArray& cmp_mhd_list(); > 43 const int cmp_mhd_default(); > 44 bool ver( kiStr& str ); > 45 static bool GetVersionInfoStr( char* name, char* buf, size_t cbBuf ); > 46 > 47 public: //--< action >-- > 48 > 49 bool check( const kiPath& aname ); > 50 int contents( const kiPath& aname, kiPath& dname ); > 51 int melt( const arcname& aname, const kiPath& ddir, const aflArray* fil > 52 bool list( const arcname& aname, aflArray& files ); > 53 int compress( const kiPath& base, const wfdArray& files, const kiPath& > 54 kiStr arctype_name(const char* an) const { return v_name(an); } > 55 > 56 protected: //--< for child >-- > 57 > 58 CArchiver( const char* mext ); > 59 void set_cmp_ext( const char* ext ); > 60 void add_cmp_mhd( const char* mhd, bool def=false ); > 61 > 62 virtual int v_load(){return 0;} > 63 virtual bool v_ver( kiStr& str ){return false;} > 64 virtual bool v_check( const kiPath& aname ){return false;} > 65 virtual int v_contents( const kiPath& aname, kiPath& dname ){return aUn > 66 virtual int v_melt( const arcname& aname, const kiPath& ddir, const afl > 67 virtual bool v_list( const arcname& aname, aflArray& files ){return fals > 68 virtual int v_compress( const kiPath& base, const wfdArray& files, cons > 69 virtual kiStr v_name(const char*) const { return ""; } > 70 > 71 private: //--< private >-- > 72 > 73 friend class CNoahArchiverManager; > 74 bool extCheck( const char* ext ); > 75 kiStr m_MyExtList, m_MyCmpExt; > 76 StrArray m_Mhd; > 77 int m_MhdDef,m_Able; > 78 bool not_loaded; > 79 > 80 public: //--< dummy >-- > 81 > 82 virtual ~CArchiver(){} > 83 }; > 84 > 85 inline int CArchiver::ability() > 86 { > 87 if( not_loaded ) > 88 m_Able=v_load(), not_loaded=false; > 89 return m_Able; > 90 } > 91 > 92 inline int CArchiver::cancompressby( const char* ext, const char* mhd, bool sfx > 93 { > 94 if( not_loaded ) > 95 m_Able=v_load(), not_loaded=false; > 96 if( (sfx && !(m_Able&aSfx)) || !(m_Able&aCompress) || !m_MyCmpExt.isSame > 97 return -1; // no > 98 for( unsigned int i=0; i!=m_Mhd.len(); i++ ) > 99 if( m_Mhd[i] == mhd ) > 100 return (int)i; > 101 return -2; // only - 'type name' matched > 102 } > 103 > 104 inline bool CArchiver::check( const kiPath& aname ) > 105 { > 106 if( not_loaded ) > 107 m_Able=v_load(), not_loaded=false; > 108 return (m_Able&aCheck)?v_check(aname):false; > 109 } > 110 > 111 inline int CArchiver::contents( const kiPath& aname, kiPath& dname ) > 112 { > 113 if( not_loaded ) > 114 m_Able=v_load(), not_loaded=false; > 115 return (m_Able&aList)?v_contents(aname,dname):false; > 116 } > 117 > 118 inline int CArchiver::melt( const arcname& aname, const kiPath& ddir, const aflA > 119 { > 120 if( not_loaded ) > 121 m_Able=v_load(), not_loaded=false; > 122 return (m_Able&aMelt)?v_melt(aname,ddir,files):0xffff; > 123 } > 124 > 125 inline bool CArchiver::list( const arcname& aname, aflArray& files ) > 126 { > 127 if( not_loaded ) > 128 m_Able=v_load(), not_loaded=false; > 129 return (m_Able&aList)?v_list(aname,files):false; > 130 } > 131 > 132 inline int CArchiver::compress( const kiPath& base, const wfdArray& files, const > 133 { > 134 if( not_loaded ) > 135 m_Able=v_load(), not_loaded=false; > 136 return (m_Able&aCompress)?v_compress(base,files,ddir,method,sfx):0xffff; > 137 } > 138 > 139 inline bool CArchiver::ver( kiStr& str ) > 140 { > 141 if( not_loaded ) > 142 m_Able=v_load(), not_loaded=false; > 143 return v_ver(str); > 144 } > 145 > 146 inline const char* CArchiver::mlt_ext() > 147 { > 148 return m_MyExtList; > 149 } > 150 > 151 inline const kiStr& CArchiver::cmp_ext() > 152 { > 153 if( not_loaded ) > 154 m_Able=v_load(), not_loaded=false; > 155 return m_MyCmpExt; > 156 } > 157 > 158 inline const StrArray& CArchiver::cmp_mhd_list() > 159 { > 160 if( not_loaded ) > 161 m_Able=v_load(), not_loaded=false; > 162 return m_Mhd; > 163 } > 164 > 165 inline const int CArchiver::cmp_mhd_default() > 166 { > 167 if( not_loaded ) > 168 m_Able=v_load(), not_loaded=false; > 169 return m_MhdDef; > 170 } > 171 > 172 inline CArchiver::CArchiver( const char* extlist ) > 173 : m_MyExtList( extlist ), m_Mhd(3), m_MhdDef(0), not_loaded(true > 174 { > 175 m_MyExtList.lower(); > 176 } > 177 > 178 inline void CArchiver::set_cmp_ext( const char* ext ) > 179 { > 180 m_MyCmpExt = ext; > 181 } > 182 > 183 inline void CArchiver::add_cmp_mhd( const char* method, bool Default ) > 184 { > 185 m_Mhd.add(method); > 186 if( Default ) > 187 m_MhdDef = m_Mhd.len() - 1; > 188 } > 189 > 190 inline bool CArchiver::extCheck( const char* ext ) > 191 { > 192 const char *x=m_MyExtList,*y; > 193 int ln = ki_strlen(ext); > 194 while( *x ) > 195 { > 196 for( y=x+1; *y && *y!='.'; y++ ); > 197 if( *y=='\0' ) break; > 198 > 199 if( y-x == ln ) > 200 { > 201 while( x!=y ) > 202 { > 203 if( *x!=ext[ln+(x-y)] ) > 204 break; > 205 x++; > 206 } > 207 if( x==y ) > 208 return true; > 209 } > 210 x=y+1; > 211 } > 212 return false; > 213 } > 214 > 215 // 渡されたパス文字列が、絶対パスや".."を含んでいればtrue > 216 static bool containsDangerPath( const char* path ) > 217 { > 218 // 絶対パス > 219 if( path[0]=='\\' || path[0]=='/' || path[0]!='\0' && path[1]==':' ) > 220 return true; > 221 > 222 // ".." > 223 for( const char* p=path; *p; ) > 224 { > 225 const char* q = p; > 226 while( *q!='\0' && *q!='\\' && *q!='/' ) > 227 q = ::CharNext(q); > 228 > 229 if( p+2 <= q ) > 230 { > 231 const char* r; > 232 for( r=p; r!=q; ++r ) > 233 if( *r != '.' ) > 234 break; > 235 if( r == q ) // all dot > 236 return true; > 237 } > 238 p = (*q ? ::CharNext(q) : q); > 239 } > 240 return false; > 241 } > 242 > 243 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ > 244 // 統合アーカイバDLLレイヤ第二層 ver2。ついでにexeも適当に動く > 245 > 246 class CArcModule > 247 { > 248 public: > 249 > 250 // 実行コマンド名を指定して作成 > 251 // ・ファイル名として探して見つからなかった場合 > 252 // シェルの内部コマンドと仮定して一応保持しておく > 253 // ・拡張子が exe か com なら実行ファイルとして扱う。 > 254 // ・それ以外ならアーカイバDLLとして扱う。 > 255 CArcModule( const char* name, bool us=false ); > 256 virtual ~CArcModule(); > 257 bool exist(); > 258 bool isdll(); > 259 > 260 kiStr name() const { return kiPath::name(m_name); } > 261 > 262 // 実行 > 263 int cmd( const char* cmd, bool mini=false ); > 264 > 265 // 書庫チェック > 266 bool chk( const char* aname ); > 267 int arctype( const char* aname ) const; > 268 > 269 // バージョン情報文字列を返す > 270 void ver( kiStr& str ); > 271 > 272 // 書庫の中身をリストアップ > 273 bool lst_dll( const arcname& aname, aflArray& files, const char* wild="* > 274 int cnt( const kiPath& aname, kiPath& dname, const char* wild="*" ); > 275 bool lst_exe( const char* lstcmd, aflArray& files, > 276 const char* BL, int BSL, const char* EL, int SL, int dx ); > 277 > 278 // DLL強制アンロード( BugTrap for UnZip32.dll ) > 279 void unload() { m_dll->unload(); } > 280 // DLLオーナー窓設定( BugTrap for Unrar.dll ) > 281 void own( HWND wnd ) { m_dll->setOwner( wnd ); } > 282 void fre() { m_dll->clearOwner(); } > 283 > 284 private: > 285 enum { NOTEXIST, DLL, DLLGCA, DLLBGA, EXE, EXEUS, SHLCMD=0 } m_type; > 286 kiArcDLLRaw* m_dll; > 287 char m_name[MAX_PATH]; > 288 const char* m_wild; > 289 }; > 290 > 291 inline bool CArcModule::chk( const char* aname ) > 292 { return m_dll ? FALSE!=m_dll->check( aname, m_type==DLLGCA?24:0 ) : fal > 293 > 294 inline int CArcModule::arctype( const char* aname ) const > 295 { return m_dll ? > 296 m_type==DLLBGA ? m_dll->check(aname,0) : m_dll->getArcType(aname > 297 : 0; } > 298 > 299 inline bool CArcModule::exist() > 300 { return m_type!=NOTEXIST; } > 301 > 302 inline bool CArcModule::isdll() > 303 { return m_type==DLL || m_type==DLLGCA; } > 304 > 305 > 306 > 307 #endif

Added Noah.cpp version [a3b52f0446b0f2d0]

> 1 // Noah.cpp > 2 // -- entrypoint etc for 'Noah' > 3 > 4 #include "stdafx.h" > 5 #include "NoahApp.h" > 6 #include "resource.h" > 7 > 8 #if _MSC_VER >= 1300 > 9 extern "C" { int _afxForceEXCLUDE; } > 10 extern "C" BOOL WINAPI _imp__IsDebuggerPresent() { return FALSE; } > 11 #endif > 12 > 13 // プロセス個数制限ゾーン > 14 class ProcessNumLimitZone > 15 { > 16 HANDLE m_han; > 17 public: > 18 ProcessNumLimitZone(int Max, const char* name) > 19 : m_han( ::CreateSemaphore( NULL, Max, Max, name ) ) > 20 { > 21 if( m_han ) > 22 ::WaitForSingleObject( m_han, INFINITE ); > 23 else > 24 kiSUtil::msgLastError("CreateSemaphore Failed"); > 25 } > 26 ~ProcessNumLimitZone() > 27 { > 28 if( m_han ) > 29 { > 30 ::ReleaseSemaphore( m_han, 1, NULL ); > 31 ::CloseHandle( m_han ); > 32 } > 33 } > 34 }; > 35 > 36 //----------------------------------------------// > 37 //--------- Noah のエントリポイント ------------// > 38 //----------------------------------------------// > 39 > 40 void kilib_create_new_app() > 41 { > 42 //-- kilib にアプリケーションを設定 > 43 new CNoahApp; > 44 } > 45 > 46 void CNoahApp::run( kiCmdParser& cmd ) > 47 { > 48 //-- 初期化 > 49 m_cnfMan.init(); > 50 m_arcMan.init(); > 51 > 52 //-- コマンドラインパラメータ保持 > 53 m_pCmd = &cmd; > 54 > 55 //-- 「ファイル名が渡されてない or Shift押し起動」なら設定画面表示 > 56 if( cmd.param().len()==0 || keyPushed(VK_SHIFT) ) > 57 { > 58 //-- Load-INI ( 全部 ) > 59 m_cnfMan.load( All ); > 60 //-- 設定画面表示 > 61 m_cnfMan.dialog(); > 62 } > 63 else > 64 { > 65 //-- 圧縮解凍などの作業 > 66 do_cmdline( true ); > 67 } > 68 > 69 //-- 終了処理 > 70 m_tmpDir.remove(); > 71 } > 72 > 73 //----------------------------------------------// > 74 //------------- 圧縮/解凍 の 作業 --------------// > 75 //----------------------------------------------// > 76 > 77 bool CNoahApp::is_writable_dir( const kiPath& path ) > 78 { > 79 // 要するに、CDROM/DVDROM を切りたい。 > 80 // FDD, PacketWriteなDisk を切るのはあきらめる。 > 81 > 82 // RAMDISK, REMOTE, FIXED, UNKNOWN なディスクは書き込み可能と見なす > 83 UINT drv = path.getDriveType(); > 84 if( drv==DRIVE_REMOVABLE || drv==DRIVE_CDROM ) > 85 { > 86 // 素Win95では使えない関数なのでDynamicLoad > 87 typedef BOOL (WINAPI*pGDFSE)( LPCTSTR, PULARGE_INTEGER, PULARGE_ > 88 pGDFSE pGetDiskFreeSpaceEx > 89 = (pGDFSE) ::GetProcAddress( ::GetModuleHandle("kernel32 > 90 if( pGetDiskFreeSpaceEx ) > 91 { > 92 // 空き容量が0なら、書き込み不可とみなす > 93 ULARGE_INTEGER fs, dummy; > 94 pGetDiskFreeSpaceEx( path, &dummy, &dummy, &fs ); > 95 if( fs.QuadPart == 0 ) > 96 return false; > 97 } > 98 } > 99 return true; > 100 } > 101 > 102 void CNoahApp::do_cmdline( bool directcall ) > 103 { > 104 do_files( m_pCmd->param(), &m_pCmd->option(), !directcall ); > 105 } > 106 > 107 void CNoahApp::do_files( const cCharArray& files, > 108 const cCharArray* opts, > 109 bool basicaly_ignore ) > 110 { > 111 struct local { > 112 ~local() {kiSUtil::switchCurDirToExeDir(); } // ディレクトリロックしないように > 113 } _; > 114 > 115 //-- Archiver Manager にファイル名リストを記憶する > 116 if( 0 == m_arcMan.set_files( files ) ) > 117 return; > 118 > 119 //-- 作業用変数 > 120 enum { unknown, melt, compress } > 121 whattodo = unknown; > 122 bool ctrl_mlt = keyPushed( VK_CONTROL ); > 123 bool ctrl_cmp = ctrl_mlt; > 124 bool alt = keyPushed( VK_MENU ) || keyPushed( VK_RWIN ) || keyPu > 125 const char *cmptype=NULL, *method=NULL; > 126 kiPath destdir; > 127 kiStr tmp(300); > 128 > 129 //-- ( もしあれば )コマンドラインオプションを解釈 > 130 if( opts ) > 131 for( unsigned int i=0; i!=opts->len(); i++ ) > 132 switch( (*opts)[i][1] ) > 133 { > 134 case 'a': if( !basicaly_ignore ) > 135 case 'A': whattodo = compress; break; > 136 > 137 case 'x': if( !basicaly_ignore ) > 138 case 'X': whattodo = melt; > 139 > 140 case 'd': if( !basicaly_ignore ) > 141 case 'D': destdir = (*opts)[i]+2; break; > 142 > 143 case 'w': if( !basicaly_ignore ) > 144 case 'W': alt = true; > 145 > 146 case 't': if( !basicaly_ignore ) > 147 case 'T': cmptype = (*opts)[i]+2; break; > 148 > 149 case 'm': if( !basicaly_ignore ) > 150 case 'M': method = (*opts)[i]+2; break; > 151 > 152 case 'c': if( !basicaly_ignore ) { > 153 case 'C': if((*opts)[i][2]!='x') ctrl_cmp > 154 if((*opts)[i][2]!='a') c > 155 break;} > 156 } > 157 > 158 //-- Load-INI ( 動作モード設定 ) > 159 m_cnfMan.load( Mode ); > 160 > 161 //-- 圧縮解凍のどちらを行うか決定する。流れは以下の通り。 > 162 // > 163 // ・コマンドラインで、圧縮と指定されてれば無条件で圧縮へ > 164 // > 165 // ・そうでなければ、まずNoahの動作モード取得 > 166 //  m0:圧縮専用 m1:圧縮優先 m2:解凍優先 m3:解凍専用 > 167 //   コマンドラインで解凍と指定されていれば m3。 > 168 //   指定が無ければ、m_cnfMan から読み込み。 > 169 // > 170 // ・m0 か、'm1でしかもファイルが複数' の時は無条件で圧縮へ > 171 // > 172 // ・そうでなければ、解凍ルーチンを割り当ててみる。 > 173 //  この際、m3 以外のときは一個でも割り当て失敗したらエラー>圧縮へ > 174 //  m3 でも、一個も割り当てられなければエラー。>処理終了 > 175 > 176 if( whattodo != compress ) > 177 { > 178 int mode = 3; > 179 if( whattodo != melt ) > 180 mode = m_cnfMan.mode(); > 181 > 182 if( mode==0 || ( mode==1 && m_arcMan.file_num()>=2 ) ) > 183 whattodo = compress; > 184 else > 185 { > 186 //-- 解凍ルーチン割り当ててみる > 187 bool suc = m_arcMan.map_melters( mode ); > 188 if( suc ) > 189 whattodo = melt; > 190 else > 191 { > 192 if( mode != 3 ) > 193 whattodo = compress; > 194 else > 195 { > 196 //-- 解凍専用モードだけど解凍不可!! > 197 msgBox( tmp.loadRsrc(IDS_M_ERROR) ); > 198 return; > 199 } > 200 } > 201 } > 202 } > 203 > 204 if( whattodo == melt ) > 205 { > 206 //-- 解凍設定は既にm_cnfMan.init()でロードされている… > 207 > 208 if( destdir.len()==0 ) > 209 { > 210 //-- 解凍先ディレクトリ取得 > 211 if( m_cnfMan.mdirsm() ) > 212 if( is_writable_dir(m_arcMan.get_basepath()) ) > 213 destdir = m_arcMan.get_basepath(); > 214 if( destdir.len()==0 ) > 215 destdir = m_cnfMan.mdir(); > 216 } > 217 > 218 //-- 解凍 > 219 if( ctrl_mlt ) m_arcMan.do_listing( destdir ); > 220 else { > 221 ProcessNumLimitZone zone( mycnf().multiboot_limit(), "Li > 222 m_arcMan.do_melting( destdir ); > 223 } > 224 } > 225 else > 226 { > 227 //-- Load-INI( 圧縮設定 ) > 228 m_cnfMan.load( Compress ); > 229 > 230 if( destdir.len()==0 ) > 231 { > 232 //-- 圧縮先ディレクトリ取得 > 233 if( m_cnfMan.cdirsm() ) > 234 if( is_writable_dir(m_arcMan.get_basepath()) ) > 235 destdir = m_arcMan.get_basepath(); > 236 if( destdir.len()==0 ) > 237 destdir = m_cnfMan.cdir(); > 238 } > 239 if( !cmptype ) cmptype = m_cnfMan.cext(); > 240 else if( !method ) method = ""; > 241 if( !method ) method = m_cnfMan.cmhd(); > 242 > 243 //-- 圧縮用ルーチンを割り当て > 244 if( !m_arcMan.map_compressor( cmptype, method, ctrl_cmp ) ) > 245 { > 246 //-- 圧縮不能な形式!! > 247 msgBox( tmp.loadRsrc(IDS_C_ERROR) ); > 248 return; > 249 } > 250 > 251 //-- 圧縮 > 252 ProcessNumLimitZone zone( mycnf().multiboot_limit(), "LimitterFo > 253 m_arcMan.do_compressing( destdir, alt ); > 254 } > 255 } > 256 > 257 //----------------------------------------------// > 258 //----------------- その他雑用 -----------------// > 259 //----------------------------------------------// > 260 > 261 // from= 0:normal 1:melt 2:compress > 262 void CNoahApp::open_folder( const kiPath& path, int from ) > 263 { > 264 if( from==1 || from==2 ) //-- Shellに更新通知 > 265 ::SHChangeNotify( SHCNE_UPDATEDIR, SHCNF_PATH, (const void*)(con > 266 > 267 //-- デスクトップだったら開かない > 268 kiPath dir(path), tmp(kiPath::Dsk,false); > 269 dir.beBackSlash(false), dir.beShortPath(), tmp.beShortPath(); > 270 > 271 if( !tmp.isSame( dir ) ) > 272 { > 273 //-- Load-INI( フォルダ開き設定 ) > 274 m_cnfMan.load( OpenDir ); > 275 if( (from==1 && !m_cnfMan.modir()) > 276 || (from==2 && !m_cnfMan.codir()) ) > 277 return; > 278 > 279 char cmdline[1000]; > 280 wsprintf( cmdline, m_cnfMan.openby(), (const char*)dir ); > 281 ::WinExec( cmdline, SW_SHOWDEFAULT ); > 282 } > 283 } > 284 > 285 // 全システム中で一意なテンポラリフォルダを作って返す > 286 void CNoahApp::get_tempdir( kiPath& tmp ) > 287 { > 288 char buf[MAX_PATH]; > 289 > 290 if( m_tmpDir.len()==0 ) > 291 { > 292 ::GetTempFileName( kiPath( kiPath::Tmp ), "noa", 0, buf ); > 293 ::DeleteFile( buf ); > 294 m_tmpDir = buf; > 295 m_tmpDir.beBackSlash( true ); > 296 m_tmpDir.mkdir(); > 297 m_tmpID = ::GetCurrentProcessId(); > 298 } > 299 > 300 ::GetTempFileName( m_tmpDir, "noa", m_tmpID++, buf ); > 301 ::DeleteFile( buf ); > 302 tmp = buf; > 303 tmp.beBackSlash( true ); > 304 tmp.mkdir(); > 305 }

Added Noah.dsp version [f3b4df134224f728]

> 1 # Microsoft Developer Studio Project File - Name="Noah" - Package Owner=<4> > 2 # Microsoft Developer Studio Generated Build File, Format Version 6.00 > 3 # ** 編集しないでください ** > 4 > 5 # TARGTYPE "Win32 (x86) Application" 0x0101 > 6 > 7 CFG=Noah - Win32 Debug > 8 !MESSAGE これは有効なメイクファイルではありません。 このプロジェクトをビルドするためには NMAKE を使用してください。 > 9 !MESSAGE [メイクファイルのエクスポート] コマンドを使用して実行してください > 10 !MESSAGE > 11 !MESSAGE NMAKE /f "Noah.mak". > 12 !MESSAGE > 13 !MESSAGE NMAKE の実行時に構成を指定できます > 14 !MESSAGE コマンド ライン上でマクロの設定を定義します。例: > 15 !MESSAGE > 16 !MESSAGE NMAKE /f "Noah.mak" CFG="Noah - Win32 Debug" > 17 !MESSAGE > 18 !MESSAGE 選択可能なビルド モード: > 19 !MESSAGE > 20 !MESSAGE "Noah - Win32 Release" ("Win32 (x86) Application" 用) > 21 !MESSAGE "Noah - Win32 Debug" ("Win32 (x86) Application" 用) > 22 !MESSAGE > 23 > 24 # Begin Project > 25 # PROP AllowPerConfigDependencies 0 > 26 # PROP Scc_ProjName "Noah" > 27 # PROP Scc_LocalPath "." > 28 CPP=cl.exe > 29 MTL=midl.exe > 30 RSC=rc.exe > 31 > 32 !IF "$(CFG)" == "Noah - Win32 Release" > 33 > 34 # PROP BASE Use_MFC 0 > 35 # PROP BASE Use_Debug_Libraries 0 > 36 # PROP BASE Output_Dir "Release" > 37 # PROP BASE Intermediate_Dir "Release" > 38 # PROP BASE Target_Dir "" > 39 # PROP Use_MFC 0 > 40 # PROP Use_Debug_Libraries 0 > 41 # PROP Output_Dir "tmp/rel" > 42 # PROP Intermediate_Dir "tmp/rel" > 43 # PROP Ignore_Export_Lib 0 > 44 # PROP Target_Dir "" > 45 # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBC > 46 # ADD CPP /nologo /W3 /O1 /Ob2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" / > 47 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 > 48 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 > 49 # ADD BASE RSC /l 0x411 /d "NDEBUG" > 50 # ADD RSC /l 0x411 /d "NDEBUG" > 51 BSC32=bscmake.exe > 52 # ADD BASE BSC32 /nologo > 53 # ADD BSC32 /nologo > 54 LINK32=link.exe > 55 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib ad > 56 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi3 > 57 # SUBTRACT LINK32 /nodefaultlib > 58 > 59 !ELSEIF "$(CFG)" == "Noah - Win32 Debug" > 60 > 61 # PROP BASE Use_MFC 0 > 62 # PROP BASE Use_Debug_Libraries 1 > 63 # PROP BASE Output_Dir "Debug" > 64 # PROP BASE Intermediate_Dir "Debug" > 65 # PROP BASE Target_Dir "" > 66 # PROP Use_MFC 0 > 67 # PROP Use_Debug_Libraries 1 > 68 # PROP Output_Dir "tmp/dbg" > 69 # PROP Intermediate_Dir "tmp/dbg" > 70 # PROP Ignore_Export_Lib 0 > 71 # PROP Target_Dir "" > 72 # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" > 73 # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_ > 74 # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 > 75 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 > 76 # ADD BASE RSC /l 0x411 /d "_DEBUG" > 77 # ADD RSC /l 0x411 /d "_DEBUG" > 78 BSC32=bscmake.exe > 79 # ADD BASE BSC32 /nologo > 80 # ADD BSC32 /nologo > 81 LINK32=link.exe > 82 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib ad > 83 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi3 > 84 # SUBTRACT LINK32 /profile /pdb:none /incremental:no > 85 > 86 !ENDIF > 87 > 88 # Begin Target > 89 > 90 # Name "Noah - Win32 Release" > 91 # Name "Noah - Win32 Debug" > 92 # Begin Group "Source Files" > 93 > 94 # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" > 95 # Begin Source File > 96 > 97 SOURCE=.\ArcACE.cpp > 98 # End Source File > 99 # Begin Source File > 100 > 101 SOURCE=.\ArcB2e.cpp > 102 # End Source File > 103 # Begin Source File > 104 > 105 SOURCE=.\ArcCpt.cpp > 106 # End Source File > 107 # Begin Source File > 108 > 109 SOURCE=.\ArcDLL.cpp > 110 # End Source File > 111 # Begin Source File > 112 > 113 SOURCE=.\Archiver.cpp > 114 # End Source File > 115 # Begin Source File > 116 > 117 SOURCE=.\ArcMsc.cpp > 118 # End Source File > 119 # Begin Source File > 120 > 121 SOURCE=.\Noah.cpp > 122 # End Source File > 123 # Begin Source File > 124 > 125 SOURCE=.\NoahAM.cpp > 126 # End Source File > 127 # Begin Source File > 128 > 129 SOURCE=.\NoahCM.cpp > 130 # End Source File > 131 # Begin Source File > 132 > 133 SOURCE=.\StdAfx.cpp > 134 # ADD CPP /Yc"stdafx.h" > 135 # End Source File > 136 # Begin Source File > 137 > 138 SOURCE=.\SubDlg.cpp > 139 # End Source File > 140 # End Group > 141 # Begin Group "Header Files" > 142 > 143 # PROP Default_Filter "h;hpp;hxx;hm;inl" > 144 # Begin Source File > 145 > 146 SOURCE=.\ArcACE.h > 147 # End Source File > 148 # Begin Source File > 149 > 150 SOURCE=.\ArcB2e.h > 151 # End Source File > 152 # Begin Source File > 153 > 154 SOURCE=.\ArcCpt.h > 155 # End Source File > 156 # Begin Source File > 157 > 158 SOURCE=.\ArcDLL.h > 159 # End Source File > 160 # Begin Source File > 161 > 162 SOURCE=.\Archiver.h > 163 # End Source File > 164 # Begin Source File > 165 > 166 SOURCE=.\ArcMsc.h > 167 # End Source File > 168 # Begin Source File > 169 > 170 SOURCE=.\NoahAM.h > 171 # End Source File > 172 # Begin Source File > 173 > 174 SOURCE=.\NoahApp.h > 175 # End Source File > 176 # Begin Source File > 177 > 178 SOURCE=.\NoahCM.h > 179 # End Source File > 180 # Begin Source File > 181 > 182 SOURCE=.\StdAfx.h > 183 # End Source File > 184 # Begin Source File > 185 > 186 SOURCE=.\SubDlg.h > 187 # End Source File > 188 # Begin Source File > 189 > 190 SOURCE=.\unacedef.h > 191 # End Source File > 192 # End Group > 193 # Begin Group "Resource Files" > 194 > 195 # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" > 196 # Begin Source File > 197 > 198 SOURCE=.\icons\arc_b2e.ico > 199 # End Source File > 200 # Begin Source File > 201 > 202 SOURCE=.\b2e.ico > 203 # End Source File > 204 # Begin Source File > 205 > 206 SOURCE=.\default1.bin > 207 # End Source File > 208 # Begin Source File > 209 > 210 SOURCE=.\noah.ico > 211 # End Source File > 212 # Begin Source File > 213 > 214 SOURCE=.\Noah.rc > 215 # End Source File > 216 # Begin Source File > 217 > 218 SOURCE=.\resource.h > 219 # End Source File > 220 # End Group > 221 # Begin Group "K.I.LIB" > 222 > 223 # PROP Default_Filter "" > 224 # Begin Group "Source" > 225 > 226 # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" > 227 # Begin Source File > 228 > 229 SOURCE=.\kilib\kl_app.cpp > 230 # End Source File > 231 # Begin Source File > 232 > 233 SOURCE=.\kilib\kl_carc.cpp > 234 # End Source File > 235 # Begin Source File > 236 > 237 SOURCE=.\kilib\kl_cmd.cpp > 238 # End Source File > 239 # Begin Source File > 240 > 241 SOURCE=.\kilib\kl_dnd.cpp > 242 # End Source File > 243 # Begin Source File > 244 > 245 SOURCE=.\kilib\kl_file.cpp > 246 # End Source File > 247 # Begin Source File > 248 > 249 SOURCE=.\kilib\kl_find.cpp > 250 # End Source File > 251 # Begin Source File > 252 > 253 SOURCE=.\kilib\kl_reg.cpp > 254 # End Source File > 255 # Begin Source File > 256 > 257 SOURCE=.\kilib\kl_rythp.cpp > 258 # End Source File > 259 # Begin Source File > 260 > 261 SOURCE=.\kilib\kl_str.cpp > 262 # End Source File > 263 # Begin Source File > 264 > 265 SOURCE=.\kilib\kl_wcmn.cpp > 266 # End Source File > 267 # Begin Source File > 268 > 269 SOURCE=.\kilib\kl_wnd.cpp > 270 # End Source File > 271 # End Group > 272 # Begin Group "Header" > 273 > 274 # PROP Default_Filter "h;hpp;hxx;hm;inl" > 275 # Begin Source File > 276 > 277 SOURCE=.\kilib\kl_app.h > 278 # End Source File > 279 # Begin Source File > 280 > 281 SOURCE=.\kilib\kl_carc.h > 282 # End Source File > 283 # Begin Source File > 284 > 285 SOURCE=.\kilib\kl_cmd.h > 286 # End Source File > 287 # Begin Source File > 288 > 289 SOURCE=.\kilib\kl_dnd.h > 290 # End Source File > 291 # Begin Source File > 292 > 293 SOURCE=.\kilib\kl_file.h > 294 # End Source File > 295 # Begin Source File > 296 > 297 SOURCE=.\kilib\kl_find.h > 298 # End Source File > 299 # Begin Source File > 300 > 301 SOURCE=.\kilib\kl_misc.h > 302 # End Source File > 303 # Begin Source File > 304 > 305 SOURCE=.\kilib\kl_reg.h > 306 # End Source File > 307 # Begin Source File > 308 > 309 SOURCE=.\kilib\kl_rythp.h > 310 # End Source File > 311 # Begin Source File > 312 > 313 SOURCE=.\kilib\kl_str.h > 314 # End Source File > 315 # Begin Source File > 316 > 317 SOURCE=.\kilib\kl_wcmn.h > 318 # End Source File > 319 # Begin Source File > 320 > 321 SOURCE=.\kilib\kl_wnd.h > 322 # End Source File > 323 # End Group > 324 # Begin Source File > 325 > 326 SOURCE=.\kilib\kilib.h > 327 # End Source File > 328 # Begin Source File > 329 > 330 SOURCE=.\kilib\kilibext.h > 331 # End Source File > 332 # End Group > 333 # Begin Source File > 334 > 335 SOURCE=.\manifest.xml > 336 # End Source File > 337 # Begin Source File > 338 > 339 SOURCE=.\readme.txt > 340 # End Source File > 341 # Begin Source File > 342 > 343 SOURCE=.\Release\todo.txt > 344 # End Source File > 345 # End Target > 346 # End Project

Added Noah.dsw version [e80087f7460120bd]

> 1 Microsoft Developer Studio Workspace File, Format Version 6.00 > 2 # 警告: このワークスペース ファイル を編集または削除しないでください! > 3 > 4 ############################################################################### > 5 > 6 Project: "Noah"=.\Noah.dsp - Package Owner=<4> > 7 > 8 Package=<5> > 9 {{{ > 10 begin source code control > 11 Noah > 12 . > 13 end source code control > 14 }}} > 15 > 16 Package=<4> > 17 {{{ > 18 }}} > 19 > 20 ############################################################################### > 21 > 22 Project: "NoahXt"=.\NoahXt\NoahXt.dsp - Package Owner=<4> > 23 > 24 Package=<5> > 25 {{{ > 26 begin source code control > 27 NoahXt > 28 .\noahxt > 29 end source code control > 30 }}} > 31 > 32 Package=<4> > 33 {{{ > 34 }}} > 35 > 36 ############################################################################### > 37 > 38 Project: "kinst"=.\uninst\kinst.dsp - Package Owner=<4> > 39 > 40 Package=<5> > 41 {{{ > 42 begin source code control > 43 kinst > 44 . > 45 end source code control > 46 }}} > 47 > 48 Package=<4> > 49 {{{ > 50 }}} > 51 > 52 ############################################################################### > 53 > 54 Global: > 55 > 56 Package=<5> > 57 {{{ > 58 }}} > 59 > 60 Package=<3> > 61 {{{ > 62 }}} > 63 > 64 ############################################################################### > 65

Added Noah.h version [aa91ec71f323226e]

> 1 #pragma once > 2 > 3 #include "resource.h"

Added Noah.ico version [93e9b3fc384d8993]

cannot compute difference between binary files

Added Noah.rc version [d77d284bfb6d2ed6]

> 1 //Microsoft Developer Studio generated resource script. > 2 // > 3 #include "resource.h" > 4 > 5 #define APSTUDIO_READONLY_SYMBOLS > 6 ///////////////////////////////////////////////////////////////////////////// > 7 // > 8 // Generated from the TEXTINCLUDE 2 resource. > 9 // > 10 #include "afxres.h" > 11 > 12 ///////////////////////////////////////////////////////////////////////////// > 13 #undef APSTUDIO_READONLY_SYMBOLS > 14 > 15 ///////////////////////////////////////////////////////////////////////////// > 16 // 日本語 resources > 17 > 18 #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_JPN) > 19 #ifdef _WIN32 > 20 LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT > 21 #pragma code_page(932) > 22 #endif //_WIN32 > 23 > 24 #ifndef _MAC > 25 ///////////////////////////////////////////////////////////////////////////// > 26 // > 27 // Version > 28 // > 29 > 30 VS_VERSION_INFO VERSIONINFO > 31 FILEVERSION 3,1,9,9 > 32 PRODUCTVERSION 3,1,9,9 > 33 FILEFLAGSMASK 0x3fL > 34 #ifdef _DEBUG > 35 FILEFLAGS 0x1L > 36 #else > 37 FILEFLAGS 0x0L > 38 #endif > 39 FILEOS 0x4L > 40 FILETYPE 0x1L > 41 FILESUBTYPE 0x0L > 42 BEGIN > 43 BLOCK "StringFileInfo" > 44 BEGIN > 45 BLOCK "041104b0" > 46 BEGIN > 47 VALUE "Comments", "INTO THE LEGEND\0" > 48 VALUE "CompanyName", "kMonos.NET\0" > 49 VALUE "FileDescription", "Noah( DnD Melter/Freezer )\0" > 50 VALUE "FileVersion", "3.199\0" > 51 VALUE "InternalName", "sakasai\0" > 52 VALUE "LegalCopyright", "Presented by k.inaba (1998-2010)\0" > 53 VALUE "LegalTrademarks", "\0" > 54 VALUE "OriginalFilename", "Noah.exe\0" > 55 VALUE "PrivateBuild", "\0" > 56 VALUE "ProductName", "Noah\0" > 57 VALUE "ProductVersion", "3.199\0" > 58 VALUE "SpecialBuild", "\0" > 59 END > 60 END > 61 BLOCK "VarFileInfo" > 62 BEGIN > 63 VALUE "Translation", 0x411, 1200 > 64 END > 65 END > 66 > 67 #endif // !_MAC > 68 > 69 > 70 #ifdef APSTUDIO_INVOKED > 71 ///////////////////////////////////////////////////////////////////////////// > 72 // > 73 // TEXTINCLUDE > 74 // > 75 > 76 1 TEXTINCLUDE DISCARDABLE > 77 BEGIN > 78 "resource.h\0" > 79 END > 80 > 81 2 TEXTINCLUDE DISCARDABLE > 82 BEGIN > 83 "#include ""afxres.h""\r\n" > 84 "\0" > 85 END > 86 > 87 3 TEXTINCLUDE DISCARDABLE > 88 BEGIN > 89 "\r\n" > 90 "\0" > 91 END > 92 > 93 #endif // APSTUDIO_INVOKED > 94 > 95 > 96 ///////////////////////////////////////////////////////////////////////////// > 97 // > 98 // Dialog > 99 // > 100 > 101 IDD_CMPCFG DIALOG DISCARDABLE 0, 0, 219, 121 > 102 STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU > 103 CAPTION "圧縮" > 104 FONT 9, "MS Pゴシック" > 105 BEGIN > 106 GROUPBOX "圧縮先フォルダ",IDC_STATIC,7,7,205,43 > 107 CONTROL "元のファイルと同じ場所",IDC_DDIR1,"Button", > 108 BS_AUTORADIOBUTTON | WS_GROUP,11,20,84,10 > 109 CONTROL "指定した場所",IDC_DDIR2,"Button",BS_AUTORADIOBUTTON | > 110 WS_TABSTOP,11,33,50,10 > 111 EDITTEXT IDC_DDIR,63,32,123,12,ES_AUTOHSCROLL | WS_GROUP > 112 PUSHBUTTON "指定",IDC_REF,188,31,19,14,WS_GROUP > 113 CONTROL "圧縮後開く",IDC_ODIR,"Button",BS_AUTOCHECKBOX | > 114 WS_GROUP | WS_TABSTOP,163,18,43,9 > 115 GROUPBOX "圧縮形式",IDC_STATIC,7,57,117,57 > 116 COMBOBOX IDC_CMPEXT,14,81,34,163,CBS_DROPDOWNLIST | CBS_SORT | > 117 CBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_GROUP | > 118 WS_TABSTOP > 119 COMBOBOX IDC_CMPMHD,52,81,65,79,CBS_DROPDOWNLIST | > 120 CBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP > 121 GROUPBOX "Noahの動作モード",IDC_STATIC,133,57,79,57 > 122 CONTROL "圧縮専用",IDC_MODE1,"Button",BS_AUTORADIOBUTTON | > 123 WS_GROUP,147,69,39,8 > 124 CONTROL "圧縮優先",IDC_MODE2,"Button",BS_AUTORADIOBUTTON,147,79, > 125 38,8 > 126 CONTROL "解凍優先",IDC_MODE3,"Button",BS_AUTORADIOBUTTON | > 127 WS_TABSTOP,147,89,39,8 > 128 CONTROL "解凍専用",IDC_MODE4,"Button",BS_AUTORADIOBUTTON,147,98, > 129 39,12 > 130 END > 131 > 132 IDD_ARCVIEW DIALOG DISCARDABLE 0, 0, 311, 157 > 133 STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU | > 134 WS_THICKFRAME > 135 FONT 9, "MS Pゴシック" > 136 BEGIN > 137 CONTROL "List1",IDC_FILELIST,"SysListView32",LVS_REPORT | > 138 LVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP,0,22,312,120 > 139 PUSHBUTTON "全解凍",IDOK,5,3,26,14 > 140 PUSHBUTTON "解凍",IDC_MELTEACH,34,3,19,14 > 141 PUSHBUTTON "反転",IDC_SELECTINV,78,3,19,14 > 142 EDITTEXT IDC_DDIR,102,3,145,14,ES_AUTOHSCROLL > 143 PUSHBUTTON "...",IDC_REF,249,3,8,14 > 144 DEFPUSHBUTTON "表示",IDC_SHOW,56,3,19,14 > 145 LTEXT "",IDC_STATUSBAR,0,146,309,11 > 146 END > 147 > 148 IDD_MLTCFG DIALOG DISCARDABLE 0, 0, 219, 121 > 149 STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU > 150 CAPTION "解凍" > 151 FONT 9, "MS Pゴシック" > 152 BEGIN > 153 GROUPBOX "解凍先フォルダ",IDC_STATIC,7,7,205,43 > 154 CONTROL "書庫と同じ場所",IDC_DDIR1,"Button",BS_AUTORADIOBUTTON | > 155 WS_GROUP,11,20,65,10 > 156 CONTROL "指定した場所",IDC_DDIR2,"Button",BS_AUTORADIOBUTTON | > 157 WS_TABSTOP,11,33,50,10 > 158 EDITTEXT IDC_DDIR,63,32,123,12,ES_AUTOHSCROLL | WS_GROUP > 159 PUSHBUTTON "指定",IDC_REF,188,31,19,14,WS_GROUP > 160 CONTROL "解凍後開く",IDC_ODIR,"Button",BS_AUTOCHECKBOX | > 161 WS_GROUP | WS_TABSTOP,163,18,42,8 > 162 GROUPBOX "",IDC_STATIC,7,52,205,62 > 163 CONTROL "フォルダ自動生成",IDC_MKDIR,"Button",BS_AUTOCHECKBOX | > 164 WS_GROUP | WS_TABSTOP,16,62,63,10 > 165 CONTROL "ファイル一つなら作らない",IDC_MKDIR1,"Button", > 166 BS_AUTOCHECKBOX | WS_TABSTOP,32,73,86,10 > 167 CONTROL "フォルダ一つなら作らない",IDC_MKDIR2,"Button", > 168 BS_AUTOCHECKBOX | WS_TABSTOP,32,84,86,10 > 169 CONTROL "末尾の数字は省く",IDC_MKDIR3,"Button",BS_AUTOCHECKBOX | > 170 WS_TABSTOP,32,95,64,10 > 171 END > 172 > 173 IDD_WINCFG DIALOG DISCARDABLE 0, 0, 219, 121 > 174 STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU > 175 CAPTION "Windows拡張" > 176 FONT 9, "MS Pゴシック" > 177 BEGIN > 178 GROUPBOX "関連付け",IDC_STATIC,7,7,205,39 > 179 CONTROL "&LZH",IDC_LZH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13, > 180 18,23,9 > 181 CONTROL "&ZIP",IDC_ZIP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13, > 182 30,23,10 > 183 CONTROL "&CAB",IDC_CAB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,40, > 184 18,26,10 > 185 CONTROL "&RAR",IDC_RAR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,40, > 186 30,25,9 > 187 CONTROL "&TAR",IDC_TAR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,68, > 188 18,26,10 > 189 CONTROL "&YZ1",IDC_YZ1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,68, > 190 30,23,9 > 191 CONTROL "&GCA",IDC_GCA,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,97, > 192 18,25,10 > 193 CONTROL "AR&J",IDC_ARJ,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,97, > 194 30,24,10 > 195 CONTROL "&BGA",IDC_BGA,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,126, > 196 18,25,9 > 197 CONTROL "AC&E",IDC_ACE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,126, > 198 30,25,9 > 199 CONTROL "C&PT",IDC_CPT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,155, > 200 18,26,9 > 201 CONTROL "JA&K",IDC_JAK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,155, > 202 30,26,9 > 203 CONTROL "&7Z",IDC_7Z,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,182, > 204 18,23,10 > 205 PUSHBUTTON "他",IDC_ASS,190,30,17,14 > 206 GROUPBOX "右ドラッグ&ドロップ",IDC_STATIC,7,51,132,29 > 207 CONTROL "ここに圧縮(&H)",IDC_CMP,"Button",BS_AUTOCHECKBOX | > 208 WS_TABSTOP,15,63,57,10 > 209 CONTROL "ここに解凍(&X)",IDC_MLT,"Button",BS_AUTOCHECKBOX | > 210 WS_TABSTOP,75,63,56,10 > 211 GROUPBOX "ショートカット",IDC_STATIC,7,86,132,28 > 212 CONTROL "送る(&S)",IDC_SND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, > 213 15,98,37,10 > 214 CONTROL "デスクトップ(&D)",IDC_DSK,"Button",BS_AUTOCHECKBOX | > 215 WS_TABSTOP,75,97,60,10 > 216 LTEXT "※ ユーザにadmin権限がないため、関連付けに失敗する可能性がります。", > 217 IDC_NOADMIN,146,57,62,49 > 218 END > 219 > 220 IDD_INFCFG DIALOG DISCARDABLE 0, 0, 219, 97 > 221 STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU > 222 CAPTION "About" > 223 FONT 9, "Courier New" > 224 BEGIN > 225 ICON IDI_MAIN,IDC_STATIC,28,21,20,20,SS_REALSIZEIMAGE > 226 CTEXT "Noah 3.199\n\npresented by k.inaba",IDC_STATIC,13,45,53, > 227 36,WS_TABSTOP > 228 EDITTEXT IDC_VERSION,78,7,134,83,ES_MULTILINE | ES_AUTOHSCROLL | > 229 ES_READONLY | WS_VSCROLL > 230 END > 231 > 232 IDD_PROGRESS DIALOG DISCARDABLE 0, 0, 214, 43 > 233 STYLE DS_ABSALIGN | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | > 234 WS_SYSMENU > 235 CAPTION "Extracting..." > 236 FONT 9, "MS Pゴシック" > 237 BEGIN > 238 DEFPUSHBUTTON "STOP",IDCANCEL,157,7,50,14 > 239 CONTROL "Progress1",IDC_BAR,"msctls_progress32",PBS_SMOOTH | > 240 WS_BORDER,7,25,200,12 > 241 LTEXT "",IDC_FNAME,7,7,142,11 > 242 END > 243 > 244 IDD_PASSWORD DIALOG DISCARDABLE 0, 0, 206, 64 > 245 STYLE DS_ABSALIGN | DS_MODALFRAME | DS_SETFOREGROUND | DS_CENTER | WS_POPUP | > 246 WS_CAPTION | WS_SYSMENU > 247 CAPTION "Noah" > 248 FONT 9, "MS Pゴシック" > 249 BEGIN > 250 LTEXT "Input your password:",IDC_MESSAGE,4,5,196,20 > 251 EDITTEXT IDC_EDIT,7,29,194,12,ES_AUTOHSCROLL > 252 CONTROL "Mask",IDC_MASK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15, > 253 47,31,10 > 254 PUSHBUTTON "OK",IDOK,96,46,50,12 > 255 PUSHBUTTON "Cancel",IDCANCEL,149,46,50,12 > 256 END > 257 > 258 IDD_ANYASS DIALOG DISCARDABLE 0, 0, 207, 97 > 259 STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU > 260 CAPTION "その他の形式の関連づけ" > 261 FONT 9, "MS Pゴシック" > 262 BEGIN > 263 LISTBOX IDC_NASSOC,7,7,77,62,LBS_SORT | LBS_NOINTEGRALHEIGHT | > 264 LBS_EXTENDEDSEL | WS_VSCROLL | WS_TABSTOP > 265 PUSHBUTTON "追加 >>",IDC_ADD,90,18,26,14 > 266 LISTBOX IDC_ASSOC,123,7,77,62,LBS_SORT | LBS_NOINTEGRALHEIGHT | > 267 LBS_EXTENDEDSEL | WS_VSCROLL | WS_TABSTOP > 268 PUSHBUTTON "<< 削除",IDC_DEL,90,38,27,14 > 269 DEFPUSHBUTTON "実行",IDOK,95,76,50,14 > 270 PUSHBUTTON "中断",IDCANCEL,150,76,50,14 > 271 END > 272 > 273 IDD_PATHCHECK DIALOG DISCARDABLE 0, 0, 298, 69 > 274 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU > 275 CAPTION "Noah 警告" > 276 FONT 9, "MS Pゴシック" > 277 BEGIN > 278 PUSHBUTTON "はい(&Y)",IDYES,111,48,50,14 > 279 PUSHBUTTON "中止(&C)",ID_ALLNO,241,48,50,14 > 280 LTEXT "絶対パス、もしくは "".."" による相対パスで格納されたファイ汲ナす。展開を続けますか?", > 281 IDC_STATIC,7,7,264,10 > 282 LTEXT "",IDC_PATHNAME,16,17,275,23 > 283 PUSHBUTTON "全てはい(&A)",ID_ALLYES,166,48,50,14 > 284 END > 285 > 286 > 287 ///////////////////////////////////////////////////////////////////////////// > 288 // > 289 // DESIGNINFO > 290 // > 291 > 292 #ifdef APSTUDIO_INVOKED > 293 GUIDELINES DESIGNINFO DISCARDABLE > 294 BEGIN > 295 IDD_CMPCFG, DIALOG > 296 BEGIN > 297 LEFTMARGIN, 7 > 298 RIGHTMARGIN, 212 > 299 TOPMARGIN, 7 > 300 BOTTOMMARGIN, 114 > 301 END > 302 > 303 IDD_ARCVIEW, DIALOG > 304 BEGIN > 305 RIGHTMARGIN, 304 > 306 TOPMARGIN, 3 > 307 BOTTOMMARGIN, 148 > 308 END > 309 > 310 IDD_MLTCFG, DIALOG > 311 BEGIN > 312 LEFTMARGIN, 7 > 313 RIGHTMARGIN, 212 > 314 TOPMARGIN, 7 > 315 BOTTOMMARGIN, 114 > 316 END > 317 > 318 IDD_WINCFG, DIALOG > 319 BEGIN > 320 LEFTMARGIN, 7 > 321 RIGHTMARGIN, 212 > 322 TOPMARGIN, 7 > 323 BOTTOMMARGIN, 114 > 324 END > 325 > 326 IDD_INFCFG, DIALOG > 327 BEGIN > 328 LEFTMARGIN, 7 > 329 RIGHTMARGIN, 212 > 330 TOPMARGIN, 7 > 331 BOTTOMMARGIN, 90 > 332 END > 333 > 334 IDD_PROGRESS, DIALOG > 335 BEGIN > 336 LEFTMARGIN, 7 > 337 RIGHTMARGIN, 207 > 338 TOPMARGIN, 7 > 339 BOTTOMMARGIN, 36 > 340 END > 341 > 342 IDD_PASSWORD, DIALOG > 343 BEGIN > 344 LEFTMARGIN, 7 > 345 RIGHTMARGIN, 199 > 346 TOPMARGIN, 7 > 347 BOTTOMMARGIN, 57 > 348 END > 349 > 350 IDD_ANYASS, DIALOG > 351 BEGIN > 352 LEFTMARGIN, 7 > 353 RIGHTMARGIN, 200 > 354 TOPMARGIN, 7 > 355 BOTTOMMARGIN, 90 > 356 END > 357 > 358 IDD_PATHCHECK, DIALOG > 359 BEGIN > 360 LEFTMARGIN, 7 > 361 RIGHTMARGIN, 291 > 362 TOPMARGIN, 7 > 363 BOTTOMMARGIN, 62 > 364 END > 365 END > 366 #endif // APSTUDIO_INVOKED > 367 > 368 > 369 ///////////////////////////////////////////////////////////////////////////// > 370 // > 371 // Icon > 372 // > 373 > 374 // Icon with lowest ID value placed first to ensure application icon > 375 // remains consistent on all systems. > 376 IDI_MAIN ICON DISCARDABLE "noah.ico" > 377 IDI_B2E ICON DISCARDABLE "b2e.ico" > 378 > 379 ///////////////////////////////////////////////////////////////////////////// > 380 // > 381 // Accelerator > 382 // > 383 > 384 IDR_ACCEL ACCELERATORS DISCARDABLE > 385 BEGIN > 386 "F", IDA_MYDIR, VIRTKEY, CONTROL, NOINVERT > 387 VK_F1, IDA_HELP, VIRTKEY, NOINVERT > 388 END > 389 > 390 > 391 ///////////////////////////////////////////////////////////////////////////// > 392 // > 393 // 24 > 394 // > 395 > 396 1 24 MOVEABLE PURE "manifest.xml" > 397 > 398 ///////////////////////////////////////////////////////////////////////////// > 399 // > 400 // String Table > 401 // > 402 > 403 STRINGTABLE DISCARDABLE > 404 BEGIN > 405 IDS_M_ERROR "解凍できませんでした!\n書庫ではないか、壊れていまキ。" > 406 IDS_C_ERROR "対応していない圧縮形式に設定されています。\nNoahのン定を変更するか、適切なDLL等をインストールして下さい。" > 407 IDS_CHOOSEDIR "出力先を選んで下さい。" > 408 IDS_FNAME "ファイル名" > 409 IDS_SIZE "サイズ" > 410 IDS_DATETIME "日時" > 411 IDS_RATIO "圧縮率" > 412 IDS_METHOD "形式" > 413 IDS_PATH "パス" > 414 IDS_EXECUTING "Noahから起動したソフトが実行中です。このまま終わるニディスクに不要なファイルが残る可能性が大きいですが、終了しますか?" > 415 IDS_NOLIST "エラー:リストアップ不可能な書庫です。" > 416 IDS_ARCVIEW_MSG "[%d個のファイル] [圧縮率 %d%%] [%s]" > 417 END > 418 > 419 #endif // 日本語 resources > 420 ///////////////////////////////////////////////////////////////////////////// > 421 > 422 > 423 ///////////////////////////////////////////////////////////////////////////// > 424 // 英語 (アメリカ) resources > 425 > 426 #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) > 427 #ifdef _WIN32 > 428 LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US > 429 #pragma code_page(1252) > 430 #endif //_WIN32 > 431 > 432 ///////////////////////////////////////////////////////////////////////////// > 433 // > 434 // Dialog > 435 // > 436 > 437 IDD_ARCVIEW DIALOG DISCARDABLE 0, 0, 353, 155 > 438 STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU | > 439 WS_THICKFRAME > 440 FONT 9, "MS Sans Serif" > 441 BEGIN > 442 CONTROL "List1",IDC_FILELIST,"SysListView32",LVS_REPORT | > 443 LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_BORDER | > 444 WS_TABSTOP,0,20,350,126 > 445 PUSHBUTTON "Extract &All",IDOK,7,3,36,14 > 446 PUSHBUTTON "E&xtract",IDC_MELTEACH,46,3,26,14 > 447 PUSHBUTTON "&Inv",IDC_SELECTINV,97,3,19,14 > 448 EDITTEXT IDC_DDIR,119,3,149,14,ES_AUTOHSCROLL > 449 PUSHBUTTON "...",IDC_REF,273,3,13,14 > 450 DEFPUSHBUTTON "&View",IDC_SHOW,75,3,19,14 > 451 END > 452 > 453 IDD_WINCFG DIALOG DISCARDABLE 0, 0, 219, 121 > 454 STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU > 455 CAPTION "Windows" > 456 FONT 9, "MS Sans Serif" > 457 BEGIN > 458 GROUPBOX "Association",IDC_STATIC,7,7,205,36 > 459 CONTROL "&LZH",IDC_LZH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12, > 460 18,28,10 > 461 CONTROL "&ZIP",IDC_ZIP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12, > 462 28,26,10 > 463 CONTROL "&CAB",IDC_CAB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,40, > 464 18,30,10 > 465 CONTROL "&RAR",IDC_RAR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,40, > 466 28,30,10 > 467 CONTROL "&TAR",IDC_TAR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,70, > 468 18,29,10 > 469 CONTROL "&YZ1",IDC_YZ1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,70, > 470 28,27,10 > 471 CONTROL "&GCA",IDC_GCA,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,99, > 472 18,30,10 > 473 CONTROL "AR&J",IDC_ARJ,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,99, > 474 28,29,10 > 475 CONTROL "&BGA",IDC_BGA,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,129, > 476 18,30,10 > 477 CONTROL "AC&E",IDC_ACE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,129, > 478 28,29,10 > 479 CONTROL "C&PT",IDC_CPT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,159, > 480 18,29,10 > 481 CONTROL "JA&K",IDC_JAK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,159, > 482 28,29,10 > 483 CONTROL "&7Z",IDC_7Z,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,188, > 484 18,21,10 > 485 GROUPBOX "D&&D Shell Extension",IDC_STATIC,7,47,205,31 > 486 CONTROL "Compress &Here",IDC_CMP,"Button",BS_AUTOCHECKBOX | > 487 WS_TABSTOP,14,61,65,10 > 488 CONTROL "E&xpand Here",IDC_MLT,"Button",BS_AUTOCHECKBOX | > 489 WS_TABSTOP,85,61,72,10 > 490 GROUPBOX "Shortcut",IDC_STATIC,7,84,205,30 > 491 CONTROL "&SendTo",IDC_SND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, > 492 14,96,56,10 > 493 CONTROL "&Desktop",IDC_DSK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, > 494 85,95,60,10 > 495 PUSHBUTTON "...",IDC_ASS,193,31,13,9 > 496 END > 497 > 498 IDD_MLTCFG DIALOG DISCARDABLE 0, 0, 219, 121 > 499 STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU > 500 CAPTION "Extract" > 501 FONT 9, "MS Sans Serif" > 502 BEGIN > 503 GROUPBOX "Destination Folder",IDC_STATIC,7,7,205,43 > 504 CONTROL "Archive's Folder",IDC_DDIR1,"Button",BS_AUTORADIOBUTTON | > 505 WS_GROUP,11,20,126,10 > 506 CONTROL "",IDC_DDIR2,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,11, > 507 33,10,8 > 508 EDITTEXT IDC_DDIR,23,32,167,12,ES_AUTOHSCROLL | WS_GROUP > 509 PUSHBUTTON "...",IDC_REF,194,31,13,14,WS_GROUP > 510 CONTROL "Open",IDC_ODIR,"Button",BS_AUTOCHECKBOX | WS_GROUP | > 511 WS_TABSTOP,163,18,42,10 > 512 GROUPBOX "",IDC_STATIC,7,52,205,62 > 513 CONTROL "Create Directory",IDC_MKDIR,"Button",BS_AUTOCHECKBOX | > 514 WS_GROUP | WS_TABSTOP,16,62,183,10 > 515 CONTROL "Not create when only 1 file is contained",IDC_MKDIR1, > 516 "Button",BS_AUTOCHECKBOX | WS_TABSTOP,32,73,170,10 > 517 CONTROL "Not create when only 1 folder is contained",IDC_MKDIR2, > 518 "Button",BS_AUTOCHECKBOX | WS_TABSTOP,32,84,173,10 > 519 CONTROL "Omit trail numbers",IDC_MKDIR3,"Button",BS_AUTOCHECKBOX | > 520 WS_TABSTOP,32,95,169,10 > 521 END > 522 > 523 IDD_CMPCFG DIALOG DISCARDABLE 0, 0, 219, 121 > 524 STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU > 525 CAPTION "Compress" > 526 FONT 9, "MS Sans Serif" > 527 BEGIN > 528 GROUPBOX "Destination Folder",IDC_STATIC,7,7,205,43 > 529 CONTROL "Source's Folder",IDC_DDIR1,"Button",BS_AUTORADIOBUTTON | > 530 WS_GROUP,11,20,122,10 > 531 CONTROL "",IDC_DDIR2,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,11, > 532 33,8,10 > 533 EDITTEXT IDC_DDIR,23,32,167,12,ES_AUTOHSCROLL | WS_GROUP > 534 PUSHBUTTON "...",IDC_REF,194,31,13,14,WS_GROUP > 535 CONTROL "Open",IDC_ODIR,"Button",BS_AUTOCHECKBOX | WS_GROUP | > 536 WS_TABSTOP,163,18,43,9 > 537 GROUPBOX "Method",IDC_STATIC,7,57,117,57 > 538 COMBOBOX IDC_CMPEXT,13,81,33,163,CBS_DROPDOWNLIST | CBS_SORT | > 539 CBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_GROUP | > 540 WS_TABSTOP > 541 COMBOBOX IDC_CMPMHD,49,81,66,79,CBS_DROPDOWNLIST | > 542 CBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP > 543 GROUPBOX "Which-To-Do",IDC_STATIC,133,57,79,57 > 544 CONTROL "Compress Only",IDC_MODE1,"Button",BS_AUTORADIOBUTTON | > 545 WS_GROUP,145,69,61,10 > 546 CONTROL "mode-1",IDC_MODE2,"Button",BS_AUTORADIOBUTTON,145,79,59, > 547 10 > 548 CONTROL "mode-2",IDC_MODE3,"Button",BS_AUTORADIOBUTTON | > 549 WS_TABSTOP,145,89,60,10 > 550 CONTROL "Extract Only",IDC_MODE4,"Button",BS_AUTORADIOBUTTON,145, > 551 99,60,10 > 552 END > 553 > 554 IDD_ANYASS DIALOG DISCARDABLE 0, 0, 207, 97 > 555 STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU > 556 CAPTION "Other Format Association" > 557 FONT 9, "MS Sans Serif" > 558 BEGIN > 559 LISTBOX IDC_NASSOC,7,7,77,62,LBS_SORT | LBS_NOINTEGRALHEIGHT | > 560 LBS_EXTENDEDSEL | WS_VSCROLL | WS_TABSTOP > 561 PUSHBUTTON "&Add >>",IDC_ADD,88,18,30,14 > 562 LISTBOX IDC_ASSOC,123,7,77,62,LBS_SORT | LBS_NOINTEGRALHEIGHT | > 563 LBS_EXTENDEDSEL | WS_VSCROLL | WS_TABSTOP > 564 PUSHBUTTON "<< &Del",IDC_DEL,88,38,30,14 > 565 DEFPUSHBUTTON "Execute",IDOK,95,76,50,14 > 566 PUSHBUTTON "Abort",IDCANCEL,150,76,50,14 > 567 END > 568 > 569 IDD_PATHCHECK DIALOG DISCARDABLE 0, 0, 298, 69 > 570 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU > 571 CAPTION "Noah Warning" > 572 FONT 9, "MS Sans Serif" > 573 BEGIN > 574 PUSHBUTTON "&Yes",IDYES,111,48,50,14 > 575 LTEXT "Contains absolute path or parent path "".."". Do you really > 576 IDC_STATIC,7,7,270,10 > 577 LTEXT "",IDC_PATHNAME,16,17,275,23 > 578 PUSHBUTTON "Yes to &All",ID_ALLYES,165,48,50,14 > 579 PUSHBUTTON "&Cancel",ID_ALLNO,241,48,50,14 > 580 END > 581 > 582 > 583 ///////////////////////////////////////////////////////////////////////////// > 584 // > 585 // DESIGNINFO > 586 // > 587 > 588 #ifdef APSTUDIO_INVOKED > 589 GUIDELINES DESIGNINFO DISCARDABLE > 590 BEGIN > 591 IDD_ARCVIEW, DIALOG > 592 BEGIN > 593 RIGHTMARGIN, 350 > 594 TOPMARGIN, 3 > 595 BOTTOMMARGIN, 146 > 596 END > 597 > 598 IDD_WINCFG, DIALOG > 599 BEGIN > 600 LEFTMARGIN, 7 > 601 RIGHTMARGIN, 212 > 602 TOPMARGIN, 7 > 603 BOTTOMMARGIN, 114 > 604 END > 605 > 606 IDD_MLTCFG, DIALOG > 607 BEGIN > 608 LEFTMARGIN, 7 > 609 RIGHTMARGIN, 212 > 610 TOPMARGIN, 7 > 611 BOTTOMMARGIN, 114 > 612 END > 613 > 614 IDD_CMPCFG, DIALOG > 615 BEGIN > 616 LEFTMARGIN, 7 > 617 RIGHTMARGIN, 212 > 618 TOPMARGIN, 7 > 619 BOTTOMMARGIN, 114 > 620 END > 621 > 622 IDD_ANYASS, DIALOG > 623 BEGIN > 624 LEFTMARGIN, 7 > 625 RIGHTMARGIN, 200 > 626 TOPMARGIN, 7 > 627 BOTTOMMARGIN, 90 > 628 END > 629 > 630 IDD_PATHCHECK, DIALOG > 631 BEGIN > 632 LEFTMARGIN, 7 > 633 RIGHTMARGIN, 291 > 634 TOPMARGIN, 7 > 635 BOTTOMMARGIN, 62 > 636 END > 637 END > 638 #endif // APSTUDIO_INVOKED > 639 > 640 > 641 ///////////////////////////////////////////////////////////////////////////// > 642 // > 643 // String Table > 644 // > 645 > 646 STRINGTABLE DISCARDABLE > 647 BEGIN > 648 IDS_M_ERROR "Can't extract !\nIt's a non-archive file or a broke > 649 IDS_C_ERROR "Unsupported compression method !\nMaybe because of > 650 IDS_CHOOSEDIR "Choose a destination folder." > 651 IDS_FNAME "NAME" > 652 IDS_SIZE "SIZE" > 653 IDS_DATETIME "TIME" > 654 IDS_RATIO "RATIO" > 655 IDS_METHOD "METHOD" > 656 IDS_PATH "PATH" > 657 IDS_EXECUTING "Application launched from Noah is living. Do you re > 658 IDS_NOLIST "Error: Can't ListUp The Contents of this Archive." > 659 IDS_ARCVIEW_MSG "[%d files] [Ratio: %d%%] [%s]" > 660 END > 661 > 662 #endif // 英語 (アメリカ) resources > 663 ///////////////////////////////////////////////////////////////////////////// > 664 > 665 > 666 > 667 #ifndef APSTUDIO_INVOKED > 668 ///////////////////////////////////////////////////////////////////////////// > 669 // > 670 // Generated from the TEXTINCLUDE 3 resource. > 671 // > 672 > 673 > 674 ///////////////////////////////////////////////////////////////////////////// > 675 #endif // not APSTUDIO_INVOKED > 676

Added Noah.sln version [4a4f438b41126acf]

> 1 サソ > 2 Microsoft Visual Studio Solution File, Format Version 11.00 > 3 # Visual C++ Express 2010 > 4 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Noah", "Noah.vcxproj", "{B9 > 5 EndProject > 6 Global > 7 GlobalSection(SolutionConfigurationPlatforms) = preSolution > 8 Debug|Win32 = Debug|Win32 > 9 Release|Win32 = Release|Win32 > 10 EndGlobalSection > 11 GlobalSection(ProjectConfigurationPlatforms) = postSolution > 12 {B9F0CC85-6A63-4320-A38A-2B9BCFDF9484}.Debug|Win32.ActiveCfg = D > 13 {B9F0CC85-6A63-4320-A38A-2B9BCFDF9484}.Debug|Win32.Build.0 = Deb > 14 {B9F0CC85-6A63-4320-A38A-2B9BCFDF9484}.Release|Win32.ActiveCfg = > 15 {B9F0CC85-6A63-4320-A38A-2B9BCFDF9484}.Release|Win32.Build.0 = R > 16 EndGlobalSection > 17 GlobalSection(SolutionProperties) = preSolution > 18 HideSolutionNode = FALSE > 19 EndGlobalSection > 20 EndGlobal

Added Noah.suo version [2f118ceefdecace4]

cannot compute difference between binary files

Added Noah.vcxproj version [902206edddd697f2]

> 1 サソ<?xml version="1.0" encoding="utf-8"?> > 2 <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microso > 3 <ItemGroup Label="ProjectConfigurations"> > 4 <ProjectConfiguration Include="Debug|Win32"> > 5 <Configuration>Debug</Configuration> > 6 <Platform>Win32</Platform> > 7 </ProjectConfiguration> > 8 <ProjectConfiguration Include="Release|Win32"> > 9 <Configuration>Release</Configuration> > 10 <Platform>Win32</Platform> > 11 </ProjectConfiguration> > 12 </ItemGroup> > 13 <PropertyGroup Label="Globals"> > 14 <ProjectGuid>{B9F0CC85-6A63-4320-A38A-2B9BCFDF9484}</ProjectGuid> > 15 <Keyword>Win32Proj</Keyword> > 16 <RootNamespace>Noah</RootNamespace> > 17 </PropertyGroup> > 18 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> > 19 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label > 20 <ConfigurationType>Application</ConfigurationType> > 21 <UseDebugLibraries>true</UseDebugLibraries> > 22 <CharacterSet>MultiByte</CharacterSet> > 23 </PropertyGroup> > 24 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Lab > 25 <ConfigurationType>Application</ConfigurationType> > 26 <UseDebugLibraries>false</UseDebugLibraries> > 27 <WholeProgramOptimization>true</WholeProgramOptimization> > 28 <CharacterSet>MultiByte</CharacterSet> > 29 </PropertyGroup> > 30 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> > 31 <ImportGroup Label="ExtensionSettings"> > 32 </ImportGroup> > 33 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'= > 34 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condit > 35 </ImportGroup> > 36 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'= > 37 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condit > 38 </ImportGroup> > 39 <PropertyGroup Label="UserMacros" /> > 40 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> > 41 <LinkIncremental>true</LinkIncremental> > 42 <IntDir>obj\$(Configuration)\</IntDir> > 43 </PropertyGroup> > 44 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> > 45 <LinkIncremental>false</LinkIncremental> > 46 <IntDir>obj\$(Configuration)\</IntDir> > 47 </PropertyGroup> > 48 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" > 49 <ClCompile> > 50 <PrecompiledHeader>Use</PrecompiledHeader> > 51 <WarningLevel>Level3</WarningLevel> > 52 <Optimization>Disabled</Optimization> > 53 <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)< > 54 <ForceConformanceInForLoopScope>false</ForceConformanceInForLoopScope> > 55 <DisableSpecificWarnings> > 56 </DisableSpecificWarnings> > 57 </ClCompile> > 58 <Link> > 59 <SubSystem>Windows</SubSystem> > 60 <GenerateDebugInformation>true</GenerateDebugInformation> > 61 <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;com > 62 <ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile> > 63 <EntryPointSymbol>kilib_startUp</EntryPointSymbol> > 64 </Link> > 65 <Manifest> > 66 <AdditionalManifestFiles>manifest.xml</AdditionalManifestFiles> > 67 </Manifest> > 68 </ItemDefinitionGroup> > 69 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32 > 70 <ClCompile> > 71 <WarningLevel>Level3</WarningLevel> > 72 <PrecompiledHeader>Use</PrecompiledHeader> > 73 <Optimization>MaxSpeed</Optimization> > 74 <FunctionLevelLinking>true</FunctionLevelLinking> > 75 <IntrinsicFunctions>true</IntrinsicFunctions> > 76 <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)< > 77 <ForceConformanceInForLoopScope>false</ForceConformanceInForLoopScope> > 78 <DisableSpecificWarnings> > 79 </DisableSpecificWarnings> > 80 <BufferSecurityCheck>false</BufferSecurityCheck> > 81 <BasicRuntimeChecks>Default</BasicRuntimeChecks> > 82 <RuntimeTypeInfo>false</RuntimeTypeInfo> > 83 <RuntimeLibrary>MultiThreaded</RuntimeLibrary> > 84 </ClCompile> > 85 <Link> > 86 <SubSystem>Windows</SubSystem> > 87 <GenerateDebugInformation>true</GenerateDebugInformation> > 88 <EnableCOMDATFolding>true</EnableCOMDATFolding> > 89 <OptimizeReferences>true</OptimizeReferences> > 90 <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;com > 91 <ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile> > 92 <EntryPointSymbol>kilib_startUp</EntryPointSymbol> > 93 </Link> > 94 <Manifest> > 95 <AdditionalManifestFiles>manifest.xml</AdditionalManifestFiles> > 96 </Manifest> > 97 </ItemDefinitionGroup> > 98 <ItemGroup> > 99 <None Include="b2e.ico" /> > 100 <None Include="manifest.xml" /> > 101 <None Include="Noah.ico" /> > 102 <None Include="ReadMe.txt" /> > 103 </ItemGroup> > 104 <ItemGroup> > 105 <ClCompile Include="ArcACE.cpp" /> > 106 <ClCompile Include="ArcB2e.cpp" /> > 107 <ClCompile Include="ArcCpt.cpp" /> > 108 <ClCompile Include="ArcDLL.cpp" /> > 109 <ClCompile Include="Archiver.cpp" /> > 110 <ClCompile Include="ArcMsc.cpp" /> > 111 <ClCompile Include="kilib\kl_app.cpp" /> > 112 <ClCompile Include="kilib\kl_carc.cpp" /> > 113 <ClCompile Include="kilib\kl_cmd.cpp" /> > 114 <ClCompile Include="kilib\kl_dnd.cpp" /> > 115 <ClCompile Include="kilib\kl_file.cpp" /> > 116 <ClCompile Include="kilib\kl_find.cpp" /> > 117 <ClCompile Include="kilib\kl_reg.cpp" /> > 118 <ClCompile Include="kilib\kl_rythp.cpp" /> > 119 <ClCompile Include="kilib\kl_str.cpp" /> > 120 <ClCompile Include="kilib\kl_wcmn.cpp" /> > 121 <ClCompile Include="kilib\kl_wnd.cpp" /> > 122 <ClCompile Include="Noah.cpp" /> > 123 <ClCompile Include="NoahAM.cpp" /> > 124 <ClCompile Include="NoahCM.cpp" /> > 125 <ClCompile Include="stdafx.cpp"> > 126 <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32 > 127 <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win > 128 </ClCompile> > 129 <ClCompile Include="SubDlg.cpp" /> > 130 </ItemGroup> > 131 <ItemGroup> > 132 <ClInclude Include="ArcACE.h" /> > 133 <ClInclude Include="ArcB2e.h" /> > 134 <ClInclude Include="ArcCpt.h" /> > 135 <ClInclude Include="ArcDLL.h" /> > 136 <ClInclude Include="Archiver.h" /> > 137 <ClInclude Include="ArcMsc.h" /> > 138 <ClInclude Include="kilib\kilib.h" /> > 139 <ClInclude Include="kilib\kilibext.h" /> > 140 <ClInclude Include="kilib\kl_app.h" /> > 141 <ClInclude Include="kilib\kl_carc.h" /> > 142 <ClInclude Include="kilib\kl_cmd.h" /> > 143 <ClInclude Include="kilib\kl_dnd.h" /> > 144 <ClInclude Include="kilib\kl_file.h" /> > 145 <ClInclude Include="kilib\kl_find.h" /> > 146 <ClInclude Include="kilib\kl_misc.h" /> > 147 <ClInclude Include="kilib\kl_reg.h" /> > 148 <ClInclude Include="kilib\kl_rythp.h" /> > 149 <ClInclude Include="kilib\kl_str.h" /> > 150 <ClInclude Include="kilib\kl_wcmn.h" /> > 151 <ClInclude Include="kilib\kl_wnd.h" /> > 152 <ClInclude Include="Noah.h" /> > 153 <ClInclude Include="NoahAM.h" /> > 154 <ClInclude Include="NoahApp.h" /> > 155 <ClInclude Include="NoahCM.h" /> > 156 <ClInclude Include="Resource.h" /> > 157 <ClInclude Include="stdafx.h" /> > 158 <ClInclude Include="SubDlg.h" /> > 159 <ClInclude Include="unacedef.h" /> > 160 </ItemGroup> > 161 <ItemGroup> > 162 <ResourceCompile Include="Noah.rc" /> > 163 </ItemGroup> > 164 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> > 165 <ImportGroup Label="ExtensionTargets"> > 166 </ImportGroup> > 167 </Project>

Added Noah.vcxproj.filters version [a5f2d1ccd22b557c]

> 1 サソ<?xml version="1.0" encoding="utf-8"?> > 2 <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuil > 3 <ItemGroup> > 4 <Filter Include="繧ス繝シ繧ケ 繝輔ぃ繧、繝ォ"> > 5 <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier > 6 <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> > 7 </Filter> > 8 <Filter Include="繝倥ャ繝繝シ 繝輔ぃ繧、繝ォ"> > 9 <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier > 10 <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions> > 11 </Filter> > 12 <Filter Include="繝ェ繧ス繝シ繧ケ 繝輔ぃ繧、繝ォ"> > 13 <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier > 14 <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff; > 15 </Filter> > 16 </ItemGroup> > 17 <ItemGroup> > 18 <None Include="ReadMe.txt" /> > 19 <None Include="b2e.ico"> > 20 <Filter>繝ェ繧ス繝シ繧ケ 繝輔ぃ繧、繝ォ</Filter> > 21 </None> > 22 <None Include="manifest.xml" /> > 23 <None Include="Noah.ico"> > 24 <Filter>繝ェ繧ス繝シ繧ケ 繝輔ぃ繧、繝ォ</Filter> > 25 </None> > 26 </ItemGroup> > 27 <ItemGroup> > 28 <ClCompile Include="stdafx.cpp"> > 29 <Filter>繧ス繝シ繧ケ 繝輔ぃ繧、繝ォ</Filter> > 30 </ClCompile> > 31 <ClCompile Include="Noah.cpp"> > 32 <Filter>繧ス繝シ繧ケ 繝輔ぃ繧、繝ォ</Filter> > 33 </ClCompile> > 34 <ClCompile Include="ArcACE.cpp"> > 35 <Filter>繧ス繝シ繧ケ 繝輔ぃ繧、繝ォ</Filter> > 36 </ClCompile> > 37 <ClCompile Include="ArcB2e.cpp"> > 38 <Filter>繧ス繝シ繧ケ 繝輔ぃ繧、繝ォ</Filter> > 39 </ClCompile> > 40 <ClCompile Include="ArcCpt.cpp"> > 41 <Filter>繧ス繝シ繧ケ 繝輔ぃ繧、繝ォ</Filter> > 42 </ClCompile> > 43 <ClCompile Include="ArcDLL.cpp"> > 44 <Filter>繧ス繝シ繧ケ 繝輔ぃ繧、繝ォ</Filter> > 45 </ClCompile> > 46 <ClCompile Include="Archiver.cpp"> > 47 <Filter>繧ス繝シ繧ケ 繝輔ぃ繧、繝ォ</Filter> > 48 </ClCompile> > 49 <ClCompile Include="ArcMsc.cpp"> > 50 <Filter>繧ス繝シ繧ケ 繝輔ぃ繧、繝ォ</Filter> > 51 </ClCompile> > 52 <ClCompile Include="NoahAM.cpp"> > 53 <Filter>繧ス繝シ繧ケ 繝輔ぃ繧、繝ォ</Filter> > 54 </ClCompile> > 55 <ClCompile Include="NoahCM.cpp"> > 56 <Filter>繧ス繝シ繧ケ 繝輔ぃ繧、繝ォ</Filter> > 57 </ClCompile> > 58 <ClCompile Include="SubDlg.cpp"> > 59 <Filter>繧ス繝シ繧ケ 繝輔ぃ繧、繝ォ</Filter> > 60 </ClCompile> > 61 <ClCompile Include="kilib\kl_app.cpp"> > 62 <Filter>繧ス繝シ繧ケ 繝輔ぃ繧、繝ォ</Filter> > 63 </ClCompile> > 64 <ClCompile Include="kilib\kl_carc.cpp"> > 65 <Filter>繧ス繝シ繧ケ 繝輔ぃ繧、繝ォ</Filter> > 66 </ClCompile> > 67 <ClCompile Include="kilib\kl_cmd.cpp"> > 68 <Filter>繧ス繝シ繧ケ 繝輔ぃ繧、繝ォ</Filter> > 69 </ClCompile> > 70 <ClCompile Include="kilib\kl_dnd.cpp"> > 71 <Filter>繧ス繝シ繧ケ 繝輔ぃ繧、繝ォ</Filter> > 72 </ClCompile> > 73 <ClCompile Include="kilib\kl_file.cpp"> > 74 <Filter>繧ス繝シ繧ケ 繝輔ぃ繧、繝ォ</Filter> > 75 </ClCompile> > 76 <ClCompile Include="kilib\kl_find.cpp"> > 77 <Filter>繧ス繝シ繧ケ 繝輔ぃ繧、繝ォ</Filter> > 78 </ClCompile> > 79 <ClCompile Include="kilib\kl_reg.cpp"> > 80 <Filter>繧ス繝シ繧ケ 繝輔ぃ繧、繝ォ</Filter> > 81 </ClCompile> > 82 <ClCompile Include="kilib\kl_rythp.cpp"> > 83 <Filter>繧ス繝シ繧ケ 繝輔ぃ繧、繝ォ</Filter> > 84 </ClCompile> > 85 <ClCompile Include="kilib\kl_str.cpp"> > 86 <Filter>繧ス繝シ繧ケ 繝輔ぃ繧、繝ォ</Filter> > 87 </ClCompile> > 88 <ClCompile Include="kilib\kl_wcmn.cpp"> > 89 <Filter>繧ス繝シ繧ケ 繝輔ぃ繧、繝ォ</Filter> > 90 </ClCompile> > 91 <ClCompile Include="kilib\kl_wnd.cpp"> > 92 <Filter>繧ス繝シ繧ケ 繝輔ぃ繧、繝ォ</Filter> > 93 </ClCompile> > 94 </ItemGroup> > 95 <ItemGroup> > 96 <ClInclude Include="ArcACE.h"> > 97 <Filter>繝倥ャ繝繝シ 繝輔ぃ繧、繝ォ</Filter> > 98 </ClInclude> > 99 <ClInclude Include="ArcB2e.h"> > 100 <Filter>繝倥ャ繝繝シ 繝輔ぃ繧、繝ォ</Filter> > 101 </ClInclude> > 102 <ClInclude Include="ArcCpt.h"> > 103 <Filter>繝倥ャ繝繝シ 繝輔ぃ繧、繝ォ</Filter> > 104 </ClInclude> > 105 <ClInclude Include="ArcDLL.h"> > 106 <Filter>繝倥ャ繝繝シ 繝輔ぃ繧、繝ォ</Filter> > 107 </ClInclude> > 108 <ClInclude Include="Archiver.h"> > 109 <Filter>繝倥ャ繝繝シ 繝輔ぃ繧、繝ォ</Filter> > 110 </ClInclude> > 111 <ClInclude Include="ArcMsc.h"> > 112 <Filter>繝倥ャ繝繝シ 繝輔ぃ繧、繝ォ</Filter> > 113 </ClInclude> > 114 <ClInclude Include="Noah.h"> > 115 <Filter>繝倥ャ繝繝シ 繝輔ぃ繧、繝ォ</Filter> > 116 </ClInclude> > 117 <ClInclude Include="NoahAM.h"> > 118 <Filter>繝倥ャ繝繝シ 繝輔ぃ繧、繝ォ</Filter> > 119 </ClInclude> > 120 <ClInclude Include="NoahApp.h"> > 121 <Filter>繝倥ャ繝繝シ 繝輔ぃ繧、繝ォ</Filter> > 122 </ClInclude> > 123 <ClInclude Include="NoahCM.h"> > 124 <Filter>繝倥ャ繝繝シ 繝輔ぃ繧、繝ォ</Filter> > 125 </ClInclude> > 126 <ClInclude Include="Resource.h"> > 127 <Filter>繝倥ャ繝繝シ 繝輔ぃ繧、繝ォ</Filter> > 128 </ClInclude> > 129 <ClInclude Include="stdafx.h"> > 130 <Filter>繝倥ャ繝繝シ 繝輔ぃ繧、繝ォ</Filter> > 131 </ClInclude> > 132 <ClInclude Include="SubDlg.h"> > 133 <Filter>繝倥ャ繝繝シ 繝輔ぃ繧、繝ォ</Filter> > 134 </ClInclude> > 135 <ClInclude Include="unacedef.h"> > 136 <Filter>繝倥ャ繝繝シ 繝輔ぃ繧、繝ォ</Filter> > 137 </ClInclude> > 138 <ClInclude Include="kilib\kilib.h"> > 139 <Filter>繝倥ャ繝繝シ 繝輔ぃ繧、繝ォ</Filter> > 140 </ClInclude> > 141 <ClInclude Include="kilib\kilibext.h"> > 142 <Filter>繝倥ャ繝繝シ 繝輔ぃ繧、繝ォ</Filter> > 143 </ClInclude> > 144 <ClInclude Include="kilib\kl_app.h"> > 145 <Filter>繝倥ャ繝繝シ 繝輔ぃ繧、繝ォ</Filter> > 146 </ClInclude> > 147 <ClInclude Include="kilib\kl_carc.h"> > 148 <Filter>繝倥ャ繝繝シ 繝輔ぃ繧、繝ォ</Filter> > 149 </ClInclude> > 150 <ClInclude Include="kilib\kl_cmd.h"> > 151 <Filter>繝倥ャ繝繝シ 繝輔ぃ繧、繝ォ</Filter> > 152 </ClInclude> > 153 <ClInclude Include="kilib\kl_dnd.h"> > 154 <Filter>繝倥ャ繝繝シ 繝輔ぃ繧、繝ォ</Filter> > 155 </ClInclude> > 156 <ClInclude Include="kilib\kl_file.h"> > 157 <Filter>繝倥ャ繝繝シ 繝輔ぃ繧、繝ォ</Filter> > 158 </ClInclude> > 159 <ClInclude Include="kilib\kl_find.h"> > 160 <Filter>繝倥ャ繝繝シ 繝輔ぃ繧、繝ォ</Filter> > 161 </ClInclude> > 162 <ClInclude Include="kilib\kl_misc.h"> > 163 <Filter>繝倥ャ繝繝シ 繝輔ぃ繧、繝ォ</Filter> > 164 </ClInclude> > 165 <ClInclude Include="kilib\kl_reg.h"> > 166 <Filter>繝倥ャ繝繝シ 繝輔ぃ繧、繝ォ</Filter> > 167 </ClInclude> > 168 <ClInclude Include="kilib\kl_rythp.h"> > 169 <Filter>繝倥ャ繝繝シ 繝輔ぃ繧、繝ォ</Filter> > 170 </ClInclude> > 171 <ClInclude Include="kilib\kl_str.h"> > 172 <Filter>繝倥ャ繝繝シ 繝輔ぃ繧、繝ォ</Filter> > 173 </ClInclude> > 174 <ClInclude Include="kilib\kl_wcmn.h"> > 175 <Filter>繝倥ャ繝繝シ 繝輔ぃ繧、繝ォ</Filter> > 176 </ClInclude> > 177 <ClInclude Include="kilib\kl_wnd.h"> > 178 <Filter>繝倥ャ繝繝シ 繝輔ぃ繧、繝ォ</Filter> > 179 </ClInclude> > 180 </ItemGroup> > 181 <ItemGroup> > 182 <ResourceCompile Include="Noah.rc"> > 183 <Filter>繝ェ繧ス繝シ繧ケ 繝輔ぃ繧、繝ォ</Filter> > 184 </ResourceCompile> > 185 </ItemGroup> > 186 </Project>

Added NoahAM.cpp version [764020530952f7ee]

> 1 // NoahAM.cpp > 2 //-- control many archiver routines -- > 3 > 4 #include "stdafx.h" > 5 #include "resource.h" > 6 #include "NoahApp.h" > 7 #include "NoahAM.h" > 8 #include "ArcDLL.h" > 9 #include "ArcAce.h" > 10 #include "ArcMsc.h" > 11 #include "ArcB2e.h" > 12 #include "ArcCpt.h" > 13 > 14 //----------------------------------------------// > 15 //------ 実働部隊のデータで初期化しておく ------// > 16 //----------------------------------------------// > 17 > 18 void CNoahArchiverManager::init() > 19 { > 20 const char* kl = mycnf().kill(); > 21 static int dead[128]; > 22 while( *kl ) dead[ 0x7f & (*(kl++)) ] = 1; > 23 > 24 // 初期対応形式 > 25 if( !dead['L'] ) m_AList.add( new CArcLzh ); > 26 if( !dead['7'] ) m_AList.add( new CArc7z ), > 27 m_AList.add( new CArc7zZip ); > 28 if( !dead['Z'] ) m_AList.add( new CArcUnZip ); > 29 if( !dead['z'] ) m_AList.add( new CArcZip ); > 30 if( !dead['T'] ) m_AList.add( new CArcTar ); > 31 if( !dead['C'] ) m_AList.add( new CArcCab ); > 32 if( !dead['R'] ) m_AList.add( new CArcRar ); > 33 if( !dead['A'] ) m_AList.add( new CArcArj ); > 34 if( !dead['B'] ) m_AList.add( new CArcBga ); > 35 if( !dead['Y'] ) m_AList.add( new CArcYz1 ); > 36 if( !dead['G'] ) m_AList.add( new CArcGca ); > 37 if( !dead['a'] ) m_AList.add( new CArcAce ); > 38 if( !dead['M'] ) m_AList.add( new CArcMsc ); > 39 if( !dead['c'] ) m_AList.add( new CArcCpt ); > 40 > 41 // 拡張スクリプトロード > 42 char prev_cur[MAX_PATH]; > 43 ::GetCurrentDirectory(MAX_PATH, prev_cur); > 44 ::SetCurrentDirectory( CArcB2e::init_b2e_path() ); > 45 kiFindFile find; > 46 find.begin( "*.b2e" ); > 47 WIN32_FIND_DATA fd; > 48 for( int t=0; find.next(&fd); t++ ) > 49 m_AList.add( new CArcB2e(fd.cFileName) ); > 50 m_b2e = (t>1); > 51 ::SetCurrentDirectory(prev_cur); > 52 } > 53 > 54 //----------------------------------------------// > 55 //------------ ファイルリストを記憶 ------------// > 56 //----------------------------------------------// > 57 > 58 unsigned long CNoahArchiverManager::set_files( const cCharArray& files ) > 59 { > 60 //-- クリア > 61 m_FName.empty(); > 62 m_BasePathList.empty(); > 63 > 64 //-- 基底パスを取得( 出来るだけ利用範囲を広げるため、8.3形式で ) > 65 if( files.len() != 0 ) > 66 { > 67 char spath[MAX_PATH]; > 68 m_BasePath = > 69 ( 0!=::GetShortPathName( files[0], spath, MAX_PATH ) ) > 70 ? spath : ""; > 71 if( !m_BasePath.beDirOnly() ) > 72 { > 73 m_BasePath.beSpecialPath( kiPath::Cur ); > 74 m_BasePath.beBackSlash( true ); > 75 } > 76 } > 77 > 78 //-- 短いファイル名と長いのを両方取得しておく > 79 m_FName.alloc( files.len() ); > 80 m_BasePathList.alloc( files.len() ); > 81 for( unsigned int i=0,c=0; i!=files.len(); i++ ) > 82 if( kiFindFile::findfirst( files[i], &m_FName[c] ) ) > 83 { > 84 if( m_FName[c].cAlternateFileName[0] == '\0' ) > 85 ::lstrcpy(m_FName[c].cAlternateFileName,m_FName[ > 86 m_BasePathList[c] = files[i]; > 87 if( !m_BasePathList[c].beDirOnly() ) > 88 { > 89 m_BasePathList[c].beSpecialPath( kiPath::Cur ); > 90 m_BasePathList[c].beBackSlash( true ); > 91 } > 92 ++c; > 93 } > 94 m_FName.forcelen( c ); > 95 m_BasePathList.forcelen( c ); > 96 return c; > 97 } > 98 > 99 //----------------------------------------------// > 100 //--- ファイルリストに解凍ルーチンを割り当て ---// > 101 //----------------------------------------------// > 102 > 103 // 指定された拡張子に対応しているルーチンを線形探索 > 104 CArchiver* CNoahArchiverManager::fromExt( const char* ext ) > 105 { > 106 kiStr tmp = ext; > 107 tmp.lower(); > 108 > 109 for( unsigned int i=0; i!=m_AList.len(); i++ ) > 110 if( m_AList[i]->extCheck( tmp ) > 111 && (m_AList[i]->ability() & aMelt) ) > 112 return m_AList[i]; > 113 return NULL; > 114 } > 115 > 116 bool CNoahArchiverManager::map_melters( int mode ) // 1:cmp 2:mlt 3:must_mlt > 117 { > 118 // クリア > 119 m_Melters.empty(); > 120 > 121 #define attrb (m_FName[ct].dwFileAttributes) > 122 #define lname (m_FName[ct].cFileName) > 123 #define sname (m_FName[ct].cAlternateFileName[0]==0 ? m_FName[ct].cFileName : m_ > 124 > 125 kiPath fnm; > 126 const char* ext; > 127 for( unsigned int ct=0, bad=0; ct!=file_num(); ct++ ) > 128 { > 129 // fnm = m_BasePath, fnm += sname; > 130 fnm = m_BasePathList[ct], fnm += sname; > 131 > 132 //-- 0byteファイル / ディレクトリは弾く > 133 if( !(attrb & FILE_ATTRIBUTE_DIRECTORY) && 0!=kiFile::getSize( f > 134 { > 135 //-- まず対応拡張子かどうかで候補Aを一つ選出 > 136 CArchiver* x = fromExt( ext=kiPath::ext(lname) ); > 137 > 138 //-- 候補Aで、ファイル内容によるチェック > 139 if( x && x->check( fnm ) ) > 140 { > 141 m_Melters.add( x ); > 142 continue; > 143 } > 144 > 145 //-- 候補Aが内容チェック不可なものだったらそれを使う > 146 if( x && !(x->ability() & aCheck) ) > 147 { > 148 m_Melters.add( x ); > 149 continue; > 150 } > 151 > 152 //-- 候補Aがダメなら、その他の内容チェック可能なルーチン全てで試す > 153 if( mode!=1 || 0==ki_strcmpi( "exe", ext ) ) > 154 { > 155 for( unsigned long j=0; j!=m_AList.len(); j++ ) > 156 if( m_AList[j]!=x && m_AList[j]->check( > 157 { > 158 m_Melters.add( m_AList[j] ); > 159 break; > 160 } > 161 if( m_Melters.len() == ct+1 ) > 162 continue; > 163 } > 164 } > 165 > 166 //-- チェックの結果、解凍不能でしたとさ > 167 if( mode!=3 ) > 168 return false; //-- 解凍専用モードでなければ終了 > 169 m_Melters.add( NULL ), bad++; > 170 } > 171 #undef sname > 172 #undef lname > 173 #undef attrb > 174 > 175 return (ct!=bad); > 176 } > 177 > 178 //----------------------------------------------// > 179 //--- ファイルリストに圧縮ルーチンを割り当て ---// > 180 //----------------------------------------------// > 181 > 182 bool CNoahArchiverManager::map_compressor( const char* ext, const char* method, > 183 { > 184 int m; > 185 m_Method = -1; > 186 m_Sfx = sfx; > 187 > 188 for( unsigned int i=0; i!=m_AList.len(); i++ ) > 189 if( -1 != (m=m_AList[i]->cancompressby(ext,method,sfx)) ) > 190 if( m!=-2 ) // 完全一致 > 191 { > 192 m_Compressor = m_AList[i]; > 193 m_Method = m; > 194 break; > 195 } > 196 else if( m_Method == -1 ) // 形式名のみ一致した最初のモノ > 197 { > 198 m_Compressor = m_AList[i]; > 199 m_Method = m_AList[i]->cmp_mhd_default(); > 200 } > 201 return (m_Method != -1); > 202 } > 203 > 204 //----------------------------------------------// > 205 //------------ バージョン情報文字列 ------------// > 206 //----------------------------------------------// > 207 > 208 void CNoahArchiverManager::get_version( kiStr& str ) > 209 { > 210 kiStr tmp; > 211 for( unsigned int i=0; i!=m_AList.len(); i++ ) > 212 if( m_AList[i]->ver( tmp ) ) > 213 str+=tmp, str+="\r\n"; > 214 } > 215 > 216 //----------------------------------------------// > 217 //--------------- 圧縮形式リスト ---------------// > 218 //----------------------------------------------// > 219 > 220 static unsigned int find( const cCharArray& x, const char* o ) > 221 { > 222 for( unsigned int i=0; i!=x.len(); i++ ) > 223 if( 0==ki_strcmp( x[i], o ) ) > 224 return i; > 225 return 0xffffffff; > 226 } > 227 > 228 static unsigned int find( const StrArray& x, const char* o ) > 229 { > 230 for( unsigned int i=0; i!=x.len(); i++ ) > 231 if( x[i]==o ) > 232 return i; > 233 return 0xffffffff; > 234 } > 235 > 236 void CNoahArchiverManager::get_cmpmethod( > 237 const char* set, > 238 int& def_mhd, > 239 StrArray& mhd_list, > 240 bool need_ext, > 241 cCharArray* ext_list ) > 242 { > 243 def_mhd = -1; > 244 > 245 const char* x; > 246 for( unsigned int i=0; i!=m_AList.len(); i++ ) > 247 { > 248 if( *(x = m_AList[i]->cmp_ext())=='\0' ) > 249 continue; > 250 if( need_ext ) > 251 { > 252 if( -1 == find( *ext_list, x ) ) > 253 ext_list->add( x ); > 254 } > 255 if( 0 == ki_strcmp( set, x ) ) > 256 { > 257 if( mhd_list.len()==0 ) > 258 { > 259 def_mhd = m_AList[i]->cmp_mhd_default(); > 260 for( unsigned int j=0; j!=m_AList[i]->cmp_mhd_li > 261 mhd_list.add( (m_AList[i]->cmp_mhd_list( > 262 } > 263 else > 264 { > 265 for( unsigned int j=0; j!=m_AList[i]->cmp_mhd_li > 266 if( -1 == find( mhd_list, (m_AList[i]->c > 267 mhd_list.add( (m_AList[i]->cmp_m > 268 } > 269 } > 270 } > 271 > 272 if( def_mhd == -1 ) > 273 def_mhd = 0; > 274 } > 275 > 276 //----------------------------------------------// > 277 //--------------- 書庫一覧モード ---------------// > 278 //----------------------------------------------// > 279 > 280 #include "SubDlg.h" > 281 > 282 void CNoahArchiverManager::do_listing( kiPath& destdir ) > 283 { > 284 kiWindow* mptr = app()->mainwnd(); > 285 kiPath ddir; > 286 int mdf = mycnf().mkdir(); > 287 bool rmn = mycnf().mnonum(); > 288 destdir.beBackSlash( true ); > 289 > 290 //-- ダイアログの個数カウンタをクリア > 291 kiArray<CArcViewDlg*> views; > 292 CArcViewDlg::clear(); > 293 > 294 //-- ダイアログ起動 > 295 for( unsigned int i=0; i!=m_FName.len(); i++ ) > 296 { > 297 if( !m_Melters[i] ) > 298 continue; > 299 > 300 arcname an( > 301 m_BasePathList[i], > 302 // m_BasePath, > 303 m_FName[i].cAlternateFileName[0]==0 ? m_FName[i].cFileNa > 304 m_FName[i].cFileName ); > 305 ddir = destdir; > 306 > 307 if( mdf ) > 308 generate_dirname( m_FName[i].cFileName, ddir, rmn ); > 309 > 310 CArcViewDlg* x = new CArcViewDlg( m_Melters[i],an,ddir ); > 311 views.add( x ); > 312 x->createModeless( NULL ); > 313 } > 314 > 315 //-- 全部終了するまで待機 > 316 kiWindow::msgLoop( kiWindow::GET ); > 317 > 318 //-- お終い > 319 app()->setMainWnd( mptr ); > 320 for( i=0; i!=views.len(); i++ ) > 321 delete views[i]; > 322 } > 323 > 324 //----------------------------------------------// > 325 //----------------- 解凍作業 -------------------// > 326 //----------------------------------------------// > 327 > 328 void CNoahArchiverManager::do_melting( kiPath& destdir ) > 329 { > 330 //-- 設定ロード > 331 const int mdf = mycnf().mkdir(); // Make Directory Flag( 0:no 1:no1fil > 332 const bool rmn = mycnf().mnonum(); // Remove NuMber ? > 333 > 334 //-- 出力先 > 335 destdir.beBackSlash( true ); > 336 destdir.mkdir(), destdir.beShortPath(); > 337 > 338 for( unsigned int i=0; i!=m_FName.len(); i++ ) > 339 if( m_Melters[i] ) > 340 { > 341 //-- 出力先 > 342 > 343 int mk=2; // 0:no 1:yes 2:??? > 344 kiPath ddir( destdir ), dnm; > 345 if( mdf==0 ) > 346 mk=0; > 347 else if( mdf==3 ) > 348 mk=1; > 349 else > 350 { > 351 kiPath anm(m_BasePathList[i]); > 352 // kiPath anm(m_BasePath); > 353 anm+=m_FName[i].cFileName; > 354 int c = m_Melters[i]->contents( anm, dnm ); > 355 if( c==aSingleDir || (c==aSingleFile && mdf==1) > 356 mk=0; // 2重フォルダ防止処理(強) > 357 else if( c==aMulti ) > 358 mk=1; > 359 } > 360 if( mk ) > 361 { > 362 generate_dirname( m_FName[i].cFileName, ddir, rm > 363 if( mk==2 && kiSUtil::exist(ddir) ) > 364 mk=1; > 365 ddir+='\\'; > 366 ddir.mkdir(); > 367 ddir.beShortPath(); > 368 } > 369 > 370 //-- 解凍! > 371 > 372 arcname an( m_BasePathList[i], > 373 // arcname an( m_BasePath, > 374 m_FName[i].cAlternateFileName[0]==0 ? m_FName[i] > 375 m_FName[i].cFileName ); > 376 int result = m_Melters[i]->melt( an, ddir ); > 377 if( result<0x8000 ) > 378 { > 379 if( mk==2 ) // 2重フォルダ防止処理(弱) > 380 break_ddir( ddir, mdf==2 ); > 381 else if( mk==0 && dnm.len() ) // 2重フォルダ防止処理(強) > 382 if( dnm.len()<=1 || dnm[1]!=':' ) // 絶対パ > 383 ddir+=dnm, ddir+='\\'; > 384 // 出力先を開くかも > 385 myapp().open_folder( ddir, 1 ); > 386 } > 387 else if( result!=0x8020 ) > 388 { > 389 //エラー! > 390 char str[255]; > 391 wsprintf( str, "%s\nError No: [%x]", > 392 (const char*)kiStr().loadRsrc( IDS_M_ERR > 393 app()->msgBox( str ); > 394 } > 395 } > 396 } > 397 > 398 void CNoahArchiverManager::generate_dirname( const char* src, kiPath& dst, bool > 399 { > 400 // srcで示された書庫名からディレクトリ名を生成し、 > 401 // dstへ足す。rmn==trueなら末尾の数字も削除 > 402 > 403 // 一番左の . と左から二番目の . を探す > 404 const char *fdot=NULL, *sdot=NULL, *tail; > 405 for( tail=src; *tail; tail=kiStr::next(tail) ) > 406 if( *tail=='.' ) > 407 sdot=fdot, fdot=tail; > 408 > 409 // .tar.xxx か、.xxx.gz/.xxx.z/.xxx.bz2 なら二つ削除 > 410 if( fdot ) > 411 { > 412 tail = fdot; > 413 if( sdot ) > 414 if( 0==::lstrcmpi(fdot,".gz") > 415 || 0==::lstrcmpi(fdot,".z") > 416 || 0==::lstrcmpi(fdot,".bz2") > 417 || (sdot+4==fdot > 418 && (sdot[1]=='t'||sdot[1]=='T') > 419 && (sdot[2]=='a'||sdot[2]=='A') > 420 && (sdot[3]=='r'||sdot[3]=='R') > 421 )) > 422 tail = sdot; > 423 } > 424 > 425 // 末尾の数字と'-'と'_'と'.'削除。半角スペースも。 > 426 bool del[256]; > 427 ki_memzero( del, sizeof(del) ); > 428 if( rmn ) > 429 { > 430 del['-'] = del['_'] = del['.'] = true; > 431 for( char c='0'; c<='9'; ++c ) > 432 del[c] = true; > 433 } > 434 del[' '] = true; > 435 > 436 const char* mjs=NULL; > 437 for( const char *x=src; x<tail; x=kiStr::next(x) ) > 438 if( !del[(unsigned char)(*x)] ) > 439 mjs = NULL; > 440 else if( !mjs ) > 441 mjs = x; > 442 if( mjs && mjs!=src ) > 443 tail = mjs; > 444 > 445 // 空になってしまったら "noahmelt" という名前にしてしまう。 > 446 if( src==tail ) > 447 dst += "noahmelt"; > 448 else > 449 while( src!=tail ) > 450 dst += *src++; > 451 } > 452 > 453 bool CNoahArchiverManager::break_ddir( kiPath& dir, bool onlydir ) > 454 { > 455 // 2重フォルダ or 単一ファイル 状態を解消 > 456 // > 457 // 素直に格納ファイル名を一度走査するのが本当なんですが、 > 458 // 特に巨大書庫の時速度低下が激しいのと、FindFirst系を > 459 // サポートしたDLLや内蔵エンジン以外に対応できないという > 460 // 欠点があるため、相変わらず Noah 2.xx と同じ手法です。 > 461 > 462 //-- 中に1個しか入ってないことを確認 ----------------- > 463 char wild[MAX_PATH]; > 464 ki_strcpy( wild, dir ); > 465 ki_strcat( wild, "*.*" ); > 466 kiFindFile find; > 467 if( !find.begin( wild ) ) > 468 return false; > 469 WIN32_FIND_DATA fd,fd2,fd3; > 470 find.next( &fd ); > 471 if( find.next( &fd2 ) ) > 472 return false; > 473 find.close(); > 474 //---------------------------------------------------- > 475 > 476 //-- to:最終移動先ファイル名。ついでに、カレントDirは消せない問題の回避策 ----- > 477 kiPath to(dir); to.beBackSlash( false ), to.beDirOnly(); > 478 ::SetCurrentDirectory( to ); > 479 to += fd.cFileName; > 480 //------------------------------------------------------------------------- > 481 > 482 //-- ファイルだった場合 -------------------------------------- > 483 if( !(fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ) > 484 { > 485 if( !onlydir ) > 486 { > 487 // now 現在のファイル名 > 488 kiStr now=dir; now+=fd.cFileName; > 489 > 490 // now -> to 移動 > 491 if( ::MoveFile( now, to ) ) > 492 { > 493 dir.remove(); > 494 dir.beBackSlash( false ), dir.beDirOnly(); > 495 return true; > 496 } > 497 } > 498 } > 499 //-- フォルダだった場合 ---------------------------------------- > 500 else > 501 { > 502 // 'base/aaa/aaa/' だと中のaaaを外にmoveできない。 > 503 // よって、回避策。-> 'base/aaa_noah_tmp_178116/aaa/' > 504 > 505 dir.beBackSlash( false ); > 506 kiFindFile::findfirst( dir, &fd3 ); > 507 kiPath dirx( dir ); dirx+="_noah_tmp_178116"; > 508 > 509 if( ::MoveFile( dir, dirx ) ) > 510 { > 511 // now 現在のファイル名 > 512 kiStr now( dirx ); now+='\\', now+=fd.cFileName; > 513 > 514 // ディレクトリを移動 > 515 if( ::MoveFile( now, to ) ) > 516 { > 517 dirx.remove(); > 518 dir=to, dir.beBackSlash( true ); > 519 return true; > 520 } > 521 else > 522 { > 523 // 'base/aaa_noah_tmp_178116/aaa/' -> 'base/aaa/ > 524 dir.beDirOnly(), dir+=fd3.cFileName; > 525 ::MoveFile( dirx, dir ); > 526 } > 527 } > 528 > 529 dir.beBackSlash( true ); > 530 } > 531 //------------------------------------------------------------ > 532 return false; > 533 } > 534 > 535 //----------------------------------------------// > 536 //----------------- 圧縮作業 -------------------// > 537 //----------------------------------------------// > 538 > 539 void CNoahArchiverManager::do_compressing( kiPath& destdir, bool each ) > 540 { > 541 int result = 0xffff, tr; > 542 > 543 // 出力先を確実に作っておく > 544 destdir.beBackSlash( true ); > 545 destdir.mkdir(); > 546 destdir.beShortPath(); > 547 > 548 // 個別圧縮モードか、Archiving不可の形式なら一個ずつ > 549 if( each || !(m_Compressor->ability() & aArchive) ) > 550 { > 551 wfdArray templist; > 552 > 553 for( unsigned int i=0; i!=m_FName.len(); i++ ) > 554 { > 555 templist.empty(); > 556 templist.add( m_FName[i] ); > 557 tr = m_Compressor->compress( m_BasePath,templist,destdir > 558 if( tr<0x8000 || tr==0x8020 ) > 559 result = tr; > 560 } > 561 } > 562 else > 563 result = m_Compressor->compress( m_BasePath,m_FName,destdir,m_Me > 564 > 565 // 開くかも > 566 if( result<0x8000 ) > 567 myapp().open_folder( destdir, 2 ); > 568 else if( result!=0x8020 ) > 569 { > 570 //エラー! > 571 char str[255]; > 572 wsprintf( str, "%s\nError No: [%x]", "Compression Error", result > 573 app()->msgBox( str ); > 574 } > 575 }

Added NoahAM.h version [1bc7e46b14f145cf]

> 1 // NoahAM.h > 2 //-- CNoahArchiverManager -- control many archiver routines -- > 3 > 4 #ifndef AFX_NOAHAM_H__CCE30761_D91B_4570_931A_6C165B19B22F__INCLUDED_ > 5 #define AFX_NOAHAM_H__CCE30761_D91B_4570_931A_6C165B19B22F__INCLUDED_ > 6 > 7 #include "Archiver.h" > 8 > 9 class CNoahArchiverManager > 10 { > 11 public: //-- 外向けインターフェイス ------------ > 12 > 13 // 初期化 > 14 void init(); > 15 > 16 // ファイルリストを記憶 > 17 unsigned long set_files( const cCharArray& files ); > 18 unsigned long file_num() { return m_FName.len(); } > 19 const kiPath& get_basepath() { return m_BasePath; } > 20 bool map_melters( int mode ); > 21 bool map_compressor( const char* ext, const char* method, bool sfx ); > 22 > 23 // 解凍( 解凍先Dir以外の情報は中で勝手に取得します ) > 24 void do_melting( kiPath& destdir ); > 25 // 閲覧( 解凍先Dir以外の情報は中で勝手に取得します ) > 26 void do_listing( kiPath& destdir ); > 27 // 圧縮 > 28 void do_compressing( kiPath& destdir, bool each ); > 29 > 30 > 31 // バージョン情報 > 32 void get_version( kiStr& str ); > 33 // 圧縮形式リスト > 34 void get_cmpmethod( const char* set, int& def_mhd, StrArray& mhd_list, b > 35 // b2eが一個以上読み込まれていればtrue > 36 bool b2e_enabled() { return m_b2e; } > 37 > 38 > 39 private: //-- 内部処理 --------------------------- > 40 > 41 // 2重フォルダ解消など > 42 bool break_ddir( kiPath& dir, bool onlydir ); > 43 CArchiver* fromExt( const char* ext ); > 44 void generate_dirname( const char* src, kiPath& dst, bool rmn ); > 45 > 46 kiPath m_BasePath; > 47 wfdArray m_FName; > 48 kiArray<CArchiver*> m_AList; > 49 kiArray<kiPath> m_BasePathList; > 50 bool m_b2e; > 51 > 52 // 解凍用割り当て > 53 kiArray<CArchiver*> m_Melters; > 54 // 圧縮用割り当て > 55 CArchiver* m_Compressor; > 56 int m_Method; > 57 bool m_Sfx; > 58 > 59 public: > 60 ~CNoahArchiverManager() > 61 { > 62 for( unsigned int i=0; i!=m_AList.len(); i++ ) > 63 delete m_AList[i]; > 64 } > 65 }; > 66 > 67 #endif

Added NoahApp.h version [6cb90051bc141532]

> 1 // NoahApp.h > 2 //-- CNoahApp -- application object of 'Noah' -- > 3 > 4 #ifndef AFX_NOAHAPP_H__11AA6C03_4946_4279_B79C_F28896001357__INCLUDED_ > 5 #define AFX_NOAHAPP_H__11AA6C03_4946_4279_B79C_F28896001357__INCLUDED_ > 6 > 7 #include "NoahAM.h" > 8 #include "NoahCM.h" > 9 > 10 class CNoahApp : public kiApp > 11 { > 12 public: //-- 外向けインターフェイス ------ > 13 > 14 //-- 圧縮/解凍作業 > 15 void do_cmdline( bool directcall=false ); > 16 void do_files( const cCharArray& files, > 17 const cCharArray* opts=NULL, > 18 bool basicaly_ignore=false ); > 19 > 20 //-- 雑用(笑) > 21 void open_folder( const kiPath& path,int from=0 ); > 22 void get_tempdir( kiPath& tmp ); > 23 bool is_writable_dir( const kiPath& path ); > 24 > 25 //-- Noahオブジェクト取得用マクロ > 26 # define myapp() (*(CNoahApp*)app()) > 27 # define myarc() (*(((CNoahApp*)app())->arc())) > 28 # define mycnf() (*(((CNoahApp*)app())->cnf())) > 29 > 30 public: //-- 内部処理 -------------------- > 31 > 32 CNoahArchiverManager* arc(){ return &m_arcMan; } > 33 CNoahConfigManager* cnf() { return &m_cnfMan; } > 34 private: > 35 void run( kiCmdParser& cmd ); > 36 > 37 CNoahArchiverManager m_arcMan; > 38 CNoahConfigManager m_cnfMan; > 39 kiCmdParser* m_pCmd; > 40 > 41 kiPath m_tmpDir; > 42 UINT m_tmpID; > 43 }; > 44 > 45 #endif

Added NoahCM.cpp version [285630280e899bbb]

> 1 // NoahCM.cpp > 2 //-- CNoahConfigManager -- save / load / modify the setting of 'Noah' -- > 3 > 4 #include "stdafx.h" > 5 #include "resource.h" > 6 #include "NoahApp.h" > 7 #include "NoahCM.h" > 8 > 9 //----------------------------------------------// > 10 //---------- INIファイル名の設定など -----------// > 11 //----------------------------------------------// > 12 > 13 void CNoahConfigManager::init() > 14 { > 15 //-- caldix.iniがもしあればDLLインストール先を読み込み。環境変数に追加 > 16 { > 17 kiIniFile caldini; > 18 caldini.setFileName( "caldix.ini" ); > 19 caldini.setSection( "conf" ); > 20 kiStr dll_to = caldini.getStr( "dll", "" ); > 21 if( dll_to.len() != 0 ) > 22 { > 23 int siz = ::GetEnvironmentVariable( "PATH", NULL, 0 ); > 24 char* buf = new char[siz+1]; > 25 ::GetEnvironmentVariable( "PATH", buf, siz+1 ); > 26 ::SetEnvironmentVariable( "PATH", (kiStr(buf)+=";")+=dll > 27 delete [] buf; > 28 } > 29 } > 30 > 31 //-- 設定読み込み済みフラグをクリア > 32 m_Loaded = 0; > 33 > 34 //-- iniファイル名設定 > 35 char usr[256]; > 36 DWORD siz=sizeof(usr); > 37 if( !::GetUserName( usr, &siz ) ) > 38 ki_strcpy( usr, "Default" ); > 39 m_Ini.setFileName( "Noah.ini" ); > 40 m_Ini.setSection( usr ); > 41 > 42 //-- 解凍用設定は全部ロードしておく > 43 load( Melt ); > 44 } > 45 > 46 //----------------------------------------------// > 47 //------------ 設定の load & save --------------// > 48 //----------------------------------------------// > 49 > 50 typedef bool (WINAPI * XT_IA)(); > 51 typedef void (WINAPI * XT_LS)(bool*,bool*); > 52 typedef void (WINAPI * XT_SS)(bool,bool); > 53 typedef void (WINAPI * XT_AS)(bool*); > 54 typedef void (WINAPI * XT_LSEX)(const char*,bool*); > 55 typedef void (WINAPI * XT_SSEX)(const char*,bool); > 56 > 57 void CNoahConfigManager::load( loading_flag what ) > 58 { > 59 if( (what & Mode) && !(m_Loaded & Mode) ) //----------- モード > 60 { > 61 m_Mode = m_Ini.getInt( "Mode", 2 ) & 3; > 62 m_MiniBoot = m_Ini.getBool( "MiniBoot", false ); > 63 m_OneExt = m_Ini.getBool( "OneExt", false ); > 64 m_ZeroExt = m_Ini.getBool( "NoExt", false ); > 65 m_MbLim = max( 1, m_Ini.getInt( "MultiBootLimit", 4 ) ); > 66 } > 67 if( (what & Melt) && !(m_Loaded & Melt) ) //----------- 解凍 > 68 { > 69 const char* x = m_Ini.getStr( "MDir", kiPath( kiPath::Dsk ) ); > 70 m_MDirSm = (*x=='@'); > 71 m_MDir = (*x=='@') ? x+1 : x; > 72 const int m = m_Ini.getInt( "MkDir", 2 ); > 73 m_MNoNum = ( m>=16 ); > 74 m_MkDir = ( m&3 ); > 75 m_Kill = m_Ini.getStr( "Kill", "" ); > 76 } > 77 if( (what & Compress) && !(m_Loaded & Compress) ) //--- 圧縮 > 78 { > 79 const char* x = m_Ini.getStr( "CDir", kiPath( kiPath::Dsk ) ); > 80 m_CDirSm = (*x=='@'); > 81 m_CDir = (*x=='@') ? x+1 : x; > 82 m_CExt = m_Ini.getStr( "CExt", "zip" ); > 83 m_CMhd = m_Ini.getStr( "CMhd", "7-zip" ); > 84 } > 85 if( (what & Shell) && !(m_Loaded & Shell) ) //---------- ショートカット > 86 > 87 > 88 { > 89 m_OldVer = m_Ini.getBool( "OldAbout", false ); > 90 > 91 kiPath SndLink(kiPath::Snd),DskLink(kiPath::Dsk); > 92 SndLink += "Noah.lnk", DskLink += "Noah.lnk"; > 93 m_SCSendTo = kiSUtil::exist(SndLink); > 94 m_SCDesktop= kiSUtil::exist(DskLink); > 95 > 96 m_bShlOK = NOSHL; > 97 m_hNoahXtDLL = kiSUtil::loadLibrary( "NoahXt" ); > 98 if( m_hNoahXtDLL ) > 99 { > 100 XT_IA Init = (XT_IA)getProc( "Init" ); > 101 m_bShlOK = ( Init() ? SHLOK : NOADMIN ); > 102 XT_LS LoadSE = (XT_LS)getProc( "LoadSE" ); > 103 XT_AS LoadAssoc = (XT_AS)getProc( "LoadAS" ); > 104 XT_LSEX LoadASEx = (XT_LSEX)getProc( "LoadASEx" ); > 105 LoadSE( &m_SECmp, &m_SEExt ); > 106 LoadAssoc( m_bAsso ); > 107 LoadASEx( "7z\0", &m_bAsso[12] ); > 108 } > 109 } > 110 if( (what & OpenDir) && !(m_Loaded & OpenDir) ) //------ フォルダオープン > 111 { > 112 m_MODir = m_Ini.getBool( "MODir", true ); > 113 m_CODir = m_Ini.getBool( "CODir", true ); > 114 m_OpenBy = m_Ini.getStr( "OpenBy", kiPath(kiPath::Win)+"explorer > 115 } > 116 > 117 m_Loaded |= what; > 118 } > 119 > 120 void CNoahConfigManager::save() > 121 { > 122 kiStr tmp; > 123 > 124 //-- モード > 125 m_Ini.putInt( "Mode", m_Mode ); > 126 //-- 解凍 > 127 tmp = m_MDirSm ? "@" : "", tmp+= m_MDir; > 128 m_Ini.putStr( "MDir", tmp ); > 129 m_Ini.putInt( "MkDir", m_MkDir+(m_MNoNum?16:0) ); > 130 //-- 圧縮 > 131 tmp = m_CDirSm ? "@" : "", tmp+= m_CDir; > 132 m_Ini.putStr( "CDir", tmp ); > 133 m_Ini.putStr( "CExt", m_CExt ); > 134 m_Ini.putStr( "CMhd", m_CMhd ); > 135 //-- ショートカット > 136 kiPath SndLink(kiPath::Snd); SndLink += "Noah.lnk"; > 137 kiPath DskLink(kiPath::Dsk); DskLink += "Noah.lnk"; > 138 if( m_SCSendTo ) > 139 { > 140 if( !kiSUtil::exist(SndLink) ) > 141 kiSUtil::createShortCut( kiPath(kiPath::Snd), "Noah" ); > 142 } > 143 else > 144 ::DeleteFile(SndLink); > 145 if( m_SCDesktop ) > 146 { > 147 if( !kiSUtil::exist(DskLink) ) > 148 kiSUtil::createShortCut( kiPath(kiPath::Dsk), "Noah" ); > 149 } > 150 else > 151 ::DeleteFile(DskLink); > 152 //-- 関連づけ・シェルエクステンション > 153 if( m_bShlOK ) > 154 { > 155 XT_SS SaveSE = (XT_SS)getProc( "SaveSE" ); > 156 XT_AS SaveAssoc = (XT_AS)getProc( "SaveAS" ); > 157 XT_SSEX SaveASEx = (XT_SSEX)getProc( "SaveASEx" ); > 158 SaveSE( m_SECmp, m_SEExt ); > 159 SaveAssoc( m_bAsso ); > 160 SaveASEx( "7z\0", m_bAsso[12] ); > 161 } > 162 //-- フォルダオープン > 163 m_Ini.putBool("MODir", m_MODir ); > 164 m_Ini.putBool("CODir", m_CODir ); > 165 } > 166 > 167 void CNoahConfigManager::dialog() > 168 { > 169 CNoahConfigDialog dlg; > 170 dlg.createModeless( NULL ); > 171 > 172 app()->setMainWnd( &dlg ); > 173 > 174 if( dlg.isAlive() ) > 175 kiWindow::msgLoop(); > 176 } > 177 > 178 FARPROC CNoahConfigManager::getProc( const char* name ) > 179 { > 180 return ::GetProcAddress( m_hNoahXtDLL, name ); > 181 } > 182 > 183 //----------------------------------------------// > 184 //--------------- ダイアログ関係 ---------------// > 185 //----------------------------------------------// > 186 > 187 ///////// 初期化 ///////////// > 188 > 189 #define IDI_LZH 101 > 190 #define IDI_ZIP 102 > 191 #define IDI_CAB 103 > 192 #define IDI_RAR 104 > 193 #define IDI_TAR 105 > 194 #define IDI_YZ1 106 > 195 #define IDI_GCA 107 > 196 #define IDI_ARJ 108 > 197 #define IDI_BGA 109 > 198 #define IDI_ACE 110 > 199 #define IDI_OTH 111 > 200 #define IDI_JAK 112 > 201 > 202 #define icon_is(_x) { if( mycnf().m_hNoahXtDLL ) setIcon( ::LoadIcon( mycnf().m_ > 203 CNoahConfigDialog::CCmprPage::CCmprPage() : kiPropSheetPage( IDD_CMPCFG > 204 CNoahConfigDialog::CMeltPage::CMeltPage() : kiPropSheetPage( IDD_MLTCFG > 205 CNoahConfigDialog::CWinXPage::CWinXPage() : kiPropSheetPage( IDD_WINCFG > 206 CNoahConfigDialog::CInfoPage::CInfoPage() : kiPropSheetPage( IDD_INFCFG > 207 #undef icon_is > 208 > 209 CNoahConfigDialog::CNoahConfigDialog() > 210 { > 211 //-- [icon] Noahのプロパティ > 212 m_Header.dwFlags |= PSH_PROPTITLE | PSH_USEICONID; > 213 m_Header.pszIcon = MAKEINTRESOURCE( IDI_MAIN ); > 214 m_Header.pszCaption = "Noah"; > 215 > 216 //-- アクセラレータをセット > 217 loadAccel( IDR_ACCEL ); > 218 > 219 //-- ページをどかどかと追加 > 220 m_Pages.add( new CCmprPage ); > 221 m_Pages.add( new CMeltPage ); > 222 m_Pages.add( new CWinXPage ); > 223 m_Pages.add( new CInfoPage ); > 224 } > 225 > 226 BOOL CNoahConfigDialog::onInit() > 227 { > 228 //-- DnD ON, 前面へ > 229 ::DragAcceptFiles( hwnd(), TRUE ); > 230 setFront( hwnd() ); > 231 return FALSE; > 232 } > 233 > 234 ///////// 各種コマンド ///////////// > 235 > 236 void CNoahConfigDialog::onCommand( UINT id ) > 237 { > 238 //-- アクセラレータトラップ > 239 if( id == IDA_HELP ) onHelp(); > 240 else if( id == IDA_MYDIR ) myapp().open_folder( kiPath( kiPath::Exe > 241 } > 242 > 243 void CNoahConfigDialog::onHelp() > 244 { > 245 kiPath exepos( kiPath::Exe ); > 246 > 247 //-- exeと同じ箇所にあるmanual.htmを起動 > 248 kiPath hlp(exepos); hlp+="manual.htm"; > 249 if( kiSUtil::exist(hlp) ) > 250 ::ShellExecute( hwnd(), NULL, hlp, NULL, NULL, SW_MAXIMIZE ); > 251 else > 252 { > 253 //-- 無ければreadme.txtを > 254 hlp=exepos; hlp+="readme.txt"; > 255 if( kiSUtil::exist(hlp) ) > 256 ::ShellExecute( hwnd(), NULL, hlp, NULL, NULL, SW_SHOWDE > 257 } > 258 } > 259 > 260 void CNoahConfigDialog::onDrop( HDROP hdrop ) > 261 { > 262 //-- ダイアログへのドラッグ&ドロップ > 263 sendOK2All(); > 264 > 265 //-- 途中で邪魔にならないように、消える > 266 ::ShowWindow( hwnd(), SW_HIDE ); > 267 > 268 char str[MAX_PATH]; > 269 StrArray reallist; > 270 cCharArray dummy; > 271 > 272 unsigned long max = ::DragQueryFile( hdrop, 0xffffffff, NULL, 0 ); > 273 for( unsigned int i=0; i!=max; i++ ) > 274 { > 275 ::DragQueryFile( hdrop, i, str, MAX_PATH ); > 276 reallist.add( kiStr(str) ); > 277 } > 278 for( i=0; i!=max; i++ ) > 279 dummy.add( (const char*)reallist[i] ); > 280 myapp().do_files( dummy, NULL ); > 281 > 282 // 復帰 > 283 ::DragFinish( hdrop ); > 284 ::ShowWindow( hwnd(), SW_SHOW ); > 285 } > 286 > 287 ///////// 終了時処理など ///////////// > 288 > 289 void CNoahConfigDialog::shift_and_button() > 290 { > 291 if( app()->keyPushed( VK_SHIFT ) ) > 292 { > 293 app()->setMainWnd( NULL ); > 294 myapp().do_cmdline(); > 295 } > 296 } > 297 > 298 bool CNoahConfigDialog::onOK() > 299 { > 300 onApply(); > 301 ::PostQuitMessage( 0 ); > 302 return true; > 303 } > 304 > 305 void CNoahConfigDialog::onApply() > 306 { > 307 mycnf().save(); > 308 shift_and_button(); > 309 } > 310 > 311 bool CNoahConfigDialog::onCancel() > 312 { > 313 sendOK2All(); > 314 ::ShowWindow( hwnd(), SW_HIDE ); > 315 shift_and_button(); > 316 ::PostQuitMessage( 0 ); > 317 return true; > 318 } > 319 > 320 ///////// 圧縮設定・解凍設定の共通部分 ///////////// > 321 > 322 static void dirinit( kiDialog* dlg, bool same, bool open, const char* dir ) > 323 { > 324 dlg->sendMsgToItem( same ? IDC_DDIR1 : IDC_DDIR2 , BM_SETCHECK, TRUE ); > 325 if( open ) > 326 dlg->sendMsgToItem( IDC_ODIR , BM_SETCHECK, TRUE ); > 327 dlg->sendMsgToItem( IDC_DDIR , WM_SETTEXT , 0, (LPARAM)dir ); > 328 } > 329 > 330 static void dirok( kiDialog* dlg, bool& same, bool& open, kiPath& dir ) > 331 { > 332 same = ( BST_CHECKED==dlg->sendMsgToItem( IDC_DDIR1, BM_GETCHECK ) ); > 333 open = ( BST_CHECKED==dlg->sendMsgToItem( IDC_ODIR, BM_GETCHECK ) ); > 334 static char str[MAX_PATH]; > 335 dlg->sendMsgToItem( IDC_DDIR, WM_GETTEXT, MAX_PATH, (LPARAM)str ); > 336 dir = str; > 337 } > 338 > 339 static bool dirdlg( kiDialog* dlg, UINT msg, WPARAM wp ) > 340 { > 341 if( msg==WM_COMMAND && LOWORD(wp)==IDC_REF ) > 342 { > 343 kiSUtil::getFolderDlgOfEditBox( > 344 dlg->item(IDC_DDIR), dlg->hwnd(), kiStr().loadRsrc(IDS_C > 345 return true; > 346 } > 347 return false; > 348 } > 349 > 350 ///////// 圧縮設定 ///////////// > 351 > 352 BOOL CNoahConfigDialog::CCmprPage::onInit() > 353 { > 354 // 圧縮先フォルダ > 355 dirinit( this, mycnf().cdirsm(), mycnf().codir(), mycnf().cdir() ); > 356 > 357 // 動作モード > 358 sendMsgToItem( IDC_MODE1 + mycnf().mode(), BM_SETCHECK, TRUE ); > 359 > 360 // 圧縮形式 > 361 correct( mycnf().cext(), true ); > 362 int ind=sendMsgToItem( IDC_CMPMHD, CB_FINDSTRINGEXACT, -1, (LPARAM)(cons > 363 if( ind!=CB_ERR ) > 364 sendMsgToItem( IDC_CMPMHD, CB_SETCURSEL, ind ); > 365 > 366 // ツールチップ > 367 m_tooltip = ::CreateWindowEx( > 368 0, TOOLTIPS_CLASS, NULL, TTS_ALWAYSTIP, > 369 CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, > 370 hwnd(), NULL, app()->inst(), NULL ); > 371 SetUpToolTip(); > 372 > 373 ::SetFocus(hwnd()); > 374 return TRUE; > 375 } > 376 > 377 bool CNoahConfigDialog::CCmprPage::onOK() > 378 { > 379 // 圧縮先フォルダ > 380 dirok( this, mycnf().m_CDirSm, mycnf().m_CODir, mycnf().m_CDir ); > 381 > 382 // 動作モード > 383 for( int i=0; i!=4; i++ ) > 384 if( BST_CHECKED==sendMsgToItem( IDC_MODE1 + i, BM_GETCHECK ) ) > 385 { mycnf().m_Mode = i; break; } > 386 > 387 // 圧縮形式 > 388 char str[200]=""; > 389 sendMsgToItem( IDC_CMPEXT, CB_GETLBTEXT, sendMsgToItem( IDC_CMPEXT, CB_G > 390 if( *str ) > 391 { > 392 mycnf().m_CExt = str; > 393 sendMsgToItem( IDC_CMPMHD, CB_GETLBTEXT, sendMsgToItem( IDC_CMPM > 394 mycnf().m_CMhd = str; > 395 } > 396 > 397 onCancel(); // 終了処理 > 398 return true; > 399 } > 400 > 401 bool CNoahConfigDialog::CCmprPage::onCancel() > 402 { > 403 // 終了処理 > 404 ::DestroyWindow( m_tooltip ); > 405 return true; > 406 } > 407 > 408 void CNoahConfigDialog::CCmprPage::SetUpToolTip() > 409 { > 410 char ext[200]=""; > 411 sendMsgToItem( IDC_CMPEXT, CB_GETLBTEXT, sendMsgToItem( IDC_CMPEXT, CB_G > 412 char mhd[200]=""; > 413 sendMsgToItem( IDC_CMPMHD, CB_GETLBTEXT, sendMsgToItem( IDC_CMPMHD, CB_G > 414 > 415 TOOLINFO ti = {sizeof(TOOLINFO)}; > 416 ti.uFlags = TTF_SUBCLASS; > 417 { > 418 ti.uId = 0; > 419 ti.hwnd = item(IDC_CMPEXT); > 420 ::GetClientRect( item(IDC_CMPEXT), &ti.rect ); > 421 SendMessage( m_tooltip, TTM_DELTOOL, 0, (LPARAM)&ti ); > 422 if( *ext ) > 423 { > 424 ti.lpszText = ext; > 425 SendMessage( m_tooltip, TTM_ADDTOOL, 0, (LPARAM)&ti ); > 426 } > 427 } > 428 { > 429 ti.uId = 1; > 430 ti.hwnd = item(IDC_CMPMHD); > 431 ::GetClientRect( item(IDC_CMPMHD), &ti.rect ); > 432 SendMessage( m_tooltip, TTM_DELTOOL, 0, (LPARAM)&ti ); > 433 if( *mhd ) > 434 { > 435 ti.lpszText = mhd; > 436 SendMessage( m_tooltip, TTM_ADDTOOL, 0, (LPARAM)&ti ); > 437 } > 438 } > 439 } > 440 > 441 BOOL CALLBACK CNoahConfigDialog::CCmprPage::proc( UINT msg, WPARAM wp, LPARAM lp > 442 { > 443 if( dirdlg( this, msg, wp ) ) > 444 return TRUE; > 445 > 446 if( msg==WM_COMMAND && HIWORD(wp)==CBN_SELCHANGE && LOWORD(wp)==IDC_CMPE > 447 { > 448 char str[200]=""; > 449 sendMsgToItem( IDC_CMPEXT, CB_GETLBTEXT, sendMsgToItem( IDC_CMPE > 450 if( *str ) > 451 correct( str, false ); > 452 SetUpToolTip(); > 453 return TRUE; > 454 } > 455 else if( msg==WM_COMMAND && HIWORD(wp)==CBN_SELCHANGE && LOWORD(wp)==IDC > 456 { > 457 SetUpToolTip(); > 458 } > 459 return FALSE; > 460 } > 461 > 462 void CNoahConfigDialog::CCmprPage::correct( const char* ext, bool first ) > 463 { > 464 cCharArray extl; > 465 StrArray mhdl; > 466 int mhdef; > 467 myarc().get_cmpmethod( ext, mhdef, mhdl, first, &extl ); > 468 > 469 if( first ) > 470 for( unsigned int i=0; i!=extl.len(); i++ ) > 471 sendMsgToItem( IDC_CMPEXT, CB_ADDSTRING, 0, (LPARAM)extl > 472 sendMsgToItem( IDC_CMPEXT, CB_SELECTSTRING, 0, (LPARAM)ext ); > 473 > 474 sendMsgToItem( IDC_CMPMHD, CB_RESETCONTENT ); > 475 for( unsigned int j=0; j!=mhdl.len(); j++ ) > 476 sendMsgToItem( IDC_CMPMHD, CB_ADDSTRING, 0, (LPARAM)(const char* > 477 sendMsgToItem( IDC_CMPMHD, CB_SETCURSEL, mhdef ); > 478 } > 479 > 480 > 481 ///////// 解凍設定 ///////////// > 482 > 483 BOOL CNoahConfigDialog::CMeltPage::onInit() > 484 { > 485 // 解凍先フォルダ > 486 dirinit( this, mycnf().mdirsm(), mycnf().modir(), mycnf().mdir() ); > 487 > 488 // フォルダ自動生成 > 489 if( mycnf().mkdir()!=0 ) > 490 sendMsgToItem( IDC_MKDIR ,BM_SETCHECK, TRUE ); > 491 if( mycnf().mkdir()==1 ) > 492 sendMsgToItem( IDC_MKDIR1,BM_SETCHECK, TRUE ); > 493 if( mycnf().mkdir()==2 ) > 494 sendMsgToItem( IDC_MKDIR2,BM_SETCHECK, TRUE ); > 495 if( mycnf().mnonum() ) > 496 sendMsgToItem( IDC_MKDIR3,BM_SETCHECK, TRUE ); > 497 correct(); > 498 > 499 return FALSE; > 500 } > 501 > 502 bool CNoahConfigDialog::CMeltPage::onOK() > 503 { > 504 // 解凍先フォルダ > 505 dirok( this, mycnf().m_MDirSm, mycnf().m_MODir, mycnf().m_MDir ); > 506 > 507 // フォルダ自動生成 > 508 mycnf().m_MNoNum = ( BST_CHECKED==sendMsgToItem( IDC_MKDIR3, BM_GETCHECK > 509 if( BST_CHECKED!=sendMsgToItem( IDC_MKDIR ,BM_GETCHECK ) ) > 510 mycnf().m_MkDir = 0; > 511 else > 512 { > 513 if( BST_CHECKED==sendMsgToItem( IDC_MKDIR1 ,BM_GETCHECK ) ) > 514 mycnf().m_MkDir = 1; > 515 else if( BST_CHECKED==sendMsgToItem( IDC_MKDIR2 ,BM_GETCHECK ) ) > 516 mycnf().m_MkDir = 2; > 517 else > 518 mycnf().m_MkDir = 3; > 519 } > 520 return true; > 521 } > 522 > 523 BOOL CALLBACK CNoahConfigDialog::CMeltPage::proc( UINT msg, WPARAM wp, LPARAM lp > 524 { > 525 if( dirdlg( this, msg, wp ) ) > 526 return TRUE; > 527 > 528 if( msg==WM_COMMAND ) > 529 if( LOWORD(wp)==IDC_MKDIR || LOWORD(wp)==IDC_MKDIR1 ) > 530 { > 531 correct(); > 532 return TRUE; > 533 } > 534 > 535 return FALSE; > 536 } > 537 > 538 void CNoahConfigDialog::CMeltPage::correct() > 539 { > 540 BOOL _mk = ( BST_CHECKED==sendMsgToItem( IDC_MKDIR ,BM_GETCHECK ) ); > 541 BOOL _1f = ( BST_CHECKED==sendMsgToItem( IDC_MKDIR1,BM_GETCHECK ) ); > 542 ::EnableWindow( ::GetDlgItem(hwnd(),IDC_MKDIR1), _mk ); > 543 ::EnableWindow( ::GetDlgItem(hwnd(),IDC_MKDIR2), _mk && !_1f ); > 544 ::EnableWindow( ::GetDlgItem(hwnd(),IDC_MKDIR3), _mk ); > 545 if( _1f ) > 546 sendMsgToItem( IDC_MKDIR2, BM_SETCHECK, TRUE ); > 547 } > 548 > 549 ///////// Windows拡張設定 ///////////// > 550 > 551 BOOL CNoahConfigDialog::CWinXPage::onInit() > 552 { > 553 if( !mycnf().m_bShlOK ) > 554 for( UINT i=IDC_LZH; i<=IDC_MLT; i++ ) > 555 ::EnableWindow( item(i), FALSE ); > 556 else > 557 { > 558 for( UINT i=IDC_LZH; i<=IDC_7Z; i++ ) > 559 if( mycnf().m_bAsso[i-IDC_LZH] ) > 560 sendMsgToItem( i, BM_SETCHECK, TRUE ); > 561 if( mycnf().m_SECmp ) > 562 sendMsgToItem( IDC_CMP ,BM_SETCHECK, TRUE ); > 563 if( mycnf().m_SEExt ) > 564 sendMsgToItem( IDC_MLT ,BM_SETCHECK, TRUE ); > 565 } > 566 if( !mycnf().m_bShlOK || !myarc().b2e_enabled() ) > 567 { > 568 ::ShowWindow( item(IDC_ASS), SW_HIDE ); > 569 ::EnableWindow( item(IDC_ASS), FALSE ); > 570 } > 571 if( mycnf().m_bShlOK!=1 ) > 572 ::ShowWindow( item(IDC_NOADMIN), SW_HIDE ); > 573 if( mycnf().m_SCSendTo ) > 574 sendMsgToItem( IDC_SND, BM_SETCHECK, TRUE ); > 575 if( mycnf().m_SCDesktop ) > 576 sendMsgToItem( IDC_DSK, BM_SETCHECK, TRUE ); > 577 > 578 return FALSE; > 579 } > 580 > 581 bool CNoahConfigDialog::CWinXPage::onOK() > 582 { > 583 mycnf().m_SCSendTo = ( BST_CHECKED==sendMsgToItem( IDC_SND ,BM_GETCHECK > 584 mycnf().m_SCDesktop= ( BST_CHECKED==sendMsgToItem( IDC_DSK ,BM_GETCHECK > 585 for( UINT i=IDC_LZH; i<=IDC_7Z; i++ ) > 586 mycnf().m_bAsso[i-IDC_LZH] = ( BST_CHECKED==sendMsgToItem( i, BM > 587 mycnf().m_SECmp = ( BST_CHECKED==sendMsgToItem( IDC_CMP ,BM_GETCHECK ) ) > 588 mycnf().m_SEExt = ( BST_CHECKED==sendMsgToItem( IDC_MLT ,BM_GETCHECK ) ) > 589 > 590 return true; > 591 } > 592 > 593 BOOL CALLBACK CNoahConfigDialog::CWinXPage::proc( UINT msg, WPARAM wp, LPARAM lp > 594 { > 595 if( msg==WM_COMMAND ) > 596 if( LOWORD(wp)==IDC_ASS ) > 597 { > 598 CAssPage x( hwnd() ); > 599 return TRUE; > 600 } > 601 return FALSE; > 602 } > 603 > 604 CNoahConfigDialog::CAssPage::CAssPage( HWND parent ) : kiDialog( IDD_ANYASS ) > 605 { > 606 doModal( parent ); > 607 } > 608 > 609 BOOL CNoahConfigDialog::CAssPage::onInit() > 610 { > 611 typedef void (WINAPI * XT_LAX)(const char*,bool*); > 612 XT_LAX LoadASEx = (XT_LAX)mycnf().getProc( "LoadASEx" ); > 613 static const char* const ext_list[] = > 614 { "lzh","zip","cab","rar","tar","yz1","gca","arj","gza","ace","c > 615 > 616 // b2e検索 > 617 kiPath wild( kiPath::Exe ); > 618 wild += "b2e\\*.b2e"; > 619 kiFindFile find; > 620 find.begin( wild ); > 621 > 622 char* first_dot; > 623 bool state; > 624 HWND lst[] = { item(IDC_NASSOC), item(IDC_ASSOC) }; > 625 > 626 for( WIN32_FIND_DATA fd; find.next(&fd); ) > 627 { > 628 // # 付きは圧縮専用 > 629 if( fd.cFileName[0] == '#' ) > 630 continue; > 631 > 632 // 拡張子を切り出し > 633 ::CharLower( fd.cFileName ); > 634 first_dot = const_cast<char*>(kiPath::ext_all(fd.cFileName)-1); > 635 *first_dot = '\0'; > 636 > 637 // 基本形式ならここではねる > 638 for( int i=0; i<sizeof(ext_list)/sizeof(const char*); i++ ) > 639 if( 0==ki_strcmp( ext_list[i], fd.cFileName ) ) > 640 break; > 641 if( i != sizeof(ext_list)/sizeof(const char*) ) > 642 continue; > 643 > 644 // 関連づけ済みかどうかチェック > 645 LoadASEx( fd.cFileName, &state ); > 646 > 647 // 適切な方のリストへ追加 > 648 *first_dot = '.'; > 649 *const_cast<char*>(kiPath::ext(fd.cFileName)-1) = '\0'; > 650 ::SendMessage( lst[state?1:0], LB_SETITEMDATA, > 651 ::SendMessage( lst[state?1:0], LB_ADD > 652 state?1:0 ); > 653 } > 654 > 655 return FALSE; > 656 } > 657 > 658 BOOL CALLBACK CNoahConfigDialog::CAssPage::proc( UINT msg, WPARAM wp, LPARAM lp > 659 { > 660 if( msg==WM_COMMAND ) > 661 { > 662 char str[300]; > 663 DWORD dat; > 664 HWND from=item(IDC_NASSOC), to=item(IDC_ASSOC); > 665 > 666 switch( LOWORD(wp) ) > 667 { > 668 case IDC_DEL: > 669 from=item(IDC_ASSOC), to=item(IDC_NASSOC); > 670 case IDC_ADD:{ > 671 int end = ::SendMessage( from, LB_GETCOUNT, 0, 0 ); > 672 for( int i=0; i<end; i++ ) > 673 if( ::SendMessage( from, LB_GETSEL, i, 0 ) ) > 674 { > 675 // 取得 > 676 ::SendMessage( from, LB_GETTEXT, i, (LPA > 677 dat = ::SendMessage( from, LB_GETITEMDAT > 678 // コピー > 679 ::SendMessage( to, LB_SETITEMDATA, > 680 ::SendMessage > 681 dat ); > 682 // 削除 > 683 ::SendMessage( from, LB_DELETESTRING, i, > 684 i--, end--; > 685 } > 686 > 687 }return TRUE; > 688 } > 689 } > 690 return FALSE; > 691 } > 692 > 693 static void crack_str( char* p ) > 694 { > 695 for( ; *p; p=kiStr::next(p) ) > 696 if( *p=='.' ) > 697 *p++ = '\0'; > 698 *++p = '\0'; > 699 } > 700 > 701 bool CNoahConfigDialog::CAssPage::onOK() > 702 { > 703 typedef void (WINAPI * XT_SAX)(const char*,bool); > 704 XT_SAX SaveASEx = (XT_SAX)mycnf().getProc( "SaveASEx" ); > 705 > 706 char str[301]; > 707 int i, nc = sendMsgToItem( IDC_NASSOC, LB_GETCOUNT ), > 708 ac = sendMsgToItem( IDC_ASSOC, LB_GETCOUNT ); > 709 > 710 // 解除 > 711 for( i=0; i<nc; i++ ) > 712 if( sendMsgToItem( IDC_NASSOC, LB_GETITEMDATA, i ) ) > 713 { > 714 sendMsgToItem( IDC_NASSOC, LB_GETTEXT, i, (LPARAM)str ); > 715 crack_str( str ); > 716 SaveASEx( str, false ); > 717 } > 718 // 設定 > 719 for( i=0; i<ac; i++ ) > 720 if( !sendMsgToItem( IDC_ASSOC, LB_GETITEMDATA, i ) ) > 721 { > 722 sendMsgToItem( IDC_ASSOC, LB_GETTEXT, i, (LPARAM)str ); > 723 crack_str( str ); > 724 SaveASEx( str, true ); > 725 } > 726 > 727 return true; > 728 } > 729 > 730 ///////// その他設定 ///////////// > 731 > 732 BOOL CNoahConfigDialog::CInfoPage::onInit() > 733 { > 734 kiStr ver; > 735 myarc().get_version( ver ); > 736 sendMsgToItem( IDC_VERSION, WM_SETTEXT, 0, (LPARAM)(const char*)ver ); > 737 return FALSE; > 738 }

Added NoahCM.h version [e17b66ef630a3999]

> 1 // NoahCM.h > 2 //-- CNoahConfigManager -- save / load / modify the setting of 'Noah' -- > 3 > 4 #ifndef AFX_NOAHCM_H__ACE475C1_D925_4F9E_BDCA_783B921E6FD5__INCLUDED_ > 5 #define AFX_NOAHCM_H__ACE475C1_D925_4F9E_BDCA_783B921E6FD5__INCLUDED_ > 6 > 7 class CNoahConfigManager; > 8 > 9 class CNoahConfigDialog : public kiPropSheet > 10 { > 11 public: > 12 class CCmprPage : public kiPropSheetPage > 13 { > 14 public: > 15 CCmprPage(); > 16 private: > 17 BOOL onInit(); > 18 bool onOK(); > 19 bool onCancel(); > 20 BOOL CALLBACK proc( UINT msg, WPARAM wp, LPARAM lp ); > 21 void correct( const char* ext, bool first ); > 22 void SetUpToolTip(); > 23 private: > 24 HWND m_tooltip; > 25 }; > 26 class CMeltPage : public kiPropSheetPage > 27 { > 28 public: > 29 CMeltPage(); > 30 private: > 31 BOOL onInit(); > 32 bool onOK(); > 33 BOOL CALLBACK proc( UINT msg, WPARAM wp, LPARAM lp ); > 34 void correct(); > 35 }; > 36 class CWinXPage : public kiPropSheetPage > 37 { > 38 public: > 39 CWinXPage(); > 40 private: > 41 BOOL onInit(); > 42 BOOL CALLBACK proc( UINT msg, WPARAM wp, LPARAM lp ); > 43 bool onOK(); > 44 }; > 45 class CAssPage : public kiDialog > 46 { > 47 public: > 48 CAssPage( HWND parent ); > 49 private: > 50 BOOL onInit(); > 51 BOOL CALLBACK proc( UINT msg, WPARAM wp, LPARAM lp ); > 52 bool onOK(); > 53 }; > 54 class CInfoPage : public kiPropSheetPage > 55 { > 56 public: > 57 CInfoPage(); > 58 private: > 59 BOOL onInit(); > 60 }; > 61 > 62 public: > 63 CNoahConfigDialog(); > 64 > 65 private: > 66 bool onOK(); > 67 bool onCancel(); > 68 void onApply(); > 69 void onHelp(); > 70 void onCommand( UINT id ); > 71 BOOL onInit(); > 72 void onDrop( HDROP hdrop ); > 73 static void shift_and_button(); > 74 }; > 75 > 76 enum loading_flag > 77 { > 78 Mode = 1, > 79 Melt = 2, > 80 Compress= 4, > 81 Shell = 8, > 82 OpenDir =16, > 83 All =31, > 84 }; > 85 > 86 class CNoahConfigManager > 87 { > 88 public: //-- 操作 > 89 > 90 void init(); > 91 void load( loading_flag what ); > 92 void save(); > 93 void dialog(); > 94 > 95 public: //-- 設定項目取得用インターフェイス > 96 > 97 // Section: Mode > 98 const int mode() { return m_Mode; } // 0:圧専 1:圧優 2:解優 3:解専 > 99 const bool miniboot(){ return m_MiniBoot; } // 最小化起動? > 100 const bool oldver() { return m_OldVer; }// 古い形式でバージョン表示 > 101 const int extnum() { return m_OneExt ? 1 : m_ZeroExt ? 0 : -1; } // 書庫 > 102 const int multiboot_limit() { return m_MbLim; } // 多重起動個数制限値 > 103 // Section: Melt > 104 const kiPath& mdir() { return m_MDir; } // 解凍先 > 105 const bool mdirsm(){ return m_MDirSm; }// 同じディレクトリに解凍? > 106 const int mkdir() { return m_MkDir; } // 0:x 1:file 2:dir 3:o > 107 const bool mnonum(){ return m_MNoNum; }// 数字省略 > 108 const char* kill() { return m_Kill; }// OFFにする内蔵ルーチン > 109 // Section: Compress > 110 const kiPath& cdir() { return m_CDir; } // 圧縮先 > 111 const bool cdirsm(){ return m_CDirSm; }// 同じディレクトリに圧縮? > 112 const kiStr& cext() { return m_CExt; } // 圧縮形式 > 113 const kiStr& cmhd() { return m_CMhd; } // 圧縮メソッド > 114 // Section: Shell > 115 // Section: OpenDir > 116 const bool modir() { return m_MODir; } // 解凍後開く? > 117 const bool codir() { return m_CODir; } // 圧縮後開く? > 118 const kiStr& openby(){ return m_OpenBy; }// 開くプログラム(隠し) > 119 > 120 private: //-- 内部変数 > 121 > 122 unsigned long m_Loaded; > 123 kiIniFile m_Ini; > 124 kiStr m_UserName; > 125 HINSTANCE m_hNoahXtDLL; > 126 enum { NOSHL, NOADMIN, SHLOK } m_bShlOK; > 127 > 128 // 設定項目 > 129 int m_Mode; > 130 kiPath m_MDir, m_CDir; > 131 bool m_MODir,m_CODir,m_MDirSm,m_CDirSm; > 132 int m_MkDir; > 133 int m_MbLim; > 134 kiStr m_CExt; > 135 kiStr m_OpenBy; > 136 kiStr m_CMhd; > 137 bool m_MNoNum; > 138 bool m_SCSendTo,m_SCDesktop; > 139 kiStr m_Kill; > 140 bool m_SECmp, m_SEExt, m_bAsso[13]; > 141 bool m_MiniBoot; > 142 bool m_OldVer; > 143 bool m_OneExt, m_ZeroExt; > 144 > 145 // 関数ロード > 146 FARPROC getProc( const char* name ); > 147 > 148 public: > 149 CNoahConfigManager() > 150 { > 151 m_hNoahXtDLL = NULL; > 152 } > 153 ~CNoahConfigManager() > 154 { > 155 if( m_hNoahXtDLL ) > 156 ::FreeLibrary( m_hNoahXtDLL ); > 157 } > 158 friend class CNoahConfigDialog::CCmprPage; > 159 friend class CNoahConfigDialog::CMeltPage; > 160 friend class CNoahConfigDialog::CWinXPage; > 161 friend class CNoahConfigDialog::CInfoPage; > 162 friend class CNoahConfigDialog::CAssPage; > 163 }; > 164 > 165 #endif

Added NoahXt/NoahXt.cpp version [179bfff141b849a3]

> 1 // NoahXt.cpp > 2 // -- all of 'NoahXt.dll' (ShellExtension && Configuration of Noah) > 3 > 4 #undef WINVER > 5 #define WINVER 0x0400 > 6 #ifndef STRICT > 7 #define STRICT > 8 #endif > 9 #define INC_OLE2 > 10 #undef _WIN32_IE > 11 #define _WIN32_IE 0x0200 > 12 > 13 #include <windows.h> > 14 #include <windowsx.h> > 15 #include <shlobj.h> > 16 #include <lmaccess.h> > 17 > 18 // カレントディレクトリを安全なところに移してLoadLibrary > 19 static HMODULE safepathLoadLibrary(LPCTSTR lpFileName) > 20 { > 21 char original_cur[MAX_PATH], sys[MAX_PATH]; > 22 ::GetCurrentDirectory(MAX_PATH, original_cur); > 23 ::GetSystemDirectory(sys, MAX_PATH); > 24 ::SetCurrentDirectory(sys); > 25 HMODULE han = ::LoadLibrary(lpFileName); > 26 ::SetCurrentDirectory(original_cur); > 27 return han; > 28 } > 29 > 30 //------------------------------------------------------- > 31 //-- Noah Config API ------------------------------------ > 32 //------------------------------------------------------- > 33 > 34 > 35 > 36 bool WINAPI Init(); > 37 void WINAPI LoadSE( bool* a, bool* x ); > 38 void WINAPI SaveSE( bool a, bool x ); > 39 void WINAPI LoadAS( bool asso[] ); > 40 void WINAPI SaveAS( bool asso[] ); > 41 void WINAPI LoadASEx( const char* ext, bool* x ); > 42 void WINAPI SaveASEx( const char* ext, bool x ); > 43 > 44 > 45 > 46 //------------------------------------------------------- > 47 //-- グローバル変数 ------------------------------------- > 48 //------------------------------------------------------- > 49 > 50 > 51 > 52 char g_szNoah[MAX_PATH]; // Where is Noah ? > 53 char g_szDLL[MAX_PATH]; // What's my name ? > 54 bool g_bJpn; // am I in Japanese Mode ? > 55 bool g_isNT; // is Windows NT/2000 ? > 56 int g_cRef; // reference counter > 57 bool g_bChanged; // association changed ? > 58 > 59 > 60 > 61 //------------------------------------------------------- > 62 //-- GUID {953AFAE9-C2A9-4674-9811-D7E281B001E1} -------- > 63 //------------------------------------------------------- > 64 > 65 > 66 > 67 static const GUID CLSID_NoahXt = > 68 { 0x953afae9, 0xc2a9, 0x4674, { 0x98, 0x11, 0xd7, 0xe2, 0x81, 0xb0, 0x1, > 69 static const char* ProgID_NoahXt = "NoahXt"; > 70 > 71 > 72 > 73 //-------------------------------------------------------- > 74 //-- シェルエクステンション・本体 -------------------------- > 75 //-------------------------------------------------------- > 76 > 77 > 78 > 79 class noahXt : public IContextMenu, IShellExtInit > 80 { > 81 public: > 82 noahXt() { m_szDir[0]=0; > 83 ~noahXt() { if( m_pDataObj > 84 STDMETHODIMP_(ULONG) AddRef() { return (++m_cRef); } > 85 STDMETHODIMP_(ULONG) Release() { if( --m_cRef )return m_cRef; delete th > 86 STDMETHODIMP QueryInterface( REFIID riid, void** ppv ) > 87 { > 88 *ppv = NULL; > 89 AddRef(); > 90 if( IsEqualIID( riid, IID_IUnknown ) || IsEqualIID( riid > 91 *ppv = (IShellExtInit*)this; > 92 else if( IsEqualIID( riid, IID_IContextMenu ) ) > 93 *ppv = (IContextMenu*)this; > 94 else > 95 { > 96 Release(); > 97 return E_NOINTERFACE; > 98 } > 99 return NOERROR; > 100 } > 101 STDMETHODIMP Initialize( const ITEMIDLIST* pF, IDataObject* pD, HKEY ) > 102 { > 103 ::SHGetPathFromIDList( pF, m_szDir ); > 104 if( m_pDataObj )m_pDataObj->Release(); > 105 if( pD ) (m_pDataObj=pD)->AddRef(); > 106 return NOERROR; > 107 } > 108 > 109 #define CMPR_CMD_E ("Com&press Here") > 110 #define EXTR_CMD_E ("E&xtract Here") > 111 #define CMPR_CMD (g_bJpn ? "ここに圧縮(&P)" : CMPR_CMD_E) > 112 #define EXTR_CMD (g_bJpn ? "ここに解凍(&X)" : EXTR_CMD_E) > 113 #define CMPR_HLP (g_bJpn ? "ファイルをNoahで圧縮します。" : "Compress These Files By Noah") > 114 #define EXTR_HLP (g_bJpn ? "ファイルをNoahで展開" : "Extract Files By Noah") > 115 > 116 // 右クリックメニューへ追加 > 117 STDMETHODIMP QueryContextMenu( HMENU h, UINT i, UINT id, UINT idLast, UI > 118 { > 119 if( (flag&0x000F)!=CMF_NORMAL && !(flag&CMF_VERBSONLY) & > 120 return NOERROR; > 121 > 122 // レジストリから設定読み込み > 123 // できれば、ここでm_bEXTに関しては拡張子判定を行いたいところ…(^^; > 124 LoadSE( &m_bCMP, &m_bEXT ); > 125 > 126 if( m_bCMP ) ::InsertMenu( h, i++, MF_STRING|MF_BYPOSITI > 127 if( m_bEXT ) ::InsertMenu( h, i++, MF_STRING|MF_BYPOSITI > 128 return MAKE_HRESULT( SEVERITY_SUCCESS, 0, id ); > 129 } > 130 // コマンド実行 > 131 STDMETHODIMP InvokeCommand( LPCMINVOKECOMMANDINFO lpcmi ) > 132 { > 133 if( 0==HIWORD(lpcmi->lpVerb) ) > 134 switch( filter_cmd( LOWORD(lpcmi->lpVerb) ) ) > 135 { > 136 case 0: return operation( "-a" ); > 137 case 1: return operation( "-x" ); > 138 } > 139 return E_INVALIDARG; > 140 } > 141 // ヘルプ文字列など > 142 STDMETHODIMP GetCommandString( UINT cmd, UINT flag, UINT*, LPSTR pszName > 143 { > 144 cmd = filter_cmd( cmd ); > 145 if( cmd==2 ) > 146 return E_FAIL; > 147 switch( flag ) > 148 { > 149 case GCS_HELPTEXT: ::lstrcpyn( pszName, cmd==0 ? CM > 150 case GCS_VERB: ::lstrcpyn( pszName, cmd==0 ? CM > 151 } > 152 return NOERROR; > 153 } > 154 private: > 155 // コマンドIDを compress=0, melt=1, else=2 にフィルタリング > 156 UINT filter_cmd( UINT i ) > 157 { > 158 if( m_bCMP )if( m_bEXT )return (i<=1 ? i : 2); > 159 else return (i==0 ? 0 > 160 else if( m_bEXT )return (i==0 ? 1 : 2); > 161 else return 2; > 162 } > 163 // Noah.exeへ渡す処理 "Compress Here" or "Extract Here" > 164 STDMETHODIMP operation( const char* opt ) > 165 { > 166 STGMEDIUM md; > 167 FORMATETC fe = {CF_HDROP, NULL, DVASPECT_CONTENT, -1, TY > 168 if( SUCCEEDED( m_pDataObj->GetData( &fe, &md ) ) ) > 169 { > 170 const HDROP& hDrop = (HDROP)md.hGlobal; > 171 const int num = ::DragQueryFile( hDrop, 0xffffff > 172 if( num ) > 173 { > 174 // main command > 175 char* cmd = new char[10 + MAX_PATH * (nu > 176 ::lstrcpy( cmd, g_szNoah ); > 177 ::lstrcat( cmd, " " ); > 178 ::lstrcat( cmd, opt ); > 179 // destdir > 180 ::lstrcat( cmd, " \"-D" ); > 181 ::lstrcat( cmd, m_szDir ); > 182 ::lstrcat( cmd, "\"" ); > 183 // filelist > 184 char str[MAX_PATH]; > 185 for( int i=0; i!=num; i++ ) > 186 { > 187 ::DragQueryFile( hDrop, i, str, > 188 ::lstrcat( cmd, " \"" ); > 189 ::lstrcat( cmd, str ); > 190 ::lstrcat( cmd, "\"" ); > 191 } > 192 // call 'Noah' > 193 ::WinExec( cmd, SW_SHOWDEFAULT ); > 194 delete [] cmd; > 195 } > 196 ::ReleaseStgMedium( &md ); > 197 } > 198 return NOERROR; > 199 } > 200 private: > 201 ULONG m_cRef; > 202 IDataObject* m_pDataObj; > 203 char m_szDir[MAX_PATH]; > 204 bool m_bCMP, m_bEXT; > 205 }; > 206 > 207 //-- クラス工場 ------------------------------------------- > 208 > 209 class noahXtClassFactory : public IClassFactory > 210 { > 211 public: > 212 noahXtClassFactory() { m_cRef = 0L; g_cRef++; } > 213 ~noahXtClassFactory() { g_cRef--; } > 214 STDMETHODIMP_(ULONG) AddRef() { return (++m_cRef); } > 215 STDMETHODIMP_(ULONG) Release() { if( --m_cRef )return m_cRef; delete th > 216 STDMETHODIMP LockServer( BOOL ) { return NOERROR; } > 217 STDMETHODIMP QueryInterface( REFIID riid, void** ppv ) > 218 { > 219 *ppv = NULL; > 220 AddRef(); > 221 if( IsEqualIID( riid, IID_IUnknown ) || IsEqualIID( riid > 222 { > 223 *ppv = (IClassFactory*)this; > 224 return NOERROR; > 225 } > 226 Release(); > 227 return E_NOINTERFACE; > 228 } > 229 STDMETHODIMP CreateInstance( IUnknown* pOuter, REFIID riid, void** ppvOb > 230 { > 231 *ppvObj = NULL; > 232 if( pOuter ) > 233 return CLASS_E_NOAGGREGATION; > 234 noahXt* pXt = new noahXt; > 235 return pXt ? pXt->QueryInterface( riid, ppvObj ) : E_OUT > 236 } > 237 private: > 238 ULONG m_cRef; > 239 }; > 240 > 241 //-- システム向けAPI --------------------------------------- > 242 > 243 extern "C" int APIENTRY > 244 DllMain( HINSTANCE inst, DWORD why, LPVOID reserved ) > 245 { > 246 if( why==DLL_PROCESS_ATTACH ) > 247 { > 248 ::GetModuleFileName( inst, g_szDLL, sizeof(g_szDLL) ); > 249 ::lstrcpy( g_szNoah, g_szDLL ); > 250 for( char *p=g_szNoah,*y=g_szNoah-1; *p; p=::CharNext(p) ) > 251 if( *p=='\\' ) > 252 y=p; > 253 ::lstrcpy( y+1, "Noah.exe" ); > 254 ::GetShortPathName( g_szNoah, g_szNoah, MAX_PATH ); > 255 > 256 OSVERSIONINFO osVer; > 257 osVer.dwOSVersionInfoSize = sizeof(osVer); > 258 ::GetVersionEx( &osVer ); > 259 g_isNT = ( osVer.dwPlatformId == VER_PLATFORM_WIN32_NT ); > 260 > 261 g_bJpn = (::GetUserDefaultLangID()==0x0411); > 262 g_cRef = 0; > 263 g_bChanged = false; > 264 } > 265 else if( why==DLL_PROCESS_DETACH ) > 266 { > 267 if( g_bChanged ) > 268 ::SHChangeNotify( SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL > 269 } > 270 return TRUE; > 271 } > 272 > 273 STDAPI DllCanUnloadNow() > 274 { > 275 return ( g_cRef==0 ? S_OK : S_FALSE ); > 276 } > 277 > 278 STDAPI DllGetClassObject( REFCLSID rclsid, REFIID riid, void** ppvOut ) > 279 { > 280 *ppvOut = NULL; > 281 if( IsEqualIID( rclsid, CLSID_NoahXt ) ) > 282 { > 283 noahXtClassFactory* p = new noahXtClassFactory; > 284 return p->QueryInterface( riid, ppvOut ); > 285 } > 286 return CLASS_E_CLASSNOTAVAILABLE; > 287 } > 288 > 289 > 290 > 291 //-------------------------------------------------------- > 292 //-------------------------------------------------------- > 293 //-------------------------------------------------------- > 294 > 295 > 296 //-- kiRegKey from K.I.LIB -------------------------// > 297 //------ 'not using kiStr && REG_SZ only' version --// > 298 > 299 > 300 class kiRegKey > 301 { > 302 public: > 303 kiRegKey() > 304 { m_hKey = NULL; } > 305 ~kiRegKey() > 306 { close(); } > 307 operator HKEY() const > 308 { return m_hKey; } > 309 bool open( HKEY parent, LPCTSTR keyname, REGSAM access ) > 310 { close(); return (ERROR_SUCCESS == ::RegOpenKeyEx( parent, keyn > 311 bool create( HKEY parent, LPCTSTR keyname, REGSAM access ) > 312 { close(); DWORD x; return (ERROR_SUCCESS == ::RegCreateKeyEx( p > 313 void close() > 314 { if( m_hKey ) ::RegCloseKey( m_hKey ); } > 315 static bool exist( HKEY parent, LPCTSTR keyname ) > 316 { HKEY k; if( ERROR_SUCCESS!=::RegOpenKeyEx( parent,keyname,0,KE > 317 bool set( LPCTSTR valname, LPCTSTR val ) > 318 { return (ERROR_SUCCESS == ::RegSetValueEx( m_hKey, valname, 0, > 319 bool get( LPCTSTR valname, char* val, DWORD siz ) > 320 { return ( ERROR_SUCCESS == RegQueryValueEx( m_hKey, valname, NU > 321 bool del( LPCTSTR valname ) > 322 { return (ERROR_SUCCESS == RegDeleteValue( m_hKey, valname )); } > 323 static void delSubKey( HKEY k, LPCTSTR n ) > 324 { > 325 if( !g_isNT ) > 326 { > 327 ::RegDeleteKey( k, n ); > 328 return; > 329 } > 330 > 331 // NT系では、サブキーのあるキーは消せないので再帰的に。 > 332 // しかもEnum中にDeleteはできない上にvector<string>等も > 333 // 封印しているためわけのわからんコードになってます。 > 334 > 335 // 消したいキーを開く > 336 HKEY k2; > 337 while( ERROR_SUCCESS == ::RegOpenKeyEx( k,n,0,KEY_ENUMERATE_SUB_ > 338 { > 339 // 1個目の子キー名を取得 > 340 char buf[200]; > 341 DWORD bs = sizeof(buf); > 342 if( ERROR_SUCCESS == ::RegEnumKeyEx( k2,0,buf,&bs,NULL,N > 343 { > 344 // あればそれを削除 > 345 delSubKey( k2, buf ); > 346 ::RegCloseKey( k2 ); > 347 } > 348 else > 349 { > 350 // なければ、消したいキーを消せる > 351 ::RegCloseKey( k2 ); > 352 ::RegDeleteKey( k, n ); > 353 return; > 354 } > 355 } > 356 } > 357 private: > 358 HKEY m_hKey; > 359 }; > 360 > 361 > 362 > 363 //-------------------------------------------------------- > 364 //-- Noahの設定用APIなど ---------------------------------- > 365 //-------------------------------------------------------- > 366 > 367 > 368 > 369 char g_szAsCmd[MAX_PATH+10]; > 370 char g_szAsIcon[MAX_PATH+10]; > 371 > 372 > 373 // 管理者権限判別 > 374 //-- IsAdmin() : very very thanks! to ardry, the author of 'meltice'. > 375 > 376 bool IsAdmin() > 377 { > 378 bool isadmin=false; > 379 > 380 //-- 9x対策のため、動的にDLLロード > 381 HINSTANCE hInstDll = safepathLoadLibrary( "NetAPI32" ); > 382 if( !hInstDll ) > 383 return false; > 384 > 385 //-- NetUserGetLocalGroupes API 取得 > 386 typedef NET_API_STATUS (NET_API_FUNCTION *PNETUSRGETLCLGRP)(LPCWSTR,wcha > 387 PNETUSRGETLCLGRP pNetUserGetLocalGroups = (PNETUSRGETLCLGRP)::GetProcAdd > 388 if( !pNetUserGetLocalGroups ) > 389 { > 390 ::FreeLibrary( hInstDll ); > 391 return false; > 392 } > 393 > 394 //-- ユーザー名取得 > 395 char userA[256]; > 396 wchar_t userW[256]; > 397 DWORD tmp = 256; > 398 ::GetUserName( userA, &tmp ); > 399 ::MultiByteToWideChar( CP_ACP, 0, userA, -1, userW, 255 ); > 400 > 401 //-- 本筋 > 402 LOCALGROUP_USERS_INFO_0* pBuf; > 403 DWORD entry; > 404 char buf[256]; > 405 > 406 if( 0 == pNetUserGetLocalGroups(NULL,userW,0,0,(BYTE**)&pBuf,-1,&entry,& > 407 { > 408 for( unsigned int i=0; i<entry; i++ ) > 409 { > 410 ::WideCharToMultiByte( CP_ACP, 0, pBuf[i].lgrui0_name, - > 411 > 412 if( 0 == ::lstrcmp( buf, "Administrators" ) ) > 413 { > 414 isadmin=true; > 415 break; > 416 } > 417 } > 418 > 419 //-- メモリ解放 > 420 typedef NET_API_STATUS (NET_API_FUNCTION * PNETAPIBUFFERFREE)(vo > 421 PNETAPIBUFFERFREE pNetApiBufferFree = (PNETAPIBUFFERFREE)::GetPr > 422 if( pNetApiBufferFree ) > 423 pNetApiBufferFree( pBuf ); > 424 } > 425 > 426 //-- DLL解放 > 427 ::FreeLibrary( hInstDll ); > 428 return isadmin; > 429 } > 430 > 431 // レジストリへの書き込み権限判定…うまくいかないらしい > 432 // > 433 //bool IsRegWritable() > 434 //{ > 435 // HKEY key; > 436 // if( ERROR_SUCCESS != // 適当なクラスキーへの書き込み権限を調べる > 437 // ::RegOpenKeyEx( HKEY_CLASSES_ROOT, "ttffile", 0, KEY_WRITE, &key > 438 // return false; > 439 // ::RegCloseKey( key ); > 440 // return true; > 441 //} > 442 > 443 //** bool Init() > 444 //** > 445 //** 設定画面用に起動するときは最初にコレを呼ぶこと。 > 446 //** false が返ってきたときは、諸事情により利用できないことを示す。 > 447 bool WINAPI Init() > 448 { > 449 ::wsprintf( g_szAsIcon, "%s,%%d", g_szDLL ); > 450 ::wsprintf( g_szAsCmd , "%s -x \"%%1\"", g_szNoah ); > 451 > 452 if( g_isNT ) > 453 if( !IsAdmin() ) > 454 // if( !IsRegWritable() ) > 455 return false; > 456 > 457 return true; > 458 } > 459 > 460 //** void LoadSE( bool* a, bool* x ) > 461 //** > 462 //** シェルエクステンションの設定を返す。 > 463 //** a: [ここに圧縮]がONか否か x: [ここに解凍]がONか否か > 464 void WINAPI LoadSE( bool* a, bool* x ) > 465 { > 466 *a = kiRegKey::exist( HKEY_CLASSES_ROOT, "CLSID\\{953AFAE9-C2A9-4674-981 > 467 *x = kiRegKey::exist( HKEY_CLASSES_ROOT, "CLSID\\{953AFAE9-C2A9-4674-981 > 468 } > 469 > 470 //** void SaveSE( bool a, bool x ) > 471 //** > 472 //** シェルエクステンションの設定を保存する。 > 473 //** a: [ここに圧縮]がONか否か x: [ここに解凍]がONか否か > 474 void WINAPI SaveSE( bool a, bool x ) > 475 { > 476 kiRegKey key, key2; > 477 > 478 if( !a && !x ) > 479 { > 480 kiRegKey::delSubKey( HKEY_CLASSES_ROOT, "CLSID\\{953AFAE9-C2A9-4 > 481 kiRegKey::delSubKey( HKEY_CLASSES_ROOT, "Folder\\shellex\\DragDr > 482 kiRegKey::delSubKey( HKEY_CLASSES_ROOT, "Drive\\shellex\\DragDro > 483 if( key.open( HKEY_CLASSES_ROOT, "Software\\Microsoft\\Windows\\ > 484 key.del( "{953AFAE9-C2A9-4674-9811-D7E281B001E1}" ); > 485 } > 486 else > 487 { > 488 // CLSID 登録 > 489 key.create( HKEY_CLASSES_ROOT, "CLSID\\{953AFAE9-C2A9-4674-9811- > 490 key.set( "", ProgID_NoahXt ); > 491 key2.create( key, "InprocServer32", KEY_WRITE ); > 492 key2.set( "", g_szDLL ); > 493 key2.set( "ThreadingModel", "Apartment" ); > 494 if(a)key2.create( key, "CShl", KEY_READ ); > 495 else kiRegKey::delSubKey( key, "CShl" ); > 496 if(x)key2.create( key, "MShl", KEY_READ ); > 497 else kiRegKey::delSubKey( key, "MShl" ); > 498 > 499 // Folder の DnD Handler として登録 > 500 key.create( HKEY_CLASSES_ROOT, "Folder\\shellex\\DragDropHandler > 501 key.set( "", "{953AFAE9-C2A9-4674-9811-D7E281B001E1}" ); > 502 // Drive の DnD Handler として登録 > 503 key.create( HKEY_CLASSES_ROOT, "Drive\\shellex\\DragDropHandlers > 504 key.set( "", "{953AFAE9-C2A9-4674-9811-D7E281B001E1}" ); > 505 > 506 // NT系用に、Approved List に書いておく > 507 if( g_isNT && key.open( HKEY_CLASSES_ROOT, "Software\\Microsoft\ > 508 key.set( "{953AFAE9-C2A9-4674-9811-D7E281B001E1}", ProgI > 509 } > 510 } > 511 > 512 void asso_on( const char* ext, const int no ); > 513 void asso_off( const char* ext, const int no ); > 514 bool is_asso_on( const char* ext ); > 515 > 516 enum { A_BEGIN, LZH=0, ZIP, CAB, RAR, TAR, YZ1, GCA, ARJ, BGA, ACE, CPT, JAK, A_ > 517 OTH=A_END, SvnZ=CPT }; > 518 static const char* ext_list[] = { > 519 "lzh\0lzs\0lha\0", > 520 "zip\0", > 521 "cab\0", > 522 "rar\0", > 523 "tar\0tgz\0tbz\0taz\0gz\0bz2\0z\0xz\0lzma\0", > 524 "yz1\0", > 525 "gca\0", > 526 "arj\0", > 527 "gza\0bza\0", > 528 "ace\0", > 529 "cpt\0", > 530 "jak\0", > 531 }; > 532 > 533 //** void LoadAS( bool asso[] ) > 534 //** > 535 //** 標準の関連付けの設定を返す。 > 536 //** LZH=0, ZIP, CAB, RAR, TAR, YZ1, GCA, ARJ, BGA, ACE, CPT, JAK > 537 void WINAPI LoadAS( bool asso[] ) > 538 { > 539 for( int i=A_BEGIN; i<A_END; i++ ) > 540 asso[i] = is_asso_on( ext_list[i] ); > 541 } > 542 > 543 //** void SaveAS( bool asso[] ) > 544 //** > 545 //** 標準の関連付けの設定を保存。 > 546 //** LZH=0, ZIP, CAB, RAR, TAR, YZ1, GCA, ARJ, BGA, ACE, CPT, JAK > 547 void WINAPI SaveAS( bool asso[] ) > 548 { > 549 for( int i=A_BEGIN; i<A_END; i++ ) > 550 { > 551 int icon_type = i; > 552 if( i==CPT ) icon_type = OTH; // v3.195: cptは、"その他"アイコン > 553 > 554 if( asso[i] ) > 555 asso_on( ext_list[i], icon_type ); > 556 else > 557 asso_off( ext_list[i], icon_type ); > 558 } > 559 } > 560 > 561 //** void LoadASEx( const char* ext, bool* x ) > 562 //** > 563 //** 指定した拡張子がNoahに関連付けられているかどうかを返す > 564 void WINAPI LoadASEx( const char* ext, bool* x ) > 565 { > 566 *x = is_asso_on( ext ); > 567 } > 568 > 569 //** void SaveASEx( const char* ext, bool x ) > 570 //** > 571 //** 指定した拡張子をNoahに関連付けたり解除したり > 572 void WINAPI SaveASEx( const char* ext, bool x ) > 573 { > 574 int icon_type = OTH; // デフォルトは"その他"アイコン > 575 if( 0==lstrcmp(ext,"7z") ) icon_type = SvnZ; // v3.195: 7zに限り、7z専用アイコ > 576 > 577 if( x ) asso_on( ext, icon_type ); > 578 else asso_off( ext, icon_type ); > 579 } > 580 > 581 //--------------------------------------------------------------- > 582 > 583 > 584 #define step(_x) (_x+=::lstrlen(_x)+1) > 585 #define MltCmd (g_bJpn ? "解凍(&E)" : "&Extract") > 586 #define JntCmd (g_bJpn ? "結合(&E)" : "Combin&e") > 587 #define MltTyp (g_bJpn ? "書庫(%s)" : "Archive(%s)") > 588 #define JntTyp (g_bJpn ? "分割ファイル(%s)" : "RipperedFile(%s)") > 589 #define CmdName(_n) (_n==JAK ? JntCmd : MltCmd) > 590 #define TypName(_n) (_n==JAK ? JntTyp : MltTyp) > 591 > 592 static void recover_zip() > 593 { > 594 if( kiRegKey::exist( HKEY_CLASSES_ROOT, "CompressedFolder" ) ) > 595 { > 596 kiRegKey key, key2; > 597 if( key.create( HKEY_CLASSES_ROOT, ".zip", KEY_WRITE ) ) > 598 { > 599 key.set( "", "CompressedFolder" ); > 600 if( key2.create( key, "ShellNew", KEY_WRITE ) ) > 601 key2.set( "NullFIle", "" ); > 602 } > 603 } > 604 } > 605 static void recover_cab() > 606 { > 607 if( kiRegKey::exist( HKEY_CLASSES_ROOT, "CLSID\\{0CD7A5C0-9F37-11CE-AE65 > 608 { > 609 kiRegKey key; > 610 if( key.create( HKEY_CLASSES_ROOT, ".cab", KEY_WRITE ) ) > 611 key.set( "", "CLSID\\{0CD7A5C0-9F37-11CE-AE65-08002B2E12 > 612 } > 613 } > 614 > 615 void asso_on( const char* ext, const int no ) > 616 { > 617 if( is_asso_on( ext ) ) > 618 return; > 619 g_bChanged = true; > 620 > 621 kiRegKey key, key2, key3, key4; > 622 char str[500],asc[20]="NoahXt."; > 623 ::lstrcpy( asc+7, ext ); > 624 > 625 for( const char* p=ext; *p; step(p) ) > 626 { > 627 //-- "HKCR/.lzh" = "NoahXt.lzh", "HKCR/.lzs" = "NoahXt.lzh" ... > 628 str[0]='.', ::lstrcpy( str+1, p ); > 629 if( key.create( HKEY_CLASSES_ROOT, str, KEY_WRITE ) ) > 630 { > 631 key.set( "", asc ); > 632 kiRegKey::delSubKey( key, "ShellNew" ); > 633 } > 634 } > 635 > 636 if( key.create( HKEY_CLASSES_ROOT, asc, KEY_WRITE ) ) > 637 { > 638 //-- "HKCR/NoahXt.lzh" = "書庫( lzh )" > 639 ::wsprintf( str, TypName(no), ext ); > 640 key.set( "", str ); > 641 key.del( "EditFlags" ); > 642 > 643 if( key2.create( key, "DefaultIcon", KEY_WRITE ) ) > 644 { > 645 //-- "HKCR/NoahXt.lzh/DefaultIcon" = "...Noah.exe, 1" > 646 ::wsprintf( str, g_szAsIcon, no ); > 647 key2.set( "", str ); > 648 } > 649 > 650 if( key2.create( key, "Shell", KEY_WRITE ) ) > 651 { > 652 //-- "HKCR/NoahXt.lzh/Shell" = "Open" > 653 key2.set( "", "Open" ); > 654 if( key3.create( key2, "Open", KEY_WRITE ) ) > 655 { > 656 //-- "HKCR/NoahXt.lzh/Shell/Open" = "解凍(&X)" > 657 key3.set( "", CmdName(no) ); > 658 if( key4.create( key3, "Command", KEY_WRITE ) ) > 659 //-- "HKCR/NoahXt.lzh/Shell/Open/Comman > 660 key4.set( "", g_szAsCmd ); > 661 } > 662 } > 663 } > 664 } > 665 > 666 void asso_off( const char* ext, const int no ) > 667 { > 668 if( !is_asso_on( ext ) ) > 669 return; > 670 g_bChanged = true; > 671 > 672 //-- delete "HKCR/NoahXt.lzh" > 673 char str[20] = "NoahXt."; > 674 ::lstrcpy( str+7, ext ); > 675 kiRegKey::delSubKey( HKEY_CLASSES_ROOT, str ); > 676 > 677 //-- delete "HKCR/.lzh" "HKCR/.lzs" ... > 678 for( const char* p=ext; *p; step(p) ) > 679 { > 680 str[0]='.', ::lstrcpy( str+1, p ); > 681 kiRegKey::delSubKey( HKEY_CLASSES_ROOT, str ); > 682 } > 683 > 684 switch( no ) > 685 { > 686 // CAB, ZIP to Windows Default Association > 687 case CAB: recover_cab(); break; > 688 case ZIP: recover_zip(); break; > 689 } > 690 } > 691 > 692 bool is_asso_on( const char* ext ) > 693 { > 694 //-- "HKCR/.lzh" exists ? > 695 char str[20] = "."; > 696 ::lstrcpy( str+1, ext ); > 697 kiRegKey key; > 698 if( !key.open( HKEY_CLASSES_ROOT, str, KEY_READ ) ) > 699 return false; > 700 if( !key.get( "", str, 20 ) ) > 701 return false; > 702 > 703 //-- the value of "HKCR/.lzh" is "NoahXt.lzh" ? > 704 char asc[20] = "NoahXt."; > 705 ::lstrcpy( asc+7, ext ); > 706 return ( 0==::lstrcmp( str, asc ) ); > 707 }

Added NoahXt/NoahXt.def version [304473b4f4b8f221]

> 1 LIBRARY NoahXt > 2 DESCRIPTION "Noah Shell Extension" > 3 EXPORTS > 4 DllCanUnloadNow private > 5 DllGetClassObject private > 6 > 7 Init private > 8 LoadSE private > 9 SaveSE private > 10 LoadAS private > 11 SaveAS private > 12 LoadASEx private > 13 SaveASEx private

Added NoahXt/NoahXt.dsp version [b4fe69bc6effbce7]

> 1 # Microsoft Developer Studio Project File - Name="NoahXt" - Package Owner=<4> > 2 # Microsoft Developer Studio Generated Build File, Format Version 6.00 > 3 # ** 編集しないでください ** > 4 > 5 # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 > 6 > 7 CFG=NoahXt - Win32 Debug > 8 !MESSAGE これは有効なメイクファイルではありません。 このプロジェクトをビルドするためには NMAKE を使用してください。 > 9 !MESSAGE [メイクファイルのエクスポート] コマンドを使用して実行してください > 10 !MESSAGE > 11 !MESSAGE NMAKE /f "NoahXt.mak". > 12 !MESSAGE > 13 !MESSAGE NMAKE の実行時に構成を指定できます > 14 !MESSAGE コマンド ライン上でマクロの設定を定義します。例: > 15 !MESSAGE > 16 !MESSAGE NMAKE /f "NoahXt.mak" CFG="NoahXt - Win32 Debug" > 17 !MESSAGE > 18 !MESSAGE 選択可能なビルド モード: > 19 !MESSAGE > 20 !MESSAGE "NoahXt - Win32 Release" ("Win32 (x86) Dynamic-Link Library" 用) > 21 !MESSAGE "NoahXt - Win32 Debug" ("Win32 (x86) Dynamic-Link Library" 用) > 22 !MESSAGE > 23 > 24 # Begin Project > 25 # PROP AllowPerConfigDependencies 0 > 26 # PROP Scc_ProjName "NoahXt" > 27 # PROP Scc_LocalPath "." > 28 CPP=cl.exe > 29 MTL=midl.exe > 30 RSC=rc.exe > 31 > 32 !IF "$(CFG)" == "NoahXt - Win32 Release" > 33 > 34 # PROP BASE Use_MFC 0 > 35 # PROP BASE Use_Debug_Libraries 0 > 36 # PROP BASE Output_Dir "Release" > 37 # PROP BASE Intermediate_Dir "Release" > 38 # PROP BASE Target_Dir "" > 39 # PROP Use_MFC 0 > 40 # PROP Use_Debug_Libraries 0 > 41 # PROP Output_Dir "../tmp/relxt" > 42 # PROP Intermediate_Dir "../tmp/relxt" > 43 # PROP Ignore_Export_Lib 0 > 44 # PROP Target_Dir "" > 45 # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D " > 46 # ADD CPP /nologo /W3 /GX /O2 /Ob0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBC > 47 # SUBTRACT CPP /YX /Yc /Yu > 48 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 > 49 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 > 50 # ADD BASE RSC /l 0x411 /d "NDEBUG" > 51 # ADD RSC /l 0x411 /d "NDEBUG" > 52 BSC32=bscmake.exe > 53 # ADD BASE BSC32 /nologo > 54 # ADD BSC32 /nologo > 55 LINK32=link.exe > 56 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib ad > 57 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi3 > 58 # SUBTRACT LINK32 /pdb:none > 59 > 60 !ELSEIF "$(CFG)" == "NoahXt - Win32 Debug" > 61 > 62 # PROP BASE Use_MFC 0 > 63 # PROP BASE Use_Debug_Libraries 1 > 64 # PROP BASE Output_Dir "Debug" > 65 # PROP BASE Intermediate_Dir "Debug" > 66 # PROP BASE Target_Dir "" > 67 # PROP Use_MFC 0 > 68 # PROP Use_Debug_Libraries 1 > 69 # PROP Output_Dir "../tmp/dbgxt" > 70 # PROP Intermediate_Dir "../tmp/dbgxt" > 71 # PROP Ignore_Export_Lib 0 > 72 # PROP Target_Dir "" > 73 # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WIND > 74 # ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" > 75 # SUBTRACT CPP /YX /Yc /Yu > 76 # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 > 77 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 > 78 # ADD BASE RSC /l 0x411 /d "_DEBUG" > 79 # ADD RSC /l 0x411 /d "_DEBUG" > 80 BSC32=bscmake.exe > 81 # ADD BASE BSC32 /nologo > 82 # ADD BSC32 /nologo > 83 LINK32=link.exe > 84 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib ad > 85 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi3 > 86 > 87 !ENDIF > 88 > 89 # Begin Target > 90 > 91 # Name "NoahXt - Win32 Release" > 92 # Name "NoahXt - Win32 Debug" > 93 # Begin Group "Source Files" > 94 > 95 # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" > 96 # Begin Source File > 97 > 98 SOURCE=.\NoahXt.cpp > 99 # End Source File > 100 # Begin Source File > 101 > 102 SOURCE=.\NoahXt.def > 103 # End Source File > 104 # End Group > 105 # Begin Group "Resource Files" > 106 > 107 # PROP Default_Filter "" > 108 # Begin Source File > 109 > 110 SOURCE=.\icon\arc_ace.ico > 111 # End Source File > 112 # Begin Source File > 113 > 114 SOURCE=.\icon\arc_arj.ico > 115 # End Source File > 116 # Begin Source File > 117 > 118 SOURCE=.\icon\arc_bga.ico > 119 # End Source File > 120 # Begin Source File > 121 > 122 SOURCE=.\icon\arc_cab.ico > 123 # End Source File > 124 # Begin Source File > 125 > 126 SOURCE=.\icon\arc_gca.ico > 127 # End Source File > 128 # Begin Source File > 129 > 130 SOURCE=.\icon\arc_jak.ico > 131 # End Source File > 132 # Begin Source File > 133 > 134 SOURCE=.\icon\arc_lzh.ico > 135 # End Source File > 136 # Begin Source File > 137 > 138 SOURCE=.\icon\arc_oth.ico > 139 # End Source File > 140 # Begin Source File > 141 > 142 SOURCE=.\icon\arc_rar.ico > 143 # End Source File > 144 # Begin Source File > 145 > 146 SOURCE=.\icon\arc_tar.ico > 147 # End Source File > 148 # Begin Source File > 149 > 150 SOURCE=.\icon\arc_yz1.ico > 151 # End Source File > 152 # Begin Source File > 153 > 154 SOURCE=.\icon\arc_zip.ico > 155 # End Source File > 156 # Begin Source File > 157 > 158 SOURCE=.\noahxt.rc > 159 # End Source File > 160 # Begin Source File > 161 > 162 SOURCE=.\resource.h > 163 # End Source File > 164 # End Group > 165 # Begin Source File > 166 > 167 SOURCE=.\icon\arc_7z.ico > 168 # End Source File > 169 # End Target > 170 # End Project

Added NoahXt/NoahXt.rc version [4a6af8e085880ec9]

> 1 //Microsoft Developer Studio generated resource script. > 2 // > 3 #include "resource.h" > 4 > 5 #define APSTUDIO_READONLY_SYMBOLS > 6 ///////////////////////////////////////////////////////////////////////////// > 7 // > 8 // Generated from the TEXTINCLUDE 2 resource. > 9 // > 10 #include "afxres.h" > 11 > 12 ///////////////////////////////////////////////////////////////////////////// > 13 #undef APSTUDIO_READONLY_SYMBOLS > 14 > 15 ///////////////////////////////////////////////////////////////////////////// > 16 // 日本語 resources > 17 > 18 #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_JPN) > 19 #ifdef _WIN32 > 20 LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT > 21 #pragma code_page(932) > 22 #endif //_WIN32 > 23 > 24 ///////////////////////////////////////////////////////////////////////////// > 25 // > 26 // Icon > 27 // > 28 > 29 // Icon with lowest ID value placed first to ensure application icon > 30 // remains consistent on all systems. > 31 IDI_LZH ICON DISCARDABLE "icon\\arc_lzh.ico" > 32 IDI_ZIP ICON DISCARDABLE "icon\\arc_zip.ico" > 33 IDI_CAB ICON DISCARDABLE "icon\\arc_cab.ico" > 34 IDI_RAR ICON DISCARDABLE "icon\\arc_rar.ico" > 35 IDI_TAR ICON DISCARDABLE "icon\\arc_tar.ico" > 36 IDI_YZ1 ICON DISCARDABLE "icon\\arc_yz1.ico" > 37 IDI_GCA ICON DISCARDABLE "icon\\arc_gca.ico" > 38 IDI_ARJ ICON DISCARDABLE "icon\\arc_arj.ico" > 39 IDI_BGA ICON DISCARDABLE "icon\\arc_bga.ico" > 40 IDI_ACE ICON DISCARDABLE "icon\\arc_ace.ico" > 41 IDI_OTH ICON DISCARDABLE "icon\\arc_oth.ico" > 42 IDI_JAK ICON DISCARDABLE "icon\\arc_jak.ico" > 43 IDI_7Z ICON DISCARDABLE "icon\\arc_7z.ico" > 44 > 45 #ifdef APSTUDIO_INVOKED > 46 ///////////////////////////////////////////////////////////////////////////// > 47 // > 48 // TEXTINCLUDE > 49 // > 50 > 51 1 TEXTINCLUDE DISCARDABLE > 52 BEGIN > 53 "resource.h\0" > 54 END > 55 > 56 2 TEXTINCLUDE DISCARDABLE > 57 BEGIN > 58 "#include ""afxres.h""\r\n" > 59 "\0" > 60 END > 61 > 62 3 TEXTINCLUDE DISCARDABLE > 63 BEGIN > 64 "\r\n" > 65 "\0" > 66 END > 67 > 68 #endif // APSTUDIO_INVOKED > 69 > 70 #endif // 日本語 resources > 71 ///////////////////////////////////////////////////////////////////////////// > 72 > 73 > 74 > 75 #ifndef APSTUDIO_INVOKED > 76 ///////////////////////////////////////////////////////////////////////////// > 77 // > 78 // Generated from the TEXTINCLUDE 3 resource. > 79 // > 80 > 81 > 82 ///////////////////////////////////////////////////////////////////////////// > 83 #endif // not APSTUDIO_INVOKED > 84

Added NoahXt/icon/arc_7z.ico version [c88cff243684b85f]

cannot compute difference between binary files

Added NoahXt/icon/arc_ace.ico version [922ed93139c5eb92]

cannot compute difference between binary files

Added NoahXt/icon/arc_arj.ico version [2e528937110b9cea]

cannot compute difference between binary files

Added NoahXt/icon/arc_bga.ico version [6a8ff334bd510117]

cannot compute difference between binary files

Added NoahXt/icon/arc_cab.ico version [2a79b76aac00619a]

cannot compute difference between binary files

Added NoahXt/icon/arc_gca.ico version [571f9caffd74a51e]

cannot compute difference between binary files

Added NoahXt/icon/arc_jak.ico version [48e25163aca81aec]

cannot compute difference between binary files

Added NoahXt/icon/arc_lzh.ico version [25c76cc92b32f43b]

cannot compute difference between binary files

Added NoahXt/icon/arc_oth.ico version [c77160d9efad075f]

cannot compute difference between binary files

Added NoahXt/icon/arc_rar.ico version [a225709aa812c8ee]

cannot compute difference between binary files

Added NoahXt/icon/arc_tar.ico version [3f1ee52e5a2f3f94]

cannot compute difference between binary files

Added NoahXt/icon/arc_yz1.ico version [e51fa479e92c66a8]

cannot compute difference between binary files

Added NoahXt/icon/arc_zip.ico version [f6cace9224ff89fd]

cannot compute difference between binary files

Added NoahXt/resource.h version [99c9afdb272c149b]

> 1 //{{NO_DEPENDENCIES}} > 2 // Microsoft Developer Studio generated include file. > 3 // Used by NoahXt.rc > 4 // > 5 #define IDI_LZH 101 > 6 #define IDI_ZIP 102 > 7 #define IDI_CAB 103 > 8 #define IDI_RAR 104 > 9 #define IDI_TAR 105 > 10 #define IDI_YZ1 106 > 11 #define IDI_GCA 107 > 12 #define IDI_ARJ 108 > 13 #define IDI_BGA 109 > 14 #define IDI_ACE 110 > 15 #define IDI_7Z 111 > 16 #define IDI_JAK 112 > 17 #define IDI_OTH 113 > 18 > 19 // Next default values for new objects > 20 // > 21 #ifdef APSTUDIO_INVOKED > 22 #ifndef APSTUDIO_READONLY_SYMBOLS > 23 #define _APS_NEXT_RESOURCE_VALUE 114 > 24 #define _APS_NEXT_COMMAND_VALUE 40001 > 25 #define _APS_NEXT_CONTROL_VALUE 1000 > 26 #define _APS_NEXT_SYMED_VALUE 101 > 27 #endif > 28 #endif

Added ReadMe.txt version [54b1a27d3c97ca66]

> 1 > 2 このソース群の利用条件については、Noahのバイナリの方に > 3 つけてある利用条件に従います。基本的には、どう使うのも自由。 > 4 Visual C++ 6.0 Professional Edition / Visual C++ 2010 Express Edition 用です。 > 5 > 6 > 7 ☆ワークスペース等 > 8 > 9 - Noah.sln (VC++ 2010 用ワークスペース) > 10 - Noah.dsw (VC++ 6.0 用ワークスペース) > 11 - Noah.dsp ('Noah.exe' 用プロジェクト) > 12 - stdafx.h/cpp (pre-complied header生成用) > 13 - NoahXt/ > 14 - NoahXt.dsp ('NoahXt.dll' 用プロジェクト) > 15 - NoahXt.def (ExportするAPI一覧) > 16 - stdafx.h/cpp (pre-complied header生成用) > 17 - uninst/ > 18 - kinst.dsp ('uninst.exe' 用プロジェクト) > 19 - stdafx.h/cpp (pre-complied header生成用) > 20 > 21 > 22 ☆リソース > 23 > 24 - Noah.rc (リソーススクリプト) > 25 - resource.h (リソースID定義ヘッダ) > 26 - *.ico (アイコンデータ) > 27 > 28 > 29 ☆ソースコード > 30 > 31 - / > 32 - NoahApp.h|Noah.cpp (Noahメインルーチン) > 33 - NoahCM.h|cpp (設定関係全般) > 34 - NoahAM.h|cpp (圧縮解凍処理の上位ルーチン) > 35 - SubDlg.h|cpp (書庫内容閲覧/パスワード/状況表示ダイアログ) > 36 - Archiver.h|cpp (圧縮解凍ルーチンのinterface) > 37 - ArcDLL.h|cpp (DLL利用ルーチン) > 38 - ArcB2e.h|cpp (B2Eスクリプト利用ルーチン) > 39 - ArcACE.h|cpp (UnaceV2.dll利用ルーチン) > 40 - ArcMSC.h|cpp (MS-Compress対応ルーチン) > 41 - ArcCPT.h|cpp (CompactPro対応ルーチン) > 42 > 43 - NoahXt/ > 44 - NoahXt.cpp (関連付け・シェルエクステンション) > 45 > 46 - uninst/ > 47 - kinst.cpp (インストーラ) > 48 > 49 - kilib/ > 50 - kilib.h (K.I.LIBのメインヘッダ) > 51 - kilibext.h (K.I.LIBの拡張機能用ヘッダ) > 52 > 53 - kl_app.h|cpp (スタートアップポイント。アプリケーション全体の情報管理) > 54 - kl_wnd.h|cpp (ウインドウ、ダイアログ、プロパティシート管理) > 55 - kl_reg.h|cpp (レジストリ、iniファイルの入出力) > 56 - kl_dnd.h|cpp (OLEドラッグ&ドロップ処理) > 57 - kl_find.h|cpp (ファイル検索) > 58 - kl_wcmn.h|cpp (主にWindows-Shell周りの便利関数群) > 59 > 60 - kl_cmd.h|cpp (コマンドラインパーサ) > 61 - kl_str.h|cpp (文字列処理&パス文字列処理) > 62 - kl_file.h|cpp (ファイル入出力) > 63 - kl_misc.h|cpp (汎用クラス。配列のtemplateなど) > 64 > 65 - kl_carc.h|cpp (統合アーカイバDLLラッパ) > 66 - kl_rythp.h|cpp (Rythpスクリプト処理) > 67 > 68 > 69 ☆構成 > 70 > 71 - CNoahApp : kiApp > 72 - (ArcManやCnfManと連絡を取り、行う処理を決定する処理) > 73 > 74 - CNoahArchiveManager > 75 - (適切なCArchiverへ圧縮解凍を回す処理) > 76 - kiArray<CArchiver*> > 77 > 78 - CNoahConfigManager > 79 - (ini読み書き処理やNoahXt.dllとの連携) > 80 - CNoahConfigDialog : kiPropSheet > 81 - CCmprPage : kiPropSheetPage > 82 - CInfoPage : kiPropSheetPage > 83 - CMeltPage : kiPropSheetPage > 84 - CWinXPage : kiPropSheetPage > 85 > 86 - CArchiver > 87 - (書庫操作用の共通インターフェイス) > 88 - (ここから各種解凍エンジン専用クラスが派生する) > 89 > 90 - K.I.LIB > 91 - (汎用性の極めて低いWin32用ライブラリ)

Added Release/Noah.exe version [2f4ce4031d5a9425]

cannot compute difference between binary files

Added Release/NoahXt.dll version [ff9dc9c2de986967]

cannot compute difference between binary files

Added Release/ReadMe.txt version [c7545d612c6202bb]

> 1 > 2 ★ Noah 3.199 > 3 ★ 2010/11/25 > 4 > 5 > 6  この文書は、Windows95/98/Me/NT4/2000/XP/2003/Vista/7用圧縮解凍ソフト > 7 "Noah"の上級者向けパッケージの説明書です。Windows用圧縮解凍ソフトを > 8 一度は使ったことがあるという層を対象としています。難しいと感じた方は、 > 9 初心者用パッケージを入手して、そちらを利用することをお勧めします。 > 10 ※ 説明書とインストーラが違うだけで、どちらも全く同じ性能です。 > 11 > 12 > 13 > 14 【更新内容 @ 3.198->3.199】 > 15 > 16  ・インストーラ版添付の caldix のバージョンを 1.21 に更新 > 17  ・標準で tar.xz と tar.lzma の圧縮に対応(最新のTar32.dllが必要です) > 18   (関連づけは、設定画面で一端tarの関連づけを外して保存終了してから、 > 19    もう一度tarに関連づけ直してください。.xz と .lzma が Noah に > 20    関連づけされます。) > 21 > 22 【更新内容 @ 3.195->3.198】 > 23 > 24  ・JVNVU#707943 : Windows プログラムの DLL 読み込みに脆弱性 > 25    http://jvn.jp/cert/JVNVU707943/index.html > 26   へ対処しました > 27 > 28  ・初期設定時の圧縮形式を lzh から zip に変更しました > 29  ・ACEの自己解凍書庫の認識範囲を広げました > 30  ・Noah.exe 本体をUPX圧縮しないようにしました > 31  ・b2eに\を/に置き換える(slash A)を追加 > 32  ・Noahの設定画面へのD&Dでの圧縮・展開機能をマニュアルに記載 > 33  ・半角1文字の名前のフォルダを圧縮したものを展開すると、展開後フォルダが開かれネいバグを修正 > 34  ・ACE書庫の書庫内閲覧モードで、圧縮方式の判定が間違っていたのを修正 > 35  ・7-zip 形式での圧縮や展開で、"-" で始まるファイル名を扱えるように修正 > 36  ・b2e を使っていた場合多バイト文字で終わる名前のファイルを圧縮できなかったバグ修正 > 37  ・D&D処理後、Noahがそのまま起動していると出力先フォルダを削除できないバグを修ウ > 38  ・バッファオーバーフローとリソースリークの危険をいくつか修正 > 39  ・b2eの引き算がおかしかった(常に0になっていた)バグを修正 > 40  ・MSCompress形式での圧縮時にタイムスタンプを元ファイルと合わせるように修正 > 41  ・圧縮/解凍先ディレクトリ設定のエディットボックスにIMEで入力すると文字化けするバグを修正 > 42  ・b2eのscanでファイルをリストアップしたとき最後にゴミが混じるバグを修正 > 43  ・(検索結果などから)異なるディレクトリにある書庫を一括でNoahに渡しても解凍はできるように変更 > 44 > 45  (3.197) MSVCR100.dll がないと動かなくなっていたのを修正 > 46  (3.198) Windows XP SP2 以上でないと動かなくなっていたのを修正 > 47 > 48 > 49 【対応形式】 > 50 > 51  ・外部モジュール不要 > 52     圧縮:MS-Compress > 53     解凍:MS-Compress, cpt > 54 > 55  ・統合アーカイバDLL( http://www.csdinc.co.jp/archiver/ )が必要 > 56     圧縮:lzh, zip, cab, tar, bga, yz1, 7z (※tarはSFX圧縮不可) > 57     解凍:lzh, zip, cab, tar, bga, yz1, 7z, rar, arj, gca > 58   分割結合:jak > 59 > 60  ・UnaceV2.dll( http://www.winace.com/ )が必要 > 61     解凍:ace > 62 > 63 > 64 > 65 【使い方】 > 66 > 67  ・インストール&アンインストール > 68    関連付けやシェル拡張をしない限りレジストリは使いません。 > 69    適当なところにおいて、要らなくなったらさっくり消してください。 > 70 > 71  ・解凍&圧縮 > 72    Noahのアイコンにファイルをドロップ。 > 73    書庫なら解凍、そうでなければ圧縮します。 > 74 > 75  ・書庫の中身を閲覧 > 76    Ctrlを押しながら解凍。 > 77 > 78  ・自己解凍形式で圧縮 > 79    Ctrlを押しながら圧縮。 > 80 > 81  ・一個一個別のファイルに圧縮 > 82    Altを押しながら圧縮。 > 83 > 84  ・テンポラリ設定 > 85    Shiftを押しながらドロップ→設定変更→Shiftを押しながらキャンセル。 > 86    最後にShiftを押さず終了すると、ただの設定変更にもなります。 > 87 > 88 > 89 > 90 【Noahの動作モードについて】 > 91 > 92    設定項目のほとんどはだいたい直感で分かると思いますので、ここでは唯一 > 93   わかりにくい "動作モード" について説明します。これは、ファイルをドロップ > 94   したときに Noah がどう動作するかを決めておくものです。 > 95 > 96   [圧縮専用] … どんなファイルを渡されても圧縮。 > 97   [解凍専用] … どんなファイルを渡されても解凍を試みる。圧縮に回すことはない。 > 98 > 99   については説明入れるまでもなくOKと思います。残り二つについては、どちらも > 100   基本方針は「書庫なら解凍、それ以外は圧縮」なんですが、若干違いがあります。 > 101 > 102   ・書庫を複数ドロップした場合 > 103     [解凍優先] … それぞれ解凍します。 > 104     [圧縮優先] … 圧縮します。 > 105    複数の書庫を一つにまとめたい時は圧縮優先。 > 106 > 107   ・拡張子のおかしな書庫( lzh書庫なのに、拡張子がgif、など )をドロップした場合 > 108     [解凍優先] … 解凍します。 > 109     [圧縮優先] … 圧縮します。 > 110    つまり圧縮優先の時は、拡張子からして書庫でない、と判定したら > 111    内容でのチェックはせずに、すぐに圧縮ルーチンへ回してしまうと言うことです。 > 112 > 113 > 114 > 115 【Noah.iniの隠し設定】 > 116 > 117   OpenBy=ディレクトリを開くコマンド > 118 > 119    デフォルトは explorer "%s" です。 > 120    %sは実行時にディレクトリ名に置き換えられます。 > 121    例えば explorer /e,"%s" とすればエクスプローラで開けます。 > 122 > 123   MiniBoot=1 > 124 > 125    b2eから実行ファイルを起動する際に、最小化状態で > 126    実行したい場合は、MiniBoot=1 と書いて下さい。 > 127 > 128   OldAbout=1 > 129 > 130    バージョン情報表示が遅いときにこれを入れると簡易表示になります。 > 131 > 132   OneExt=1 > 133 > 134    aaa.bbb.ccc を圧縮したときの書庫名を aaa.lzh ではなく > 135    aaa.bbb.lzh としたいときに設定します。他に、NoExt=1 > 136    にすると aaa.bbb.ccc.lzh になります。 > 137 > 138   MultiBootLimit=4 > 139 > 140    Noah.exeが一発圧縮解凍用に一度に起動できる最大個数を制限します。デフォルトは4。 > 141 > 142 > 143 > 144 【アイコンの変更方法】 > 145 > 146   Noahを書庫ファイルに関連づけたときに設定されるアイコンは、 > 147   全て NoahXt.dll に含まれています。このDLLを差し替えることで、 > 148   他のアイコンセットを使用することもできます。 > 149    SB Room ( http://homepage3.nifty.com/scriba/ ) > 150   にて沢山のアイコンが公開されていますので、是非ご覧下さい。 > 151 > 152 > 153 > 154 【コマンドラインオプション】 > 155 > 156   -a 必ず圧縮 -x 必ず解凍 -cx 閲覧 -ca SFX圧縮 -w 個別圧縮 > 157   -dDirName 出力先 -tTypeName 圧縮形式 -mMethod 圧縮メソッド > 158 > 159 > 160 > 161 【利用条件】 > 162 > 163  --- NYSL ver 0.9982 ( http://www.kmonos.net/nysl/ ) --- > 164 > 165 A. 本ソフトウェアは Everyone'sWare です。このソフトを手にした一人一人が、 > 166 ご自分の作ったものを扱うのと同じように、自由に利用することが出来ます。 > 167 > 168 A-1. フリーウェアです。作者からは使用料等を要求しません。 > 169 A-2. 有料無料や媒体の如何を問わず、自由に転載・再配布できます。 > 170 A-3. いかなる種類の 改変・他プログラムでの利用 を行っても構いません。 > 171 A-4. 変更したものや部分的に使用したものは、あなたのものになります。 > 172 公開する場合は、あなたの名前の下で行って下さい。 > 173 > 174 B. このソフトを利用することによって生じた損害等について、作者は > 175 責任を負わないものとします。各自の責任においてご利用下さい。 > 176 > 177 C. 著作者人格権は K.INABA に帰属します。著作権は放棄します。 > 178 > 179 D. 以上の3項は、ソース・実行バイナリの双方に適用されます。 > 180 > 181 > 182 > 183 -------------------------------------------------------- > 184 by k.inaba( http://www.kmonos.net/ )

Added Release/b2e/aboutb2e.txt version [bc1665b745683ac3]

> 1 > 2 =★ B2E(Bridge To Executables) Script 仕様書 > 3 =★ 2010/10/14 > 4 =★ k.inaba ( http://www.kmonos.net/ ) > 5 > 6 > 7 > 8 1.概要 ------------------------------------------------------ > 9 > 10   Noahは、定義ファイルを追加することで他のexeのフロントエンド > 11  となることが出来ます。つまり、「コマンドライン用の圧縮解凍ソ > 12  フトは面倒!」と思ったら、Noahと連携させて簡単なGUIで操作が > 13  できるようになるわけです。 > 14 > 15   定義ファイルは、Noah.exeと同じ階層のb2eフォルダに入れること > 16  で自動で認識されます。以下ではこの定義ファイルの書き方を解説 > 17  していきます。 > 18 > 19 > 20 > 21 2.ファイル名 ------------------------------------------------ > 22 > 23  ・拡張子は b2e > 24  ・ファイル名に対応拡張子を記述 > 25 > 26  ex) 拡張子ishとuueとuuを展開可能にするためのスクリプトなら > 27     ish.uue.uu.b2e > 28  ex) となります。zzを展開するためのモノなら、単に > 29     zz.b2e > 30  ex) ですね。圧縮しか行わない場合は出来れば、 > 31     #rar.b2e > 32  ex) のように、頭に # を付けて下さい。(必須ではありません) > 33 > 34 > 35 > 36 3.サンプル ------------------------------------------------------- > 37 > 38  | load: > 39  | (name Rar.exe) > 40  | (type rar Fast Default *Best) > 41  | > 42  | encode: > 43  | (if (method 1) (cmd a -m1 -r0 (arc.rar) (list\*.*))) > 44  | (if (method 2) (cmd a -m3 -r0 (arc.rar) (list\*.*))) > 45  | (if (method 3) (cmd a -m5 -mm -r0 (arc.rar) (list\*.*))) > 46  | > 47  | sfx: > 48  | (cmd s (arc)) > 49 > 50  | load: > 51  | (name 777.exe) > 52  | (type 777 777) > 53  | > 54  | encode: > 55  | (if (method 1) (cmd a (arc.777) (list\*) -mg)) > 56  | > 57  | decode: > 58  | (cmd x (arc)) > 59 > 60 > 61 > 62 4.構造 ------------------------------------------------------ > 63 > 64  ・load: EXE名などを書く部分 > 65  ・decode: 解凍コマンドを書く部分 > 66  ・encode: 圧縮コマンドを書く部分 > 67  ・sfx: 書庫→SFX変換コマンドを書く部分 > 68 > 69  の4セクションに分かれます。 > 70 > 71 > 72 > 73 5.load: ----------------------------------------------------- > 74 > 75  | load: > 76  | (name EXE名) > 77  | (type 圧縮形式名 圧縮レベル名1 圧縮レベル名2 ...) > 78 > 79  と書きます。圧縮を行わない時は、type の文は書かなくてOK。 > 80  ※ 圧縮レベル名の頭に * を付けると、それが標準圧縮レベルになります。 > 81 > 82 > 83 > 84 6.decode: --------------------------------------------------- > 85 > 86  | decode: > 87  | (cmd 実行するコマンド) > 88 > 89  コマンド中の以下の文字列については自動で置き換えられます。 > 90 > 91   (arc) … 解凍する書庫名 > 92   (dir) … 解凍先フォルダ名 > 93   (arc-.xx ln) … 書庫名から拡張子.xxを除いたもの > 94 > 95 > 96 > 97 7.encode: --------------------------------------------------- > 98 > 99  | encode: > 100  | (if (method 1) (cmd 圧縮レベル1のときのコマンド)) > 101  | (if (method 2) (cmd 圧縮レベル2のときのコマンド)) > 102  | 以下同様 > 103 > 104  自動置き換えは以下の通り。 > 105 > 106   (arc.xxx) … 圧縮先書庫名(拡張子xxx) > 107   (dir) … 圧縮したいファイルのあるフォルダ名 > 108   (arc d) … 圧縮先フォルダ名 > 109   (list) … 圧縮したいファイルのリスト > 110   (list\*) … 圧縮したいファイルのリスト > 111   (list\*.*) … 圧縮したいファイルのリスト > 112 { ↑フォルダ名を渡すときに使うワイルドカードが違います } > 113 { それぞれ、"dir" "dir\*" "dir\*.*" という形式を使います } > 114 { どれを使えばよいやらわからなかったら、とりあえず } > 115 { (list\*) と書いておいてください。 } > 116 > 117 > 118 > 119 8.sfx: ------------------------------------------------------ > 120 > 121  | sfx: > 122  | (cmd 書庫からSFXへ変換するコマンド) > 123 > 124  自動置き換えは以下の通り。 > 125 > 126   (arc) … 元書庫名 > 127   (arc.exe) … SFX書庫名 > 128   (dir) … 作業フォルダ名 > 129 > 130 > 131 > 132 9.encode1: sfxd: -------------------------------------------- > 133 > 134   書庫化機能がない圧縮ソフトやテキストエンコーダなど、圧縮時 > 135  には一つしかファイルを受け取らないソフトがあります。このよう > 136  なソフトに対応するときは、encode: の代わりに、encode1: と > 137  書いておいてください。そうすればNoah側で適当にうまいこと処理 > 138  します。 > 139 > 140   書庫→SFX変換機能がなく、直接一気にSFXに圧縮するしかない > 141  ソフトもあります。そんなときには sfx: の代わりに sfxd: を > 142  使います。SFX圧縮時にはNoahは直接 sfxd: を使うようになります。 > 143 > 144   encode1: も sfxd: も、自動置き換えは encode: と全く同じです。 > 145 > 146 > 147 > 148 10.休憩 ------------------------------------------------------- > 149 > 150   さっぱりわからないぃ〜状態の人は、実際に完成したファイルを > 151  眺めてみると、頭が整理されるかもしれません。 > 152 > 153   http://b2efile.tripod.co.jp/ > 154    ( yc氏のサイト。100個以上のb2eが公開されています。 ) > 155 > 156   仕様書なんてこんな固いもん見てもわかるか!状態の人は、 > 157  実際どんな手順で書いていけばよいか、を解説したサイトが > 158  きっと役に立つことでしょう。 > 159 > 160   http://homepage3.nifty.com/scriba/manu/ > 161    ( SB氏のサイトの一角。Noah付属のものよりずっと丁寧な > 162     マニュアルとなっています。 ) > 163 > 164 > 165  さて、ここから下は、結構内容が濃いです。知らなくても普通に > 166  b2eを書く分には全く困らない知識ばっかりです。(^^; > 167  それでも読んでみたい奇特な人だけどうぞ…… > 168 > 169 > 170 > 171 > 172 > 173 > 174 > 175 > 176 > 177 > 178 > 179 > 180 > 181 > 182 > 183 > 184 > 185 > 186 > 187 > 188 > 189 =★ > 190 =★ 第二部 > 191 =★ > 192 > 193 > 194 > 195 11.英語モードでexeを実行する技 ------------------------------- > 196 > 197  日本語版WindowsのDOS窓で動かすと、なんだか ロロロロン と出てきて > 198  格好悪かったり、最悪の場合全く動かない…というアーカイバに > 199  出会ったことはありませんか? > 200  これらは、"usモード" に切り替えてから実行すると上手く動く > 201  ことが多いです。Noahでこの切り替えを行うには、最初の name で、 > 202 > 203   (name EXE名 us) > 204 > 205  と、後ろに us を付けて下さい。これで、そのb2eに書かれた(cmd)や > 206  (xcmd)の実行の際には、自動でusモードになるようになります。 > 207 > 208 > 209 > 210 12.統合アーカイバDLL用スクリプト ----------------------------- > 211 > 212  load: のところで (name DLL名) とすればOKですが、それだと > 213   ・ファイル内容による書庫判定 > 214   ・書庫閲覧&部分解凍 > 215  が出来ません。致命的です。 > 216 > 217  前者を有効にするには、 > 218   check: > 219  って一行どこかに書いてください。中身は要りません。 > 220 > 221  後者を有効にするには、decode1: セクションを書きます。 > 222  自動置き換えは decode: セクションと同じものに加え、 > 223  (list) と書くとそこに解凍ファイル名リストが入るようになります。 > 224  decode1: セクションでは、出来るだけグラフやエラーメッセージを > 225  抑止するようなオプションをつけて cmd して下さい。 > 226 > 227  DLL名からAPI名を算出するため、大文字小文字は間違えないように。 > 228  基本的には[最初一文字大、あと小]で大丈夫ですが、UnZip は Z も > 229  大文字に。UnGCA も要注意。 > 230 > 231  また、元々Noahに内蔵されているルーチンはb2eより優先されるため、 > 232  ただb2eファイルを追加しただけでは、例えばUnlha32.dll用の動作を > 233  置き換えることは出来ません。noah.ini ファイルに次の形式で > 234  隠し設定を記述することで、内蔵ルーチンを使わないようにできます。 > 235 > 236   Kill=使いたくない内蔵ルーチン > 237 > 238    例えば Kill=LCT なら、Unlha32,Cab32,Tar32 を使用しなくなります。 > 239      L … Unlha32 Z … UnZip32 z … Zip32j > 240      R … Unrar32 C … Cab32  T … Tar32 > 241      B … Bga32  G … UnGCA32 A … Unarj32j > 242      a … UnaceV2 Y … Yz1   c … Cpt > 243      7 … 7-zip32 M … MS-Compress > 244 > 245 > 246 > 247 13.大量のb2eを入れると --------------------------------------- > 248 > 249  バージョン情報の表示が遅くなる環境があるそうです。 > 250  そんな場合は Noah.ini ファイルに > 251   OldAbout=1 > 252  と一行付け加えてください。 > 253 > 254 > 255 > 256 14. As a Script Language -------------------------------------- > 257 > 258   上でさんざん[自動置き換え]として (arc) とかを紹介しましたが、 > 259  気分的には全然違います。( 機能名 引数1 引数2 ... ) の形の > 260  functionをひたすら組み合わせて書く、Lispのまがい物のような > 261  スクリプト言語のつもり。 > 262 > 263   例 (+ 25 8)    = 33 > 264     (* 3 7)    = 21 > 265     (+ 11 (* 3 4)) = 23 > 266 > 267  こんな感じで計算もできます。+ だったら一個目の数と二個目の数を > 268  足した結果を返す[関数]と考えられるのと同様、(arc) も、適当な > 269  オプションをとって書庫名を返す[関数]として実装しています。 > 270 > 271 ==================================================== > 272 ◇変数処理 > 273 > 274  変数名はアルファベット一文字、a-z, A-Z の52個が使えます。 > 275 > 276   例 (let a 25) > 277     (let b 10) > 278     (+ %a %b) > 279 > 280  最後の足し算の計算結果は 35 になります。 > 281  letで変数に値を代入して、%変数名、で入れた値を取り出せます。 > 282 > 283   例 (let d (arc d)) > 284     (cmd a -d%d (list\*.*)) > 285 > 286  変数には文字列も入るので、上のような使い方も可能です。 > 287 > 288 ==================================================== > 289 ◇使うときに注意が必要な文字 > 290 > 291  送りたいコマンドや圧縮レベル名などに %"() の4種類の字を > 292  そのまま書くとバグります。 > 293  それぞれ %%, %", %(, %) というように前に % を付けて下さい。 > 294 > 295 ==================================================== > 296 ◇全functionリファレンス > 297 > 298  ★実行制御系 > 299 > 300   (exec ...) > 301 > 302 機能:左から順に、単純に引数を実行していく > 303 返値:最後の引数の値 > 304 > 305   (if A B C) > 306 > 307 機能:Aが真ならBを実行。Cがある場合,Aが偽ならCを実行 > 308 返値:実行した方の文(BかC)の値 > 309 > 310   (while A B) > 311 > 312 機能:Aが真である間、Bを繰り返し実行 > 313 返値:無し > 314 > 315  ★代入系 > 316 > 317   (let A B) > 318 > 319 機能:変数Aに、Bを代入。 > 320 ※Aには、変数名から%を除いた文字が入る。 > 321 返値:Aに入った値 > 322 > 323  ★演算系 > 324 > 325   ( + A B) … A+B > 326   ( - A B) … A−B > 327   ( * A B) … A×B > 328   ( / A B) … A÷B > 329   (mod A B) … AをBで割った余り > 330 > 331   ( = A B) … AとBが等しければ真、等しくなければ偽 > 332   ( ! A B) … AとBが等しければ偽、等しくなければ真 > 333   ( ! A)   … Aが偽なら、真なら偽 > 334   ( < A B) … A < B なら真、でなければ偽 > 335   ( > A B) … A > B なら真、でなければ偽 > 336   (between A B C) … A <= B <= C なら真、それ以外なら偽 > 337 > 338   ( + A B) … A or B (足し算は、論理和にも使えます) > 339   ( * A B) … A and B(掛け算は、論理積にも使えます) > 340 > 341  ★load: 系 > 342 > 343 (name A) > 344 (type A B C D ...) > 345 > 346 上の説明通り。 > 347 > 348   (use A B C D ...) > 349 > 350     そのb2eで、nameで指定したexe以外に利用するファイルがあるなら > 351     このuseによって設定します。例えば > 352      ex) (use sfx32gui.dat zcrypt23.dll) > 353     などと書いておくと、Noahのバージョン情報に、sfx32gui.datなどが > 354     表示されるようになります。ただし、ここに書いたからと言って > 355     実際の圧縮解凍作業に変化はありません。 > 356 > 357  ★その他のセクションで使えるもの(単純) > 358 > 359 (dir) > 360 > 361 基準フォルダ名を「ショートファイル名・フルパス」で返します。 > 362 decode:中は解凍先、encode:中は圧縮元 sfx:中は作業ディレクトリ > 363 をたぶん返します。 > 364 > 365 (is_folder) > 366 > 367 ドロップされたものがフォルダ一つだったら真、でなければ偽。 > 368 > 369 (is_file) > 370 > 371 ドロップされたものがファイル一つだったら真、でなければ偽。 > 372 > 373 (is_multiple) > 374 > 375 ドロップされたものが複数だったら真、でなければ偽。 > 376 > 377 (cd A) > 378 > 379 カレントディレクトリをAに設定します。 > 380 > 381 (method A) > 382 > 383 encode: encode1: sfxd: の時のみ意味があります。 > 384 単に (method) と書くと、ユーザーが指定した圧縮レベルを返します。 > 385 (method 1) などと書くと、指定したレベルが 1 かどうかの真偽を返します。 > 386 > 387 (size A) > 388 > 389 ファイルAのサイズをバイト単位で返します。 > 390 > 391   (slash A) > 392 > 393     文字列Aの中の \ を / に置き換えた文字列を返します。 > 394     Unix系のコマンドで \ をディレクトリと認識してくれないもの向けに。 > 395 > 396   (find A) > 397 > 398     名前がAのファイルをPATHの通ったディレクトリから探し、 > 399     見つかったらフルパス、見つからなければ偽を返します。 > 400      ex) (if (find notepad.exe) (....)) > 401     notepad.exeがある時だけ何か実行。 > 402      ex) (let s (find stubwin.sfx)) (cmd s %s (arc)) > 403     stubwin.sfxをシステムフォルダなどから探してきてsにそのフルパスを入れる。 > 404 > 405 (cmd ARG1 ARG2 ARG3 ...) > 406 > 407 (name)で指定した実行ファイルへコマンドを送ります。 > 408 上では(arc)は自動置き換え…とか書きましたが、 > 409 functionを使っているので当然の如く > 410 (cmd ##(arc)##) > 411 とかやっても ##c:\windows\install.cab## というコマンドが送られたりはしません。 > 412 つまり、スペースで離された一パラメータの場合しか置き換えは効かないわけです。 > 413 そうでない置き換えをしたいときには、(let) で一旦変数に代入してから > 414 変数名を埋め込めばOKです。 > 415     (cmd)命令自体の値は、実行の終了コードとなります。 > 416      ex) (if (! 0 (cmd ...)) エラー処理) > 417     xcmdについても同様。 > 418 > 419 (xcmd A ARG1 ARG2 ...) > 420 > 421 外部コマンド呼び出し。 > 422 最初に実行ファイル名を書いて、以降のパラメータでコマンドを書きます。 > 423 (xcmd del A) とか (xcmd copy B C) など、DOSの内部コマンドの起動も可能。 > 424 > 425  ★その他のセクションで使えるもの(複雑) > 426 > 427 (input MESSAGE DEFAULT) > 428 > 429 ユーザーに文字列を入力させるときに使います。入力を促すメッセージを > 430 第一引数に、デフォルトの入力値を第二引数に書いて下さい(省略可能)。 > 431 入力された文字列が値として返されます。 > 432 (let p (input "パスワードを入れてね")) > 433 (cmd x -p%p (arc)) > 434 とかそんな感じに利用。 > 435 > 436 (arc[+-].ext [slfnd]) > 437 > 438 書庫名指定。Noah は内部変数として、 > 439  ・書庫のあるフォルダ名 <-- 書庫の存在するDir(解SFX) or 出力先Dir(圧) > 440  ・書庫名(LongFileName) <-- 書庫名(解SFX) or dropした一個目のファイル名(圧) > 441  ・書庫名(ShortFileName) <-- 書庫名(解SFX) or dropした一個目のファイル名(圧) > 442 を持っています。 > 443 > 444 まず右の[slfnd]は置いといて左の部分を解説。 > 445 > 446  (arc … 書庫名をそのままストレートに > 447  (arc. … 書庫名から拡張子を全て除いたもの > 448  (arc.lzh … 書庫名から拡張子を全て除いて、.lzh につけかえたもの > 449  (arc+.lzh … 書庫名の拡張子は取らず、後ろに .lzh をくっつけたもの > 450  (arc-.szip … szipという拡張子だったらそれをとりのぞいたもの、 > 451          # そうでなかったら、後ろに .decompressed をくっつけたもの > 452 > 453 それぞれ > 454  ===解凍・SFX変換時の書庫名指定 > 455  ===CPShrink対策 (--;) > 456  ===圧縮時の普通の書庫名指定 > 457  ===aaa.txt を圧縮するとき書庫名を aaa.txt.gz にしたいとき便利 > 458  ===aaa.txt.gz を解凍するとき名前を aaa.txt に戻したいとき便利 > 459 です。 > 460 > 461 次、[slfnd] の解説。1番目のパラメータにこれらの文字があると、 > 462  s … 書庫名にはShortFileNameを使う > 463  l … 書庫名にはLongFileNameを使う > 464  f … 書庫名はディレクトリ+名前(FullPath)で。 > 465  n … 書庫名は名前(NameOnly)で。 > 466  d … 書庫名はディレクトリ(Direcotry)で。 > 467 という指定になります。 > 468 > 469  s === 短いファイル名しか通さないアーカイバに便利。 > 470  d === 書庫名を直接指定できないで、出力先しか指定できないものに便利。 > 471 > 472 デフォルトオプション( 単に (arc) と書いたときのオプション )は、 > 473  decode: lf > 474  encode: lf > 475  sfx: ln > 476 > 477 例題。書庫名が "c:\programs\あいうえお.lzh" の場合、 > 478 > 479  1) (arc d) > 480  2) (arc-.lzh sn) > 481  3) (arc.cab lf) > 482  4) (arc+.txt ln) > 483 > 484 はそれぞれどうなるでしょう? > 485 > 486 (list[r|\*|\*.*] [slfn]) > 487 > 488 圧縮時に、ファイル名リストを返します。 > 489 slfn は (arc) と同じ。デフォルトは ln。 > 490 \* 等については、ディレクトリ名を渡すときの渡し方指定になります。 > 491 例えば (listr) コマンドを使うと、ディレクトリをワイルドカードで > 492 渡さずにNoahが自力で展開してからexeに渡せます。 > 493 > 494 例題。"c:\file\" の中の "かきくけこ.txt" "abcde.bmp" "xxx"(ディレクトリ) を渡キ場合、 > 495 > 496  5) (list) > 497  6) (list\* s) > 498  7) (list\*.* lf) > 499  8) (list sf) > 500 > 501 はそれぞれどうなるでしょう? > 502 > 503 (resp A) > 504 (resq A) > 505 > 506 引数の内容を改行で区切ってテンポラリファイルに出力し、そのテンポラリ > 507 ファイルのファイル名を返します。respは、引数A内の二重引用符を消しません。 > 508 resqは、変数A内の二重引用符を消去します。 > 509 (resp@ A) とすると "@tempfilename"、(resp-o A) とすると "-otempfilename" > 510 のような返し方も可能です。 > 511 > 512 言ってしまえば、 > 513 (cmd -a -mz (arc.cab) (resp@ (listr))) > 514 という使い方を想定しています。 > 515 > 516 > 517 > 518 15.例題の答え ------------------------------------------------- > 519 > 520 1) c:\programs\ > 521 2) あいう~1 > 522 3) c:\programs\あいうえお.cab > 523 4) あいうえお.lzh.txt > 524 5) かきくけこ.txt abcde.bmp xxx > 525 6) かきく~1.txt abcde.bmp xxx\* > 526 7) c:\file\かきくけこ.txt c:\file\abcde.bmp c:\file\xxx\*.* > 527 8) c:\file\かきく~1.txt c:\file\abcde.bmp c:\file\xxx > 528 > 529 > 530 > 531 > 532 > 533 > 534 > 535 > 536 > 537 > 538 =★ > 539 =★ 第三部 > 540 =★ > 541 > 542 16.list:セクション、(scan) ----------------------------------- > 543 > 544  前述の decode1: セクションと、今から説明する list: セクションを > 545  追加することで、外部exeを利用するタイプのb2eでも書庫内容閲覧を > 546  行えるようになります。万能ではありません。うまく行けば儲けモノ。(^^; > 547 > 548  list: セクションでは普通、次のfunctionを使って格納ファイル名の > 549  リストを手に入れます。 > 550 > 551   (scan A B C D E command...) > 552 > 553  まず command... というコマンドを実行し、その出力を解析します。 > 554  つまり、command... にはリスト表示コマンドを書くことになります。 > 555 > 556  解析オプション A,B,C,D,E は次のような意味です。 > 557 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > 558  Aで始まる行の B行後ろから Cで始まる行の直前まで D行ずつ読み、 > 559  先頭E文字飛ばしてファイル名として読み込み。 > 560 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > 561 > 562  具体例を見て行きましょう。 > 563 > 564 > 565 > 566 > 567 例1)7za.exe の出力結果 ++++++++++++++++++++++++++++++++++++++++++++++++++++ > 568 > 569 7-Zip (A) 2.30 Beta 10 Copyright (c) 1999-2002 Igor Pavlov 2002-01-11 > 570 > 571 Listing archive: b2e.7z > 572 > 573 Date Time Attr Size Compressed Name > 574 ------------------- ----- ------------ ------------ ------------ > 575 2002-01-19 00:20:48 ....A 459 103732 b2e\7z.b2e > 576 2002-01-19 11:39:38 ....A 212 0 b2e\bh.b2e > 577 2002-01-19 00:37:34 ....A 193 0 b2e\bix.b2e > 578 2002-01-19 12:04:52 ....A 200 0 b2e\j.b2e > 579 2002-01-19 00:19:46 ....A 215 0 b2e\rk.b2e > 580 2002-01-19 12:04:32 ....A 231 0 b2e\sbc.b2e > 581 2002-01-19 00:54:16 ....A 199 0 b2e\uha.b2e > 582 2002-01-19 12:10:44 ....A 426044 0 Noah.exe > 583 ------------------- ----- ------------ ------------ ------------ > 584 427753 103732 8 files > 585 > 586 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > 587 > 588 "---"で始まる行の1行後ろから、"---"で始まる行の直前まで1行ずつ読み、 > 589 先頭53文字飛ばして、残りがファイル名となっています。従って、b2eの書き方は > 590 > 591 list: > 592 (scan "---" 1 "---" 1 53 l (arc)) > 593 > 594 となります。 > 595 > 596 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > 597 > 598 > 599 > 600 例2)imp.exe の出力結果 ++++++++++++++++++++++++++++++++++++++++++++++++++++ > 601 > 602 IMP 1.12 High-Performance Archiver. Copyright 1998-2000 Technelysium Pty Ltd. > 603 > 604 Name/Comment > 605 Size Created Modified Attr OS Unit > 606 ---------- ------------------- ------------------- ----- ----- --------- > 607 b2e\j.b2e > 608 196 Jan 19 2002 12:22am Jan 19 2002 12:12pm A.... Win32 1 > 609 b2e\uha.b2e > 610 199 Jan 19 2002 12:38am Jan 19 2002 12:54am A.... Win32 1 > 611 b2e\bix.b2e > 612 195 Jan 19 2002 12:34am Jan 19 2002 12:12pm A.... Win32 1 > 613 b2e\bh.b2e > 614 214 Jan 19 2002 12:58am Jan 19 2002 12:13pm A.... Win32 1 > 615 b2e\7z.b2e > 616 461 Jan 18 2002 06:11pm Jan 19 2002 12:12pm A.... Win32 1 > 617 b2e\sbc.b2e > 618 233 Jan 19 2002 11:52am Jan 19 2002 12:14pm A.... Win32 1 > 619 b2e\rk.b2e > 620 217 Nov 26 2001 09:52am Jan 19 2002 12:13pm A.... Win32 1 > 621 b2e\imp.b2e > 622 235 Jan 19 2002 12:21pm Jan 19 2002 12:24pm A.... Win32 1 > 623 Noah.exe > 624 426044 Nov 25 2001 10:08pm Jan 19 2002 12:19pm A.... Win32 1 > 625 > 626 Total: 427994 bytes in 9 files > 627 Compressed size: 104730 bytes (24% of original) > 628 Newest file modified Jan 19 2002 12:24pm > 629 > 630 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > 631 > 632 "---"で始まる行の1行後ろから、空行の直前まで2行ずつ読み、 > 633 先頭0文字飛ばしたところがファイル名となっています。従って、b2eの書き方は > 634 > 635 list: > 636 (scan "---" 1 "" 2 0 v (arc)) > 637 > 638 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > 639 > 640 > 641 > 642 Eは「先頭E文字飛ばして」の意味と書きましたが、これでは不十分な場合があります。 > 643 ファイル名が右揃えになっていて、左端が一定ではない場合など。このようなときには、 > 644 「頭から○番目の固まり」という形で指定したくなります。 > 645 > 646 > 647 > 648 例3)sbc.exe の出力結果 ++++++++++++++++++++++++++++++++++++++++++++++++++++ > 649 > 650 トトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトト > 651 ョョ SBC v0.910 beta Copyright (c) 2000-2001 Sami J. M・inen (sjm@pp.inet.fi) ッッ > 652 UNREGISTERED VERSION! Evaluate 30 days, then please register! See the docs! > 653 トトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトト > 654 Listing archive: "b2e.SBC"... > 655 Filename Size Date Time Attr. > 656 -------- ---- ---- ---- ----- > 657 b2e/j.b2e 199 01/19/2002 00:33:16 A > 658 b2e/uha.b2e 199 01/19/2002 00:54:16 A > 659 b2e/bix.b2e 193 01/19/2002 00:37:34 A > 660 b2e/7z.b2e 459 01/19/2002 00:20:48 A > 661 b2e/rk.b2e 215 01/19/2002 00:19:46 A > 662 b2e/bh.b2e 212 01/19/2002 11:39:38 A > 663 b2e/sbc.b2e 210 01/19/2002 11:59:50 A > 664 Noah.ilk 807600 01/19/2002 00:17:50 A > 665 UNACEV2.DLL 75264 12/27/2001 02:00:00 A > 666 Noah.exe 426044 01/19/2002 00:17:52 A > 667 > 668 Archive contains 10 files, 1310595 bytes of original data. > 669 > 670 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > 671 > 672 " --------"で始まる行の1行後ろから、空行の直前まで > 673 1行ずつ読み、先頭から1つ目の固まりがファイル名です。というわけで > 674 > 675 list: > 676 (scan " --------" 1 "" 1 -1 l (arc)) > 677 > 678 となります。ブロック単位で指定したいときは、マイナスをつけて指定します。 > 679 > 680 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > 681 > 682 > 683 (scan A B C D E command...) > 684    Aで始まる行の B行後ろから Cで始まる行の直前まで D行ずつ読み、 > 685    先頭E文字飛ばしてファイル名として読み込み。 > 686 > 687  特別な仕様。 > 688   Aを "" にした場合、「先頭からB行目」から読むようになります。 > 689   「""で始まる行のB行後ろから」ではなくて。 > 690 > 691   Cを "" にした場合、「空行の直前まで」になります。 > 692   「""で始まる行(どんな行にも当てはまってしまう)まで」ではなくて。 > 693 > 694 (xscan A B C D E command...) > 695    Aで始まる行の B行後ろから Cで始まる行の直前まで D行ずつ読み、 > 696    先頭E文字飛ばしてファイル名として読み込み。 > 697    command... の一個目に、外部実行ファイルを指定します。

Added Release/b2e/jak.b2e version [7b5cec1d704bffa0]

> 1 load: > 2 (name Jack32.dll) > 3 (type jak 1.20MB *1.44MB) > 4 > 5 check: > 6 > 7 decode: > 8 (cmd -c (arc) (dir)) > 9 > 10 decode1: > 11 (cmd -c (arc) (dir)) > 12 > 13 encode1: > 14 (if (method 1) (cmd -r -m0 -v:1213 (list) (arc d))) > 15 (if (method 2) (cmd -r -m0 -v:1423 (list) (arc d))) > 16 > 17 sfxd: > 18 (if (method 1) (cmd -r -m1 -v:1213 (list) (arc d))) > 19 (if (method 2) (cmd -r -m1 -v:1423 (list) (arc d)))

Added Release/caldix.exe version [283b6be610acf226]

cannot compute difference between binary files

Added Release/html/cmpr.png version [97b379c3ee862c55]

cannot compute difference between binary files

Added Release/html/efaq.htm version [bd495666d3e3810a]

> 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"> > 2 <html><head> > 3 <meta http-equiv="Content-Type" content="text/html"> > 4 <meta http-equiv="Content-Style-Type" content="text/css"> > 5 <link rel="stylesheet" media="all" href="noahman.css"> > 6 </head><body> > 7 > 8 <h2><a name="1">1. I can't extract Any archive by Noah!</a></h2> > 9 <p> > 10 Have you <a href="eusage.htm#DLL">installed the DLLs</a> ? > 11 </p> > 12 > 13 <h2><a name="2">2. Where to get DLL?</a></h2> > 14 <p> > 15 <a href="eusage.htm#DLL">Here</a>. > 16 </p> > 17 > 18 </body></html>

Added Release/html/eindex.htm version [c6448e140b68aa3d]

> 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"> > 2 <html><head> > 3 <meta http-equiv="Content-Type" content="text/html"> > 4 <meta http-equiv="Content-Style-Type" content="text/css"> > 5 <link rel="stylesheet" media="all" href="index.css"> > 6 </head><body> > 7 > 8 <div class="navi"><a href="jmanual.htm" target="_parent">Japanese</a> | English< > 9 > 10 <ol> > 11 <li><a href="etop.htm" target="Main">TOP</a><ul></ul></li> > 12 <li>TO RUN NOAH...<ul> > 13 <li><a href="eusage.htm#DLL" target="Main">Get DLLs</a></li> > 14 </ul></li> > 15 <li>USAGE<ul> > 16 <li><a href="eusage.htm#cmpr" target="Main">Compression</a></li> > 17 <li><a href="eusage.htm#extr" target="Main">Extraction</a></li> > 18 <li><a href="eusage.htm#view" target="Main">View</a></li> > 19 <li><a href="eusage.htm#conf" target="Main">Configuration</a></l > 20 </ul></li> > 21 <li>FAQ<ul> > 22 <li><a href="efaq.htm#1" target="Main">I can't extract Any archi > 23 <li><a href="efaq.htm#2" target="Main">Where to get DLL?</a></li > 24 </ul></li> > 25 <li>INFOMATION<ul> > 26 <li><a href="esonota.htm#nysl" target="Main">license</a></li> > 27 <li><a href="esonota.htm#address" target="Main">about us</a></li > 28 </ul></li> > 29 </ol> > 30 > 31 </body></html>

Added Release/html/emanual.htm version [0c11afbfc0c74426]

> 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"> > 2 <html><head> > 3 <meta http-equiv="Content-Type" content="text/html"> > 4 <title>Noah User's Manual</title> > 5 </head><frameset cols="200,*"> > 6 > 7 <frame src="eindex.htm" name="Menu" frameborder="0"> > 8 <frame src="etop.htm" name="Main" frameborder="0"> > 9 > 10 <noframes><body><p> > 11 <a href="eindex.html">INDEX</a> > 12 </p><p> > 13 You should view this manual using the browser which supports 'FRAME' ... > 14 </p></body></noframes> > 15 > 16 </frameset></html>

Added Release/html/esonota.htm version [aa33baeb81b75ef6]

> 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"> > 2 <html><head> > 3 <meta http-equiv="Content-Type" content="text/html"> > 4 <meta http-equiv="Content-Style-Type" content="text/css"> > 5 <link rel="stylesheet" media="all" href="noahman.css"> > 6 </head><body> > 7 > 8 <h2><a name="nysl">License( NYSL version 0.9982en )</a></h2> > 9 <pre> > 10 A. This software is &quot;Everyone'sWare&quot;. It means: > 11 Anybody who has this software can use it as if you're > 12 the author. > 13 > 14 A-1. Freeware. No fee is required. > 15 A-2. You can freely redistribute this software. > 16 A-3. You can freely modify this software. And the source > 17 may be used in any software with no limitation. > 18 > 19 B. The author is not responsible for any kind of damages or loss > 20 while using or misusing this software, which is distributed > 21 &quot;AS IS&quot;. No warranty of any kind is expressed or implied. > 22 You use AT YOUR OWN RISK. > 23 </pre> > 24 > 25 <h2><a name="address">About Us</a></h2> > 26 <address><dl> > 27 <dt>K.INABA ( <a href="http://www.kmonos.net/index.en.html" target="_top">kMonos > 28 Program. > 29 </dd><dt>SB ( <a href="http://homepage3.nifty.com/scriba/" target="_top">SB Room > 30 Icon Design. > 31 </dd></dl></address> > 32 > 33 </body></html>

Added Release/html/etop.htm version [89e511bda5a9f2fb]

> 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"> > 2 <html><head> > 3 <meta http-equiv="Content-Type" content="text/html"> > 4 <meta http-equiv="Content-Style-Type" content="text/css"> > 5 <link rel="stylesheet" media="all" href="noahman.css"> > 6 </head><body> > 7 > 8 <h1>Noah User's Manual</h1> > 9 <p class="intro"> > 10 Thank you for downloading Noah! > 11 </p><p class="intro"> > 12 This document is a manual for &quot;Noah&quot; > 13 - a tiny archiver for Windows 95/98/Me/NT4/2000/XP/2003. > 14 </p> > 15 > 16 </body></html>

Added Release/html/eusage.htm version [95ac972b9757f5f2]

> 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"> > 2 <html><head> > 3 <meta http-equiv="Content-Type" content="text/html"> > 4 <meta http-equiv="Content-Style-Type" content="text/css"> > 5 <link rel="stylesheet" media="all" href="noahman.css"> > 6 </head><body> > 7 > 8 <h2><a name="DLL">DLLs you need</a></h2> > 9 <p> > 10 Most of Noah's compression/decompression engine is offered as DLL file. > 11 You must install those DLLs to '/windows/system' directory to handle correspondi > 12 </p> > 13 <p> > 14 Here is all formats that Noah supports by default. > 15 </p> > 16 <ul> > 17 <li>ace-extract ( <a href="http://www.winace.com/" target="_blank">UnaceV2.dll</ > 18 <li>arj-extract ( <a href="http://www.csdinc.co.jp/archiver/lib/unarj32.html">Un > 19 <li>bza,gza ( <a href="http://www.csdinc.co.jp/archiver/lib/bga32.html">Bga32.dl > 20 <li>cab ( <a href="http://www.csdinc.co.jp/archiver/lib/cab32.html">Cab32.dll</a > 21 <li>cpt-extract ( No Need for DLL )</li> > 22 <li>gca-extract ( <a href="http://www.csdinc.co.jp/archiver/lib/ungca32.html">Un > 23 <li>lzh ( <a href="http://www.csdinc.co.jp/archiver/lib/main-e.html">Unlha32.dll > 24 <li>MSCompress ( No Need for DLL )</li> > 25 <li>rar-extract ( <a href="http://www.csdinc.co.jp/archiver/lib/unrar32.html">Un > 26 <li>tar,gzip,bzip2,compress,cpio ( <a href="http://www.csdinc.co.jp/archiver/lib > 27 <li>yz1 ( <a href="http://www.csdinc.co.jp/archiver/lib/yz1.html">Yz1.dll</a> )< > 28 <li>zip-compress ( <a href="http://www.csdinc.co.jp/archiver/lib/zip32j.html">Zi > 29 <li>zip-extract ( <a href="http://www.csdinc.co.jp/archiver/lib/main-e.html">UnZ > 30 </ul> > 31 <p> > 32 many of these DLLs are take parts in <a href="http://archiver.wakusei.ne.jp/inde > 33 </p> > 34 <p> > 35 You can use 'DLL Download' in StartMenu-&gt;Noah to download and > 36 install these DLLs automatically. Try it. > 37 </p> > 38 > 39 <h2><a name="cmpr">Compression</a></h2> > 40 <p> > 41 Drag-and-Drop files to Noah's icon. Then you'll have an archive at the direcotry > 42 you specified in the configure dialog. > 43 </p> > 44 <p> > 45 If you drop files with 'Ctrl' key pressed, then you can archive them to > 46 an SFX archive (executable and self-extractable archive.)<br> > 47 *) for lzh, cab, bga archives only. > 48 </p> > 49 <p> > 50 When you drop multiple files, normally Noah will pack them to one archive. > 51 But if you drop files with 'Alt' key pressed, then each files is compressed to > 52 different archives. > 53 </p> > 54 > 55 <h2><a name="extr">Extraction</a></h2> > 56 <p> > 57 Drag-and-Drop archives to Noah's icon. Noah automatically decides which operatio > 58 (compress, or extract) to do by analyzing dropped files. > 59 </p> > 60 > 61 <h2><a name="view">View</a></h2> > 62 <p> > 63 When you drop archives with 'Ctrl' key pressed, Noah will go into 'Arc-View-Mode > 64 In this mode, you can directly open files inside the archive, etc. > 65 </p> > 66 > 67 <h2><a name="conf">Configuration</a></h2> > 68 > 69 <h4>Compress Tab</h4> > 70 <p> > 71 <b>Destination Folder:</b> specify where to put the arhive.<br> > 72 <b>Method:</b> the type of archive you want to create. 'zip' - 'normal' is recom > 73 <b>Which-To-Do:</b> > 74 Noah automatically decides whick operation - Compress or Extract - to do. > 75 You can change this decision's rule here.<br> > 76 mode-1 = gives priority to 'Compress' operation.<br> > 77 mode-2 = gives priority to 'Extract' operation. (default)<br> > 78 </p> > 79 > 80 <h4>Extract Tab</h4> > 81 <p> > 82 <b>Destination Folder:</b> specify where to put the extracted files.<br> > 83 <b>Create Directory etc:</b> automatically create a directory with same name of > 84 </p> > 85 > 86 <h4>Windows Tab</h4> > 87 <p> > 88 <b>Association:</b> After checking these boxes, you can extract archives by Doub > 89 <b>D&amp;D Shell Extension:</b> On the menu shown at D&amp;D in explorer by righ > 90 <b>Shortcut:</b> Shortcut.<br> > 91 </p> > 92 > 93 <h4>About Tab</h4> > 94 <p> > 95 Show the version of Noah and installed DLLs. > 96 </p> > 97 > 98 </body></html>

Added Release/html/extr.png version [38b56a686467a884]

cannot compute difference between binary files

Added Release/html/faq.htm version [a10680a2232cfddd]

> 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"> > 2 <html lang="ja"><head> > 3 <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS"> > 4 <meta http-equiv="Content-Style-Type" content="text/css"> > 5 <link rel="stylesheet" media="all" href="noahman.css"> > 6 </head><body> > 7 > 8 <h2>Q:DLL自動ダウンロードしたのに、UnaceV2.dll が入っていません。</h2> > 9 <p> > 10 このDLLに関しては、自動ダウンロードが出来ません。 > 11 申し訳ありませんが、UnaceV2.dllが必要な方は手動でインストールして下さい。 > 12 </p> > 13 > 14 <h2>Q:圧縮って何?書庫って?SFXって?ドラッグ&ドロップって?</h2> > 15 <p> > 16 「用語集」を見てください。 > 17 </p> > 18 > 19 <h2>Q:15個くらいのファイルを圧縮しようとしたら、 > 20 「アクセスは拒否されました」と出て圧縮できません。</h2> > 21 <p> > 22 これは、Windows のバグです。Noah でこれを回避して圧縮するには、 > 23 [ 設定ダイアログを開いてそこにドラッグ&ドロップ ] という方法をとって下さい。 > 24 </p> > 25 > 26 <h2>Q:圧縮してもほとんど小さくなりません。<br> > 27 Q:圧縮するとサイズが増えます。</h2> > 28 <p> > 29 世の中には、<em>実は既に圧縮してある</em>ファイルがたくさんあります。よく > 30 使われるものの中では、デジカメで撮った写真(JPEG形式)や、ホームページの画像 > 31 ファイル(GIF,PNG形式)、音楽ファイル(MP3,WMA形式)などが該当します。これらの > 32 ファイルは、何せ既に圧縮してあるため、Noahでそれ以上に小さくする事は不可能です。 > 33 むしろ、逆に大きくなってしまうこともあり得ます。 > 34 </p> > 35 <p> > 36 サイズが増えてしまう点については、多分「圧縮」という用語が > 37 パソコンの話になると普通とちょっと違って特殊なのが原因の誤解かも知れません。 > 38 例えばNoahで sample.html という 100KB のファイルを圧縮すると、 > 39 sample.html のサイズが減って 50KB に…は<em>なりません</em>。 > 40 </p> > 41 <p> > 42 sample.html ファイルはそのまま残して置いて、sample.lzh という > 43 別のファイルを作ります。この sample.lzh が sample.html を > 44 圧縮したものになりますので、sample.lzh の方だけメールで送るなど > 45 すれば、受け取った方がそれを解凍して sample.html が手に入ることに > 46 なります。 > 47 </p> > 48 <p> > 49 元のファイルはそのままで、別に圧縮したファイルをつくるので、 > 50 ちょっと見には、サイズは増えてしまうわけですね。 > 51 どちらかというと「圧縮」と言うよりは「<em>縮小コピー</em>」という感覚です。 > 52 </p> > 53 > 54 <h2>Q:[abc].txt や -def-.doc という名前のファイルが圧縮できない</h2> > 55 <p> > 56 '[' や ']' を含んでいたり、'-' で始まるファイルを処理しようとすると、 > 57 誤動作することが多いです。申し訳ありませんが、ファイル名を変更するか > 58 適当なフォルダに移してから、フォルダごと圧縮してください。 > 59 </p> > 60 > 61 <h2>Q:圧縮してからJAK分割しようと思ったのにNoahに送ったら解凍されてしまいますB</h2> > 62 <p> > 63 分割の時だけ、設定を「常に圧縮」に変えて圧縮して下さい。 > 64 でないと書庫だから解凍してしまいます。 > 65 一度だけ設定を変える変え方は、<br> > 66 1.Shiftを押しながらドラッグ&ドロップ<br> > 67 2.出てくるダイアログで「圧縮専用」「jak」を選ぶ<br> > 68 3.Shiftを押しながらキャンセルを押す<br> > 69 </p> > 70 > 71 <h2>Q:Shiftで送ったらメモ帳が開きます。</h2> > 72 <p> > 73 窓の手などのカスタマイズソフトで、 > 74 「未登録ファイルはとりあえずメモ帳で開く」的設定にしていると > 75 この問題が発生します。Noahではどうしようもないのでそのカスタマイズを > 76 やめるか、Noahの設定は普通のダブルクリックで行って下さるようお願いします。 > 77 </p> > 78 > 79 <h2>Q:書庫アイコンを他のものに変えたい。</h2> > 80 <p> > 81 <a href="http://homepage3.nifty.com/scriba/manu/icon.html">Noahのアイコンを変え</a> > 82 にアイコン変更方法が書かれています。また、このページからのリンクをたどると、 > 83 Noah用アイコンセットが幾つか手に入ります。お好きな物をどうぞ。 > 84 作者のK.INABAは標準のアイコンが好きなんですけどねー。(^^; > 85 </p> > 86 > 87 </body></html>

Added Release/html/icon.htm version [5cd97c2814d58cbd]

> 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"> > 2 <html lang="ja"><head> > 3 <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS"> > 4 <meta http-equiv="Content-Style-Type" content="text/css"> > 5 <link rel="stylesheet" media="all" href="noahman.css"> > 6 </head><body> > 7 > 8 <h2>書庫アイコン変更について</h2> > 9 <p> > 10 2004/08/04 リリースの Noah version 3.194 にて、 > 11 Noahで扱う書庫ファイル(圧縮ファイル)のアイコンを変更しました。 > 12 これまで > 13 </p> > 14 <p> > 15 <img src="old_lzh.gif"> > 16 <img src="old_zip.gif"> > 17 </p> > 18 <p> > 19 のような「卵と雛」の絵で圧縮ファイルが表示されていましたが、新しいバージョンでは、 > 20 </p> > 21 <p> > 22 <img src="new_lzh.gif"> > 23 <img src="new_zip.gif"> > 24 </p> > 25 <p> > 26 のような「手紙と羽ペン」の絵になります。よろしくお願いします。 > 27 </p> > 28 > 29 <h2>Q&A: 3.194を入れてもアイコンが変わりません。</h2> > 30 <p> > 31 一度Noahの設定画面を開いて[Windows拡張]を選び、[関連づけ]の枠内の > 32 チェックを全て外し、[適用]を押してください。その後、もう一度 > 33 チェックを全て付け直して、再度[適用]を押します。これで、 > 34 新しいアイコン画像に置き換わると思います。 > 35 </p> > 36 > 37 <h2>Q&A: 他のアイコンに変えたい</h2> > 38 <p> > 39 <a href="http://homepage3.nifty.com/scriba/">SB Room</a>に、 > 40 Noah用アイコンセットが多数公開されています。是非ご覧下さい。 > 41 </p> > 42 > 43 > 44 <h2>Q&A: 7z形式じゃない書庫が7zのアイコンになっちゃいました。</h2> > 45 <p> > 46 お手数ですが、もう一度Noahの設定画面を開いて、関連づけのやり直しをお願いします。 > 47 手順は、二つ上の"Q&A: 3.194を入れてもアイコンが変わりません。"に書いてある > 48 通りです。 > 49 </p> > 50 > 51 > 52 </body></html>

Added Release/html/index.css version [78a560ccca7ad577]

> 1 > 2 body { > 3 color: #330; > 4 background: #f5fff5; > 5 margin: 0.5em; > 6 } > 7 > 8 div.navi { > 9 font-size: smaller; > 10 text-align: center; > 11 font-weight: bolder; > 12 margin-bottom: 1em; > 13 } > 14 > 15 a { > 16 color: blue; > 17 text-decoration: none; > 18 } a:hover { > 19 color: #090; > 20 background: transparent url("niji.gif") repeat-x bottom; > 21 } > 22 > 23 ol { > 24 margin-left: 1.5em; > 25 padding: 0; > 26 } > 27 ul { > 28 margin: 1em 0 1em 0.5em; > 29 list-style-type: square; > 30 padding: 0; > 31 } > 32 li { > 33 margin-bottom: 0.1em; > 34 }

Added Release/html/index.htm version [a885357b95170201]

> 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"> > 2 <html lang="ja"><head> > 3 <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS"> > 4 <meta http-equiv="Content-Style-Type" content="text/css"> > 5 <link rel="stylesheet" media="all" href="index.css"> > 6 </head><body> > 7 > 8 <div class="navi">Japanese | <a href="emanual.htm" target="_parent">English</a>< > 9 > 10 <ol> > 11 <li><a href="top.htm" target="Main">表紙</a><ul></ul></li> > 12 <li>使い方:基礎編<ul> > 13 <li><a href="usage0.htm" target="Main">Noahを使う下準備</a></li> > 14 <li><a href="usage1.htm#cmpr" target="Main">圧縮する</a></li> > 15 <li><a href="usage1.htm#extr" target="Main">解凍する</a></li> > 16 <li><a href="usage1.htm#sfx" target="Main">自己解凍形式圧縮</a></li> > 17 <li><a href="usage1.htm#conf" target="Main">設定変更</a></li> > 18 <li><a href="usage0.htm#uninst" target="Main">アンインストール</a></li> > 19 </ul></li> > 20 <li>使い方:発展編<ul> > 21 <li><a href="usage2.htm#each" target="Main">個別圧縮</a></li> > 22 <li><a href="usage2.htm#view" target="Main">書庫内閲覧モード</a></li> > 23 <li><a href="usage2.htm#format" target="Main">Noahで扱える形式</a></li> > 24 <li><a href="usage2.htm#mode" target="Main">動作モードについて</a></li> > 25 <li><a href="usage2.htm#cmdline" target="Main">コマンドライン</a></li> > 26 <li><a href="usage2.htm#iniconfig" target="Main">隠し設定</a></li> > 27 </ul></li> > 28 <li>用語集<ul> > 29 <li><a href="yougo.htm#cmpr" target="Main">圧縮・解凍</a></li> > 30 <li><a href="yougo.htm#arc" target="Main">書庫・アーカイブ</a></li> > 31 <li><a href="yougo.htm#sfx" target="Main">自己解凍形式</a></li> > 32 <li><a href="yougo.htm#dnd" target="Main">ドラッグ&ドロップ</a></li> > 33 </ul></li> > 34 <li><a href="faq.htm" target="Main">よくある質問</a><ul> > 35 </ul></li> > 36 <li>その他<ul> > 37 <li><a href="sonota.htm#history" target="Main">更新履歴</a></li> > 38 <li><a href="sonota.htm#nysl" target="Main">利用条件</a></li> > 39 <li><a href="sonota.htm#link" target="Main">参考サイト</a></li> > 40 <li><a href="sonota.htm#address" target="Main">連絡先</a></li> > 41 </ul></li> > 42 </ol> > 43 > 44 </body></html>

Added Release/html/jmanual.htm version [ff729b89c6d9e4f4]

> 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"> > 2 <html><head> > 3 <meta http-equiv="Content-Type" content="text/html"> > 4 <title>Noah User's Manual</title> > 5 </head><frameset cols="200,*"> > 6 > 7 <frame src="index.htm" name="Menu" frameborder="0"> > 8 <frame src="top.htm" name="Main" frameborder="0"> > 9 > 10 <noframes><body><p> > 11 <a href="index.html">INDEX</a> > 12 </p><p> > 13 You should view this manual using the browser which supports 'FRAME' ... > 14 </p></body></noframes> > 15 > 16 </frameset></html>

Added Release/html/new_lzh.gif version [8ea25d28eed6a0ef]

cannot compute difference between binary files

Added Release/html/new_zip.gif version [502c1b5198b47cff]

cannot compute difference between binary files

Added Release/html/niji.gif version [6b7500f1fcb9a0bc]

cannot compute difference between binary files

Added Release/html/noahman.css version [ba993fdb0954e0a7]

> 1 > 2 body { > 3 color: #330; > 4 background: #fff5ff; > 5 margin: 1em; > 6 padding: 0; > 7 } > 8 > 9 a:link, a:visited, a:active { > 10 color: blue; > 11 text-decoration: none; > 12 } a:hover { > 13 color: #090; > 14 background: transparent url("niji.gif") repeat-x bottom; > 15 } > 16 > 17 h1 { > 18 font-size: 300%; > 19 font-family: fantasy; > 20 font-weight: bolder; > 21 text-align: center; > 22 color: #090; > 23 margin-top: 1em; > 24 margin-bottom: 2em; > 25 } > 26 h2 { > 27 color: black; > 28 background: #eeeed0; > 29 font-size: 120%; > 30 margin-top: 2em; > 31 } > 32 h3 { > 33 color: black; > 34 background: #eeeed0; > 35 font-size: 120%; > 36 } > 37 h4 { > 38 color: #040; > 39 font-size: 80%; > 40 margin-left: 2em; > 41 } > 42 > 43 p { > 44 margin-left: 1em; > 45 } > 46 p.intro { > 47 text-align: center; > 48 } > 49 div.down1 { > 50 margin-left: 2em; > 51 margin-bottom: 1em; > 52 } > 53 > 54 address { > 55 font-style: normal; > 56 margin-left: 1em; > 57 } > 58 > 59 dl { > 60 margin-left: 1em; > 61 } > 62 dd { > 63 margin-left: 2em; > 64 margin-bottom: 1em; > 65 font-size: smaller; > 66 } > 67 ul { > 68 margin-left: 2em; > 69 } > 70 > 71 em { > 72 color: #933; > 73 font-weight: bolder; > 74 font-style: normal; > 75 text-decoration: none; > 76 }

Added Release/html/old_lzh.gif version [1e609520d75a70cc]

cannot compute difference between binary files

Added Release/html/old_zip.gif version [600b4c7ad7768e3f]

cannot compute difference between binary files

Added Release/html/sonota.htm version [c9f99691b6f7fd6d]

> 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"> > 2 <html lang="ja"><head> > 3 <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS"> > 4 <meta http-equiv="Content-Style-Type" content="text/css"> > 5 <link rel="stylesheet" media="all" href="noahman.css"> > 6 </head><body> > 7 > 8 <h2><a name="history">更新履歴</a></h2> > 9 <dl> > 10 <dt>3.199</dt><dd><ul> > 11 <li>インストーラ版添付の caldix のバージョンを 1.21 に更新</li> > 12 <li>標準で tar.xz と tar.lzma の圧縮に対応(最新のTar32.dllが必要です)。 > 13 (関連づけは、設定画面で一端tarの関連づけを外して保存終了してから、 > 14 もう一度tarに関連づけ直してください。.xz と .lzma が Noah に > 15 関連づけされます。)</li> > 16 </ul></dd> > 17 <dt>3.198</dt><dd><ul> > 18 <li>Windows XP SP2 以上でないと動かなくなっていた問題を修正</li> > 19 </ul></dd> > 20 <dt>3.197</dt><dd><ul> > 21 <li>MSVCR100.dll がないと動かなくなっていた問題を修正</li> > 22 </ul></dd> > 23 <dt>3.196</dt><dd><ul> > 24 <li><a href="http://jvn.jp/cert/JVNVU707943/index.html">JVNVU#707943 > 25 : Windows プログラムの DLL 読み込みに脆弱性</a> への対処</li> > 26 <li>初期設定時の圧縮形式を lzh から zip に変更しました</li> > 27 <li>ACEの自己解凍書庫の認識範囲を広げました</li> > 28 <li>Noah.exe 本体をUPX圧縮しないようにしました</li> > 29 <li>b2eに\を/に置き換える(slash A)を追加</li> > 30 <li>Noahの設定画面へのD&Dでの圧縮・展開機能をマニュアルに記載</li> > 31 <li>半角1文字の名前のフォルダを圧縮したものを展開すると、展開後フォルダが開かれネいバグを修正</li> > 32 <li>ACE書庫の書庫内閲覧モードで、圧縮方式の判定が間違っていたのを修正</li> > 33 <li>7-zip 形式での圧縮や展開で、"-" で始まるファイル名を扱えるように修正</li> > 34 <li>b2e を使っていた場合多バイト文字で終わる名前のファイルを圧縮できなかったバグ修正</li> > 35 <li>D&D処理後、Noahがそのまま起動していると出力先フォルダを削除できないバグを修ウ</li> > 36 <li>バッファオーバーフローとリソースリークの危険をいくつか修正</li> > 37 <li>b2eの引き算がおかしかった(常に0になっていた)バグを修正</li> > 38 <li>MSCompress形式での圧縮時にタイムスタンプを元ファイルと合わせるように修正</li> > 39 <li>圧縮/解凍先ディレクトリ設定のエディットボックスにIMEで入力すると文字化けするバグを修正</li> > 40 <li>b2eのscanでファイルをリストアップしたとき最後にゴミが混じるバグを修正</li> > 41 <li>(検索結果などから)異なるディレクトリにある書庫を一括でNoahに渡しても解凍はできるように変更</li> > 42 </ul></dd> > 43 <dt>3.195</dt><dd><ul> > 44 <li>7zの書庫アイコンを追加。</li> > 45 <li>7z書庫の圧縮モードに LZMA(fast), LZMA(std) を追加。</li> > 46 <li>ace書庫,cpt書庫内の絶対パスや".."が含まれている名前のファイルを<br/> > 47    展開しようとしたときに確認メッセージを出すように変更。</li> > 48 <li>jar書庫(Java Archive)を7-zip32.DLLで展開するようにしました。</li> > 49 <li>Noahと同じフォルダにcaldix.iniファイルがあるときには、<br/> > 50    DLLをcaldixのインストール先からも検索するようにしました。<br/> > 51   (ただし、システムフォルダの方が優先です。)</li> > 52 <li>書庫の存在するディレクトリが読込専用かどうかの<br/> > 53    判定ルーチンを変更(まだテスト中)</li> > 54 </ul></dd> > 55 <dt>3.194</dt><dd><ul> > 56 <li>書庫アイコン変更。</li> > 57 <li>GCAの自己解凍書庫が展開できなくなっていたバグ修正。</li> > 58 <li>zipの展開に7-zip32.DLLを優先して使うようにしました。</li> > 59 <li>7z.sfx無しで、7-zip32.DLLのみで7z形式の自己解凍書庫を<br/> > 60   作成できるようにしました。</li> > 61 <li>b2e: xscanコマンドを追加</li> > 62 <li>b2e: ゼロ引数の(cmd)の形を許可</li> > 63 <li>b2e: +が論理OR、*が論理ANDとしても使えるようにしました。</li> > 64 <li>他、細かなバグフィックスを幾つか</li> > 65 </ul></dd> > 66 <dt>3.193</dt><dd><ul> > 67 <li>Win9x 系で、自動判別を行わない場合に圧縮解凍が全くできなくなっていたバグの修正</li> > 68 <li>zip - 7zip形式の設定を圧縮率最優先にした</li> > 69 <li>書庫閲覧モードで、[ファイル数][合計圧縮率][書庫形式] を表示するようにした</li> > 70 <li>iniファイルに隠し設定項目NoExtを追加</li> > 71 </ul></dd> > 72 <dt>3.192</dt><dd><ul> > 73 <li>書庫ファイル中に"explorer.exe"というファイルが存在した場合に<br /> > 74   解凍後にこれを自動実行してしまうセキュリティホールの修正</li> > 75 <li>ファイル名先頭の'.'は拡張子の始まりとみなさないで書庫名を作るようにした<br /> > 76  (例えば、".htaccess"を圧縮するとこれまでは".lzh"という書庫が)<br /> > 77  (出来ましたが、新バージョンでは".htaccess.lzh"になります。)</li> > 78 <li>iniファイルに設定項目MultiBootLimitを追加</li> > 79 </ul></dd> > 80 <dt>3.191</dt><dd><ul> > 81 <li>b2eスクリプトに関する細々としたバグフィックス</li> > 82 <li>メールアドレス、URL変更に伴う付属文書の更新</li> > 83 </ul></dd> > 84 <dt>3.19</dt><dd><ul> > 85 <li>aaa.bbb.ccc を圧縮したら aaa.lzh ではなく aaa.bbb.lzh とするための設定項目をiniファイルに追加。</li> > 86 </ul></dd> > 87 <dt>3.18</dt><dd><ul> > 88 <li>圧縮形式名などのところにマウスを当てるとツールチップ表示するようにした</li> > 89 <li>b2e の (cmd), (xcmd) で終了コードを返すように変更</li> > 90 </ul></dd> > 91 <dt>3.17</dt><dd><ul> > 92 <li>7-zip32.dll対応に関する色々</li> > 93 <li>NT系で、書庫閲覧モードからファイルをドロップ出来ないことが多かったバグ修正</li> > 94 </ul></dd> > 95 <dt>3.16</dt><dd><ul> > 96 <li>MS-Compress形式とb2e利用形式での圧縮率表示が変だったのを修正</li> > 97 <li>iniファイルに設定項目 MiniBoot を追加</li> > 98 <li>UnaceV2.dllなどのバージョン番号も可能なら表示するようにした</li> > 99 <li>b2e: (find) (use) 追加</li> > 100 </ul></dd> > 101 <dt>3.15</dt><dd><ul> > 102 <li>caldix.iniを消し忘れないようにアンインストーラを修正</li> > 103 <li>[閲覧モード] 圧縮後サイズが42MB以上のファイルについて圧縮率表示が変だったの修正</li> > 104 <li>[閲覧モード] 項目のソートを可能にした。</li> > 105 <li>[閲覧モード] 超絶手抜き右クリックメニュー</li> > 106 <li>[b2e] size, <, > の3コマンド追加</li> > 107 <li>[b2e] 数値でない値に対しても = や ! での比較を行えるようにした</li> > 108 </ul></dd> > 109 <dt>3.14</dt><dd><ul> > 110 <li>英語版モードの調整色々(Thanks! > ardryさん</li> > 111 <li>フォルダをドロップしたときの書庫名は、ピリオド以降を除かないように変更</li> > 112 <li>b2e に input コマンド追加</li> > 113 <li>インストーラ版に同梱のcaldixをVer 1.10に</li> > 114 </ul></dd> > 115 <dt>3.131</dt><dd><ul> > 116 <li>'%' の混じった名前のファイルをb2eスクリプトで扱えないバグ修正</li> > 117 </ul></dd> > 118 <dt>3.13</dt><dd><ul> > 119 <li>'@' で始まるファイルの圧縮への対応を強化</li> > 120 <li>書庫内ファイルリストに余計なゴミが表示されることがあったバグ修正</li> > 121 </ul></dd> > 122 <dt>3.12</dt><dd><ul> > 123 <li>解凍先フォルダ名を、「書庫名の最初の . 以降を全部除いたもの」ではなく「書庫シの最後の . 以降を全部除いたもの」にするよう変更。</li> > 124 </ul></dd> > 125 <dt>3.11</dt><dd><ul> > 126 <li>'-'で始まったり'['を含んだりする名前のファイルのzip圧縮を可能にした</li> > 127 <li>zip無圧縮書庫の作成に対応</li> > 128 </ul></dd> > 129 <dt>3.10+</dt><dd><ul> > 130 <li>添付するcaldixのバージョンを1.06に変更しただけ</li> > 131 </ul></dd> > 132 <dt>3.10</dt><dd><ul> > 133 <li>圧縮形式の設定を正しくロード出来ないことがあったバグ修正</li> > 134 <li>b2eに、scan コマンド追加</li> > 135 </ul></dd> > 136 <dt>3.06</dt><dd><ul> > 137 <li>NT系でaceの分割書庫を解凍できなかったバグ修正</li> > 138 <li>b2eに、resp, resq, listr コマンド追加</li> > 139 </ul></dd> > 140 <dt>3.05</dt><dd><ul> > 141 <li>Windows XP 正式対応版です</li> > 142 <li>XP の VisualStyle に対応</li> > 143 <li>NT系でUSモードb2eが動かなかったバグ修正</li> > 144 </ul></dd> > 145 <dt>3.04</dt><dd><ul> > 146 <li>Yz1書庫の内容閲覧を可能にした (YZ1.DLL ver 0.20以上が必要)</li> > 147 <li>コマンドラインオプション -cx, -ca 追加</li> > 148 <li>b2eに、USモードで外部アプリを起動する機能を追加</li> > 149 <li>ライセンスをNYSL 0.99に変更</li> > 150 </ul></dd> > 151 <dt>3.031</dt><dd><ul> > 152 <li>閲覧モードでダブルクリックしてもファイル内容を表示できなくなってたバグ修正</li> > 153 <li>ライセンスをNYSL 0.03に変更</li> > 154 </ul></dd> > 155 <dt>3.03</dt><dd><ul> > 156 <li>DLLでエラーが発生したときその旨表示するようにしたつもり</li> > 157 <li>64KB以上のAce書庫を解凍するときグラフが変だったバグ修正</li> > 158 <li>GCAの空フォルダをファイルと誤認識してたバグを修正</li> > 159 <li>閲覧モードで.hlpをダブルクリックしたとき、作業用に.cntも解凍しておく仕様に変更</li> > 160 <li>manual.htmが無いときにヘルプボタンを押されたらreadme.txtを開くように変更</li> > 161 <li>b2eファイルに反応して関連づけ項目を増やすようにした</li> > 162 <li>b2eオプション追加:(arc.)</li> > 163 </ul></dd> > 164 <dt>3.02</dt><dd><ul> > 165 <li>設定と設定ダイアログが一致しないことがあるバグ修正</li> > 166 <li>SFXや、Password付きのGCA書庫の展開に対応</li> > 167 <li>CPT書庫展開時、ResourceForkのみのファイルも展開するよう変更</li> > 168 <li>CPTの判別強化。以上2点、Thanks! > N2さん</li> > 169 <li>b2eコマンド追加:(del filename)</li> > 170 </ul></dd> > 171 <dt>3.01</dt><dd><ul> > 172 <li>関連付けのチェックボックスグレーアウト処理を正常化</li> > 173 <li>b2eでの0除算を禁止</li> > 174 <li>書庫判定優先順位を変更(拡張子優先気味)</li> > 175 <li>lh6やlh7で圧縮できなかったバグ修正</li> > 176 </ul></dd> > 177 </dl> > 178 <dl> > 179 <dt>3.00</dt><dd><ul> > 180 <li>フルリニューアル</li> > 181 </ul></dd> > 182 </dl> > 183 > 184 <h2><a name="nysl">利用条件等</a>( <a href="http://www.kmonos.net/nysl/">NYSL</a> versio > 185 <pre> > 186 A. 本ソフトウェアは Everyone'sWare です。このソフトを手にした一人一人が、 > 187 ご自分の作ったものを扱うのと同じように、自由に利用することが出来ます。 > 188 > 189 A-1. フリーウェアです。作者からは使用料等を要求しません。 > 190 A-2. 有料無料や媒体の如何を問わず、自由に転載・再配布できます。 > 191 A-3. いかなる種類の 改変・他プログラムでの利用 を行っても構いません。 > 192 A-4. 変更したものや部分的に使用したものは、あなたのものになります。 > 193 公開する場合は、あなたの名前の下で行って下さい。 > 194 > 195 B. このソフトを利用することによって生じた損害等について、作者は > 196 責任を負わないものとします。各自の責任においてご利用下さい。 > 197 > 198 C. 著作者人格権は K.INABA に帰属します。著作権は放棄します。 > 199 > 200 D. 以上の3項は、ソース・実行バイナリの双方に適用されます。 > 201 </pre> > 202 > 203 <h2><a name="link">参考サイト</a></h2> > 204 > 205 <dl> > 206 <dt>統合アーカイバ・プロジェクト(<a href="http://www.csdinc.co.jp/archiver/" target="_top">http:/ > 207 書庫操作関係の共通仕様DLLを作ろう!というプロジェクトです。 > 208 圧縮・解凍に関する情報満載なので、誰でも一度は目を通しておくことをお勧めします。 > 209 </dd><dt>Tomozo(<a href="http://www.tomozo.ne.jp/" target="_top">http://www.tomozo.ne > 210 更新情報お知らせサイトです。ここでメールアドレスを登録すると、 > 211 Noahがバージョンアップしたときに通知メールを受け取れるようになります。 > 212 </dd></dl> > 213 > 214 <h2><a name="address">開発者</a></h2> > 215 <address><dl> > 216 <dt>K.INABA( <a href="http://www.kmonos.net/" target="_top">kMonos.NET</a> )</dt > 217 プログラミング。 > 218 </dd><dt>SB( <a href="http://homepage3.nifty.com/scriba/" target="_top">SB Room< > 219 アイコン製作。 > 220 </dd></dl></address> > 221 > 222 </body></html>

Added Release/html/top.htm version [c3a0bdf7c9b50a6c]

> 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"> > 2 <html lang="ja"><head> > 3 <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS"> > 4 <meta http-equiv="Content-Style-Type" content="text/css"> > 5 <link rel="stylesheet" media="all" href="noahman.css"> > 6 </head><body> > 7 > 8 <h1>Noah User's Manual</h1> > 9 <p class="intro"> > 10 Noahダウンロードありがとうございます。 > 11 </p><p class="intro"> > 12 "Noah"は、Windows 95/98/Me/NT4/2000/XP/2003 上で<br> > 13 ファイルの圧縮・解凍を行うためのソフトです。<br><br> > 14 使用する前に必ず「使い方:基礎編」には<br> > 15 目を通しておいて下さい。 > 16 </p><p class="intro"> > 17 <strong>重要!</strong> > 18 2004/08/04 : <em><a href="icon.htm">書庫アイコン変更について</a></em> > 19 </p> > 20 > 21 </body></html>

Added Release/html/usage0.htm version [abc7a62ad33f523e]

> 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"> > 2 <html lang="ja"><head> > 3 <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS"> > 4 <meta http-equiv="Content-Style-Type" content="text/css"> > 5 <link rel="stylesheet" media="all" href="noahman.css"> > 6 </head><body> > 7 > 8 <h2><a name="dll">Noahを使う下準備 - DLLをインストールしよう! -</a></h2> > 9 <p> > 10 ※この作業は、Noahをインストールするときに<em>DLLの自動インストールを > 11 終わらせた方には必要ありません</em>。もう既にNoahは使えるようになっています。 > 12 </p> > 13 <h3>インターネットへ接続できる場合(お勧め)</a></h3> > 14 <p> > 15 スタートメニューのNoahのところから「<em>DLL自動インストール</em>」を選んで実行して下さい。 > 16 あとは画面の指示に従って操作をすれば、自動でDLLのインストールは完了です! > 17 </p> > 18 > 19 <h3>手動でやる場合</a></h3> > 20 <h4>DLL入手</h4> > 21 <p> > 22 <a href="http://archiver.wakusei.ne.jp/" target="_blank">統合アーカイバプロジェNト</a>から > 23 ダウンロードするか、雑誌の付録等で手に入れてください。 > 24 <em>Unlha32.dll と UnZip32.dll</em> があればとりあえずは十分です。 > 25 </p> > 26 <h4>インストール</h4> > 27 <p> > 28 手に入れたDLLは、最初は電子レンジの絵のファイルになっているはずです。 > 29 それを実行して、画面の指示に従っていけば、あとは自動でインストールされます。 > 30 これでNoahを使う準備は完了です。 > 31 </p> > 32 > 33 <h3>Noahで使える全DLL(参考資料)</a></h3> > 34 <li><a href="http://www.winace.com/" target="_blank">UnaceV2.dll</a></li > 35 <li><a href="http://www.csdinc.co.jp/archiver/lib/unarj32.html">Unarj32j > 36 <li><a href="http://www.csdinc.co.jp/archiver/lib/bga32.html">Bga32.dll< > 37 <li><a href="http://www.csdinc.co.jp/archiver/lib/cab32.html">Cab32.dll< > 38 <li><a href="http://www.csdinc.co.jp/archiver/lib/jack32.html">Jack32.dl > 39 <li><a href="http://www.csdinc.co.jp/archiver/lib/ungca32.html">UnGCA32. > 40 <li><a href="http://www.csdinc.co.jp/archiver/lib/unlha32.html">Unlha32. > 41 <li><a href="http://www.csdinc.co.jp/archiver/lib/unrar32.html">Unrar32. > 42 <li><a href="http://www.csdinc.co.jp/archiver/lib/tar32.html">Tar32.dll< > 43 <li><a href="http://www.csdinc.co.jp/archiver/lib/yz1.html">Yz1.dll</a>< > 44 <li><a href="http://www.csdinc.co.jp/archiver/lib/zip32j.html">Zip32j.dl > 45 <li><a href="http://www.csdinc.co.jp/archiver/lib/unzip32.html">UnZip32. > 46 </ul> > 47 > 48 <h3>アンインストール</h3> > 49 <p> > 50 Noahの使用を止める場合は、Windowsの「コントロールパネル」の「<em>アプリケーショ唐フ > 51 追加と削除</em>」から「圧縮解凍ソフト Noah」を選んで削除してください。 > 52 </p> > 53 <p> > 54 また、スタートメニューのNoahのグループから「<em>Noah アンインストール</em>」を > 55 選んでもNoahの削除が可能です。 > 56 </p> > 57 > 58 > 59 </body></html>

Added Release/html/usage1.htm version [094ae0b24c7976f8]

> 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"> > 2 <html lang="ja"><head> > 3 <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS"> > 4 <meta http-equiv="Content-Style-Type" content="text/css"> > 5 <link rel="stylesheet" media="all" href="noahman.css"> > 6 </head><body> > 7 > 8 <h2><a name="cmpr">圧縮する</a></h2> > 9 <ul> > 10 <li>圧縮したいファイルを右クリック→「送る」メニュー→Noah</li> > 11 <li>圧縮したいファイルをNoahのアイコンにドラッグ&ドロップ</li> > 12 <li>圧縮したいファイルを右ボタンでドラッグ&ドロップ→ここに圧縮</li> > 13 <li>圧縮したいファイルをNoahの設定画面にドラッグ&ドロップ</li> > 14 </ul> > 15 <p> > 16 の4つのうち、どれでも可能です。好みの方法でどうぞ。 > 17 </p> > 18 > 19 <h2><a name="extr">解凍する</a></h2> > 20 <ul> > 21 <li>解凍したいファイルをダブルクリック</li> > 22 <li>解凍したいファイルを右クリック→「送る」メニュー→Noah</li> > 23 <li>解凍したいファイルをNoahのアイコンにドラッグ&ドロップ</li> > 24 <li>解凍したいファイルを右ボタンでドラッグ&ドロップ→ここに解凍</li> > 25 <li>解凍したいファイルをNoahの設定画面にドラッグ&ドロップ</li> > 26 </ul> > 27 <p> > 28 の5つのうち、どれでも可能です。好みの方法でどうぞ。 > 29 圧縮と全く同じ手順のものばかりですが、圧縮すべきか解凍すべきかは > 30 Noahが自動で判断するので問題ありません。 > 31 </p> > 32 > 33 <h2><a name="sfx">自己解凍形式で圧縮する</a></h2> > 34 <p> > 35 <a href="#cmpr">圧縮</a>の操作を、「Ctrl」キーを押しながら行ってください。 > 36 すると、<em>自己解凍形式</em>で圧縮できます。途中で何かいろいろ入力を促す > 37 画面が出ることがありますが、無視してOKボタンなどを押してしまって大丈夫です。 > 38 </p> > 39 > 40 <h2><a name="conf">設定変更</a></h2> > 41 <ul> > 42 <li>Noahのアイコンをダブルクリック</li> > 43 <li>スタートメニュー→Noah→Noah</li> > 44 <li>Shiftを押しながら適当なファイルを[送る]や[ドラッグ&ドロップ]</li> > 45 </ul> > 46 <p> > 47 の3つのうち、どれでも設定変更画面を起動することが可能です。 > 48 </p> > 49 <p> > 50 裏技として、「Shiftを押しながら適当なファイルを[送る]や[ドラッグ&ドロップ]」のと、 > 51 「Shiftを押しながらOK」で「設定を変えながら変更後の設定で圧縮/解凍」、 > 52 「Shiftを押しながらキャンセル」で、「設定は変えないけれど今回だけは画面に残って「る設定で圧縮/解凍」 > 53 が可能です。例えば、普段はlzhだけれど今日だけzipで圧縮したい、というときにShiftLャンセルが便利です。 > 54 </p> > 55 <p> > 56 以下は各々の設定項目の説明。 > 57 </p> > 58 <h4>[圧縮]タブ</h4> > 59 <p> > 60 <img src="cmpr.png" alt="圧縮タブの画面"> > 61 </p> > 62 <ul> > 63 <li>「圧縮先フォルダ」では、Noahで作った書庫ファイルを置く場所を指定します。</li> > 64 <li>「圧縮形式」は、どの圧縮法で圧縮するかを指定する欄です。 > 65 <em>よく分からないときはlzh lh5</em>にしておきましょう。</li> > 66 <li>「動作モード」は、貴方が圧縮と解凍のどちらをよく使うか考えて選んでください。 > 67 圧縮しかしないなら「圧縮専用」。普段は解凍だけだけど、たまに圧縮もするなら「解凍優先」 > 68 といった具合です。適切な設定にするとNoahの起動速度が少しあがることがありますが、 > 69 基本的には大して変わらないので、<em>解凍優先</em>をお勧めします。 > 70 (→<a href="usage2.htm#mode">動作モードについて</a>)</li> > 71 </ul> > 72 <h4>[解凍]タブ</h4> > 73 <p> > 74 <img src="extr.png" alt="解凍タブの画面"> > 75 </p> > 76 <ul> > 77 <li>「解凍先フォルダ」では、Noahで解凍したファイルを置く場所を指定します。</li> > 78 <li>「フォルダ自動生成」をONにしておくと、解凍先に書庫と同じ名前のフォルダを > 79 作って、その中に整理してファイルを解凍します。下の3つは細かい設定です。</li> > 80 </ul> > 81 <h4>[Windows拡張]タブ</h4> > 82 <p> > 83 <img src="win.png" alt="Windows拡張タブの画面"> > 84 </p> > 85 <ul> > 86 <li>「関連付け」では、ダブルクリックしたときにNoahで解凍する書庫形式を指定します。</li> > 87 <li>「右ドラッグ&ドロップ」ではWindowsでファイルを右ドロップしたときに出る > 88 メニューで、Noahで圧縮解凍出来るようにするか否かを指定します。</li> > 89 <li>「ショートカット」は送るメニューやデスクトップにNoahのアイコンを置くかどうかの設定です。</li> > 90 </ul> > 91 <h4>[About]タブ</h4> > 92 <p> > 93 Noahや、使っているDLLのバージョン情報を表示します。 > 94 </p> > 95 > 96 </body></html>

Added Release/html/usage2.htm version [4084f15aca58916a]

> 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"> > 2 <html lang="ja"><head> > 3 <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS"> > 4 <meta http-equiv="Content-Style-Type" content="text/css"> > 5 <link rel="stylesheet" media="all" href="noahman.css"> > 6 </head><body> > 7 > 8 <h2><a name="each">個別圧縮</a></h2> > 9 <p> > 10 たくさんのファイルをまとめて<a href="usage1.htm#cmpr">普通の方法</a>で圧縮すると、 > 11 全部一つの書庫に固めてしまいます。大抵の場合は一つにまとまった方が便利なのですが、 > 12 たまに、一つ一つバラバラに圧縮したいこともあるかと思います。 > 13 </p> > 14 <p> > 15 そんなときは<em>「Alt」キーを押しながら圧縮</em>すれば、それぞれ別々に圧縮するようになります。 > 16 </p> > 17 > 18 <h2><a name="view">書庫内閲覧モード</a></h2> > 19 <p> > 20 <a href="usage1.htm#cmpr">普通の方法</a>で解凍すると、書庫の中にあるファイルを > 21 みんな一度に全部解凍してしまうわけですが、書庫の中の一部のファイルだけちょっと > 22 見てみたい、というときはこの「書庫閲覧モード」が役に立ちます。 > 23 このモードでは、書庫の中にあるファイルの一覧を表示して、必要なものだけ解凍、 > 24 というような操作が可能です。 > 25 </p> > 26 <p> > 27 書庫閲覧モードにするには、<em>「Ctrl」キーを押しながら解凍</em>して下さい。 > 28 </p> > 29 > 30 <h2><a name="format">Noahで扱える形式</a></h2> > 31 <h4>圧縮、解凍とも可能なもの</h4> > 32 <dl> > 33 <dt><em>lzh</em> (Unlha32.dll)</dt> > 34 <dd>日本で一番よく使われている圧縮法です。lh5,6,7 は、数字が大きい方が圧縮率が謔ュなりますが、まだテスト中のため、lh5 以外の書庫を公的な場で利用することは禁止されています。</dd > 35 > 36 <dt><em>zip</em> (UnZip32.dll Zip32j.dll Zip32.dll)</dt> > 37 <dd>世界で一番よく使われている圧縮法です。海外の方へ渡すときはこれで。password選ぶと解凍にパスワードが必要な書庫が作成できます。storeを選ぶと、圧縮は行わず一つの > 38 > 39 <dt><em>cab</em> (Cab32.dll)</dt> > 40 <dd>Microsoft社の開発した圧縮形式です。特に LZX21 は最強の圧縮効率で知られていワす。</dd> > 41 > 42 <dt><em>tar</em> (Tar32.dll)</dt> > 43 <dd>UNIX で主に使われます。ノーマルなtarは圧縮機能はないので、gzip や bzip2 と「う圧縮方法を組み合わせるのが一般的です。</dd> > 44 > 45 <dt><em>yz1</em> (Yz1.dll)</dt> > 46 <dd>高速性と、テキストファイルの圧縮率がよいことで知られる日本産の圧縮法です。</dd> > 47 > 48 <dt><em>bga</em> (Bga32.dll)</dt> > 49 <dd>同じgzipやbzip2を使うので圧縮率は同等ですが、tarは[書庫化→圧縮]なのに対しアちらは[圧縮→書庫化]という順序で処理するため、書庫内の一部のファイルだけ扱うようなときは高速です。</dd> > 50 > 51 <dt><em>??_</em></dt> > 52 <dd>希に、ソフトのインストーラについてくることがあります。普通はまず使わないでオょう。</dd> > 53 </dl> > 54 <h4>解凍のみ可能なもの</h4> > 55 <dl> > 56 <dt><em>rar</em> (Unrar32.dll Unrar.dll)</dt> > 57 <dd>新進の圧縮法の中では一番広まっている形式ですね。</dd> > 58 > 59 <dt><em>ace</em> (UnaceV2.dll)</dt> > 60 <dd>これも新しい圧縮法の一つ。性能ではrarを越えたかな。</dd> > 61 > 62 <dt><em>gca</em> (Ungca32.dll)</dt> > 63 <dd>cabを越える圧縮率でしかもかなり高速な、期待の圧縮法です。お勧め…したいところですが、残念ながらNoahでは圧縮できません。(^^;</dd> > 64 > 65 <dt><em>arj</em> (Unarj32.dll)</dt> > 66 <dd>古い圧縮形式です。時々外国のFTPサーバ等で見かける程度。</dd> > 67 > 68 <dt><em>cpt</em></dt> > 69 <dd>Macintosh向けの圧縮形式です。これも最近はあまり見ません。</dd> > 70 </dl> > 71 <h4>分割・結合</h4> > 72 <dl> > 73 <dt><em>jak</em> (Jack32.dll)</dt> > 74 <dd>Noahでは「圧縮形式」欄に入れてしまったのですが、これは実は間違いで、jakは、ファイルを決まったサイズに分割します。1.44MB だと、丁度フロッピーディスクのサイズにな > 75 </dl> > 76 > 77 <h2><a name="mode">動作モードについて</a></h2> > 78 <p> > 79 Noahは、圧縮と解凍のうち適切な方を勝手に判断して実行します。 > 80 たいていの場合は判断に迷うことは無いのですが、時々 > 81 「圧縮すべきか解凍すべきか?」が微妙なことがあります。 > 82 そんな時にはどちらの動作を行うのか、Noahに指示しておくことができます。 > 83 それが、「動作モード」の設定です。 > 84 </p> > 85 <p> > 86 微妙な場合というのは、<em>書庫を複数いっぺんにドロップしたとき</em>です。 > 87 全部それぞれ解凍したいのか、それとも沢山の書庫を一つにまとめておきたいのか、 > 88 果たしてどちらなのかは Noah には判断し難いです。こんな場合どうすればよいかは、 > 89 ユーザーの皆さんが好きな方をNoahに指示してあげてください。つまり…、 > 90 </p> > 91 <ul> > 92 <li>[<em>解凍優先</em>] に設定していたら、それぞれを解凍します。</li> > 93 <li>[<em>圧縮優先</em>] に設定していたら、一つの書庫にまとめて圧縮します。</li> > 94 </ul> > 95 <p> > 96 なお [圧縮専用] や [解凍専用] は、Noahに自動判定をさせないで、 > 97 どんなときも圧縮/解凍しろ!と指示するときに使うモードです。 > 98 </p> > 99 > 100 <h2><a name="cmdline">コマンドラインオプション</a></h2> > 101 <ul> > 102 <li><em>-a</em> 必ず圧縮</li> > 103 <li><em>-x</em> 必ず解凍</li> > 104 <li><em>-w</em> 圧縮の時は個別圧縮で</li> > 105 <li><em>-ca</em> 圧縮の時は自己解凍形式で</li> > 106 <li><em>-cx</em> 解凍の時は書庫内閲覧で</li> > 107 <li><em>-dDirName</em> 出力先</li> > 108 <li><em>-tTypeName</em> 圧縮形式</li> > 109 <li><em>-mMethod</em> 圧縮メソッド</li> > 110 </ul> > 111 > 112 <h2><a name="iniconfig">隠し設定</a></h2> > 113 <p> > 114 Noahのインストール先フォルダに作成されるnoah.iniファイルに > 115 以下のような行を追加することで、更に細かい設定を行うことが出来ます。 > 116 通常は必要ありません。 > 117 </p> > 118 <dl> > 119 <dt><em>OpenBy=ディレクトリを開くコマンド</em></dt> > 120 <dd> > 121 デフォルトは explorer "%s" です。 > 122 %sは実行時にディレクトリ名に置き換えられます。 > 123 例えば explorer /e,"%s" とすればエクスプローラで開けます。 > 124 </dd> > 125 <dt><em>MiniBoot=1</em></dt> > 126 <dd> > 127 b2eから実行ファイルを起動する際に、最小化状態で > 128 実行したい場合は、MiniBoot=1 と書いて下さい。 > 129 </dd> > 130 <dt><em>OldAbout=1</em></dt> > 131 <dd> > 132 バージョン情報表示が遅いときにこれを入れると簡易表示になります。 > 133 </dd> > 134 <dt><em>OneExt=1</em></dt> > 135 <dd> > 136 aaa.bbb.ccc を圧縮したときの書庫名を aaa.lzh ではなく > 137 aaa.bbb.lzh としたいときに設定します。 > 138 </dd> > 139 <dt><em>NoExt=1</em></dt> > 140 <dd> > 141 aaa.bbb.ccc を圧縮したときの書庫名を aaa.lzh ではなく > 142 aaa.bbb.ccc.lzh としたいときに設定します。この設定よりも、 > 143 OneExt=1の方が優先されます。 > 144 </dd> > 145 <dt><em>MultiBootLimit=4</em></dt> > 146 <dd> > 147 Noah.exeが一発圧縮解凍用に一度に起動できる最大個数を制限します。デフォルトは4。 > 148 </dd> > 149 > 150 > 151 </dl> > 152 > 153 </body></html>

Added Release/html/win.png version [14c4e73076be0b97]

cannot compute difference between binary files

Added Release/html/yougo.htm version [b8e8caffb8253cc6]

> 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"> > 2 <html lang="ja"><head> > 3 <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS"> > 4 <meta http-equiv="Content-Style-Type" content="text/css"> > 5 <link rel="stylesheet" media="all" href="noahman.css"> > 6 </head><body> > 7 > 8 <h2><a name="cmpr">圧縮・解凍</a></h2> > 9 <p> > 10 パソコンに文章や絵を記録するとき、普通に「保存」すると、例えば100文字書いたときネら > 11 100文字分、5000文字書いたときなら5000文字分の大きさの「ファイル」として記録されワす。 > 12 ところが大抵のファイルは、うまく処理すると、もっとずっと小さなファイルに保存することが > 13 出来てしまうのです!小さなファイルに出来れば、メールにして送るときの電話代も節約できるなど、 > 14 いいことずくめです。この魔法のような技が、<em>圧縮</em>です。 > 15 </p> > 16 <p> > 17 …と、これだけではあまりにも怪しげですね。もう少し圧縮の原理について説明しましょう。 > 18 「すもももももももものうち」という文章を記録することを考えてみます。普通に記録すると、 > 19 12文字分になります。ところが、「すも×8のうち」と、[も] が8個並んでることを [も×8] > 20 と表すようにすれば、なんと7文字で済むことになります。 > 21 </p> > 22 <p> > 23 ※ 実際にはこれよりかなり複雑な計算を行って、圧縮の効率を上げています。 > 24 </p> > 25 <p> > 26 圧縮したファイルは「すも×8のうち」みたいに、ある意味謎の記号の並ぶファイルに > 27 なってしまっていますので、残念ながらそのまま使うことは出来ません。圧縮した文章を > 28 もう一度ワープロで開きたいときは、元の状態に戻してやる必要があります。 > 29 この戻す作業のことを「<em>解凍</em>」といいます。 > 30 </p> > 31 <p> > 32 そして、Noahは、この圧縮と解凍をするためのソフトなわけです。 > 33 </p> > 34 > 35 <h2><a name="arc">書庫・アーカイブ</a></h2> > 36 <p> > 37 「複数のファイルを一つにまとめたファイル」のこと。 > 38 <em>書庫</em>でも<em>アーカイブ</em>でもどちらも同じ意味です。 > 39 大抵は一つにまとめると同時に圧縮も行われるので、 > 40 混同されて圧縮したファイルのことを書庫と呼ぶことも多々あります。 > 41 </p> > 42 > 43 <h2><a name="sfx">自己解凍形式書庫</a></h2> > 44 <p> > 45 圧縮は便利なのですが、一度圧縮してしまうと、 > 46 解凍ソフトを持っていないと解凍できない、という不便な点があります。 > 47 そこで、解凍ソフトなしでも<em>自分で自分を解凍できてしまう</em>ような > 48 風に圧縮してしまうと言う手があります。それが自己解凍形式書庫 > 49 (通称SFX)です。 > 50 </p> > 51 > 52 <h2><a name="dnd">ドラッグ&ドロップ</a></h2> > 53 <p> > 54 和訳すると、「引きずり落とす」ことです。…って何の説明にもなってないですね。<br> > 55 ファイルをマウスの矢印で指し、マウスのボタンを押し、押したままファイルを引きずり、 > 56 どこか(Noahの上とか)でボタンを放して落とす一連の作業のことを言います。 > 57 文字だけではよくわからない、という方は、本屋でパソコン入門書を立ち読みするか、 > 58 知り合いの方にドラッグ&ドロップの実演をしてもらってみて下さい。(^^; > 59 </p> > 60 <p> > 61 <em>D&D、DnD、ドロップ</em>などと省略して書かれることが多いです。 > 62 また私は、マウスの右ボタンでのDnDのことを[右ドラッグ&ドロップ]と言っています。 > 63 </p> > 64 > 65 </body></html>

Added Release/manual-e.htm version [24a4792e53a4a34b]

> 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"> > 2 <html><head> > 3 <meta http-equiv="Content-Type" content="text/html"> > 4 <title>Noah User's Manual</title> > 5 </head><frameset cols="200,*"> > 6 > 7 <frame src="html/eindex.htm" name="Menu" frameborder="0"> > 8 <frame src="html/etop.htm" name="Main" frameborder="0"> > 9 > 10 <noframes><body><p> > 11 <a href="html/eindex.htm">INDEX</a> > 12 </p><p> > 13 出来れば、フレーム対応のブラウザでご覧下さい。 > 14 </p></body></noframes> > 15 > 16 </frameset></html>

Added Release/manual.htm version [2977d38cd2581e57]

> 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"> > 2 <html><head> > 3 <meta http-equiv="Content-Type" content="text/html"> > 4 <title>Noah User's Manual</title> > 5 </head><frameset cols="200,*"> > 6 > 7 <frame src="html/index.htm" name="Menu" frameborder="0"> > 8 <frame src="html/top.htm" name="Main" frameborder="0"> > 9 > 10 <noframes><body><p> > 11 <a href="html/index.htm">INDEX</a> > 12 </p><p> > 13 出来れば、フレーム対応のブラウザでご覧下さい。 > 14 </p></body></noframes> > 15 > 16 </frameset></html>

Added Release/uninst.exe version [eb14369955eec8a5]

cannot compute difference between binary files

Added Resource.h version [d152fc34c77af086]

> 1 //{{NO_DEPENDENCIES}} > 2 // Microsoft Developer Studio generated include file. > 3 // Used by Noah.rc > 4 // > 5 #define IDS_M_ERROR 1 > 6 #define IDS_C_ERROR 2 > 7 #define IDS_CHOOSEDIR 3 > 8 #define ID_ALLYES 3 > 9 #define IDS_FNAME 4 > 10 #define ID_ALLNO 4 > 11 #define IDS_SIZE 5 > 12 #define IDS_DATETIME 6 > 13 #define IDS_RATIO 7 > 14 #define IDS_METHOD 8 > 15 #define IDS_PATH 9 > 16 #define IDS_EXECUTING 10 > 17 #define IDS_NOLIST 11 > 18 #define IDS_ARCVIEW_MSG 12 > 19 #define IDI_MAIN 101 > 20 #define IDI_B2E 102 > 21 #define IDR_ACCEL 115 > 22 #define IDD_ARCVIEW 116 > 23 #define IDD_CMPCFG 117 > 24 #define IDD_MLTCFG 118 > 25 #define IDD_WINCFG 119 > 26 #define IDD_INFCFG 120 > 27 #define IDD_PROGRESS 121 > 28 #define IDD_PASSWORD 122 > 29 #define IDD_ANYASS 123 > 30 #define IDR_DEFAULT1 124 > 31 #define IDD_PATHCHECK 126 > 32 #define IDC_FILELIST 1000 > 33 #define IDC_MELTEACH 1001 > 34 #define IDC_SHOW 1002 > 35 #define IDC_SELECTINV 1003 > 36 #define IDC_MODE1 1004 > 37 #define IDC_MODE2 1005 > 38 #define IDC_MODE3 1006 > 39 #define IDC_MODE4 1007 > 40 #define IDC_ODIR 1008 > 41 #define IDC_DDIR 1009 > 42 #define IDC_DDIR1 1010 > 43 #define IDC_DDIR2 1011 > 44 #define IDC_REF 1012 > 45 #define IDC_CMPEXT 1013 > 46 #define IDC_CMPMHD 1014 > 47 #define IDC_MKDIR 1015 > 48 #define IDC_MKDIR1 1016 > 49 #define IDC_MKDIR2 1017 > 50 #define IDC_MKDIR3 1018 > 51 #define IDC_VERSION 1019 > 52 #define IDC_LZH 1030 > 53 #define IDC_ZIP 1031 > 54 #define IDC_CAB 1032 > 55 #define IDC_RAR 1033 > 56 #define IDC_TAR 1034 > 57 #define IDC_YZ1 1035 > 58 #define IDC_GCA 1036 > 59 #define IDC_ARJ 1037 > 60 #define IDC_BGA 1038 > 61 #define IDC_ACE 1039 > 62 #define IDC_CPT 1040 > 63 #define IDC_JAK 1041 > 64 #define IDC_7Z 1042 > 65 #define IDC_CMP 1043 > 66 #define IDC_MLT 1044 > 67 #define IDC_SND 1045 > 68 #define IDC_DSK 1046 > 69 #define IDC_BAR 1047 > 70 #define IDC_FNAME 1048 > 71 #define IDC_EDIT 1049 > 72 #define IDC_MASK 1050 > 73 #define IDC_ASS 1051 > 74 #define IDC_NASSOC 1052 > 75 #define IDC_ASSOC 1053 > 76 #define IDC_ADD 1054 > 77 #define IDC_DEL 1055 > 78 #define IDC_MESSAGE 1057 > 79 #define IDC_NOADMIN 1058 > 80 #define IDC_STATUSBAR 1059 > 81 #define IDC_PATHNAME 1060 > 82 #define IDA_MYDIR 40001 > 83 #define IDA_HELP 40002 > 84 > 85 // Next default values for new objects > 86 // > 87 #ifdef APSTUDIO_INVOKED > 88 #ifndef APSTUDIO_READONLY_SYMBOLS > 89 #define _APS_NEXT_RESOURCE_VALUE 127 > 90 #define _APS_NEXT_COMMAND_VALUE 40003 > 91 #define _APS_NEXT_CONTROL_VALUE 1062 > 92 #define _APS_NEXT_SYMED_VALUE 101 > 93 #endif > 94 #endif

Added SubDlg.cpp version [fcaa4b48ba621d24]

> 1 > 2 #include "stdafx.h" > 3 #include "NoahApp.h" > 4 #include "SubDlg.h" > 5 > 6 int CArcViewDlg::st_nLife; > 7 > 8 BOOL CArcViewDlg::onInit() > 9 { > 10 char cstr[100]; > 11 kiStr str; > 12 kiPath path; > 13 SHFILEINFO sfi,lfi; > 14 HIMAGELIST hImS,hImL; > 15 kiListView ctrl( this, IDC_FILELIST ); > 16 __int64 filesize_sum = 0; > 17 > 18 //-- ダイアログ一個生成の印 > 19 hello(); > 20 m_bSmallFirst[0] = m_bSmallFirst[1] = m_bSmallFirst[2] = > 21 m_bSmallFirst[3] = m_bSmallFirst[4] = m_bSmallFirst[5] = true; > 22 > 23 //-- 真ん中に&前に > 24 setCenter( hwnd(), app()->mainhwnd() ); > 25 setFront( hwnd() ); > 26 > 27 //-- アイコン > 28 path = m_fname.basedir, path += m_fname.sname; > 29 hImS = (HIMAGELIST)::SHGetFileInfo( path, 0, &sfi, sizeof(sfi), SHGFI_SY > 30 hImL = (HIMAGELIST)::SHGetFileInfo( path, 0, &lfi, sizeof(lfi), SHGFI_SY > 31 sendMsg( WM_SETICON, ICON_BIG, (LPARAM)lfi.hIcon ); > 32 sendMsg( WM_SETICON, ICON_SMALL, (LPARAM)sfi.hIcon ); > 33 > 34 //-- タイトル > 35 sendMsg( WM_SETTEXT, 0, (LPARAM)kiPath(m_fname.lname).name() ); > 36 > 37 //-- 解凍先 > 38 sendMsgToItem( IDC_DDIR, WM_SETTEXT, 0, (LPARAM)(const char*)m_ddir ); > 39 > 40 //-- リスト > 41 if( !m_pArc->list( m_fname, m_files ) || m_files.len()==0 ) > 42 { > 43 m_bAble = false; > 44 ctrl.insertColumn( 0, "", 510 ); > 45 ctrl.insertItem( 0, str.loadRsrc(IDS_NOLIST) ); > 46 } > 47 else > 48 { > 49 m_bAble = ( 0 != (m_pArc->ability() & aMeltEach) ); > 50 > 51 ctrl.setImageList( hImL, hImS ); > 52 ctrl.insertColumn( 0, str.loadRsrc(IDS_FNAME), 110 ); > 53 ctrl.insertColumn( 1, str.loadRsrc(IDS_SIZE), 70, LVCFMT_RIG > 54 ctrl.insertColumn( 2, str.loadRsrc(IDS_DATETIME),100, LVCFMT_RIG > 55 ctrl.insertColumn( 3, str.loadRsrc(IDS_RATIO), 55, LVCFMT_RIG > 56 ctrl.insertColumn( 4, str.loadRsrc(IDS_METHOD), 50, LVCFMT_RIG > 57 ctrl.insertColumn( 5, str.loadRsrc(IDS_PATH), 130 ); > 58 > 59 FILETIME ftm; > 60 SYSTEMTIME stm; > 61 > 62 //-- アイテム > 63 for( unsigned int i=0,k=0; i!=m_files.len(); i++ ) > 64 if( m_files[i].isfile ) > 65 { > 66 #define usiz (m_files[i].inf.dwOriginalSize) > 67 #define csiz (m_files[i].inf.dwCompressedSize) > 68 #define method (m_files[i].inf.szMode) > 69 #define date (m_files[i].inf.wDate) > 70 #define time (m_files[i].inf.wTime) > 71 path = m_files[i].inf.szFileName; > 72 > 73 // ファイル名 > 74 ctrl.insertItem( k, path.name(), > 75 (LPARAM)(&m_files[i]), kiSUtil::getSysIc > 76 > 77 // サイズ > 78 if( usiz == 0xffffffff ) > 79 ctrl.setSubItem( k, 1, "????" ); > 80 else > 81 ctrl.setSubItem( k, 1, str.setInt( usiz, > 82 > 83 // 時間 > 84 if( ::DosDateTimeToFileTime( date, time, &ftm ) > 85 && ::FileTimeToSystemTime( &ftm, &stm ) ) > 86 { > 87 *cstr=0; > 88 ::GetDateFormat( LOCALE_USER_DEFAULT, 0, > 89 "yy/MM/ > 90 str=cstr; > 91 ::GetTimeFormat( LOCALE_USER_DEFAULT, 0, > 92 " HH:mm > 93 str+=cstr; > 94 ctrl.setSubItem( k, 2, str ); > 95 } > 96 > 97 // 圧縮率 > 98 filesize_sum += usiz; > 99 if( usiz==0 ) ctrl.setSubItem( k, 3, " > 100 else if( csiz==0 ) ctrl.setSubItem( k, 3, " > 101 else ctrl.setSubItem( > 102 > 103 // メソッド > 104 ctrl.setSubItem( k, 4, method ); > 105 > 106 // パス > 107 path.beDirOnly(); > 108 ctrl.setSubItem( k, 5, path ); > 109 > 110 k++; > 111 > 112 #undef usiz > 113 #undef csiz > 114 #undef method > 115 #undef date > 116 #undef time > 117 } > 118 > 119 //-- ドラッグ&ドロップフォーマット登録 > 120 FORMATETC fmt; > 121 fmt.cfFormat = CF_HDROP; > 122 fmt.ptd = NULL; > 123 fmt.dwAspect = DVASPECT_CONTENT; > 124 fmt.lindex = -1; > 125 fmt.tymed = TYMED_HGLOBAL; > 126 addFormat( fmt ); > 127 } > 128 > 129 //-- 情報 -- > 130 char tmp[255]; > 131 kiStr full_filename = m_fname.basedir + m_fname.lname; > 132 __int64 filesize_arc = kiFile::getSize64(full_filename); > 133 if( filesize_sum==0 ) filesize_sum = 1; > 134 wsprintf( tmp, kiStr().loadRsrc(IDS_ARCVIEW_MSG), > 135 m_files.len(), > 136 (int)(filesize_arc*100 / filesize_sum), > 137 (const char*)m_pArc->arctype_name(full_filename) > 138 ); > 139 sendMsgToItem( IDC_STATUSBAR, WM_SETTEXT, 0, (long)tmp ); > 140 > 141 if( !m_bAble ) > 142 { > 143 static const UINT items[] = { IDC_SELECTINV,IDC_REF,IDC_MELTEACH > 144 for( int i=0; i!=sizeof(items)/sizeof(UINT); i++ ) > 145 ::EnableWindow( item(items[i]), FALSE ); > 146 } > 147 > 148 return FALSE; > 149 } > 150 > 151 bool CArcViewDlg::onOK() > 152 { > 153 setdir(); > 154 m_pArc->melt( m_fname, m_ddir ); > 155 myapp().open_folder( m_ddir, 1 ); > 156 kiSUtil::switchCurDirToExeDir(); // 念のため > 157 return onCancel(); > 158 } > 159 > 160 bool CArcViewDlg::onCancel() > 161 { > 162 ::SetCurrentDirectory( m_fname.basedir ); > 163 m_tdir.remove(); > 164 if( kiSUtil::exist(m_tdir) ) > 165 { > 166 kiStr tmp(600); > 167 if( IDNO==app()->msgBox( tmp.loadRsrc(IDS_EXECUTING), NULL, MB_Y > 168 return false; > 169 } > 170 > 171 kiListView(this,IDC_FILELIST).setImageList( NULL, NULL ); > 172 byebye(); > 173 return true; > 174 } > 175 > 176 bool CArcViewDlg::giveData( const FORMATETC& fmt, STGMEDIUM* stg, bool firstcall > 177 { > 178 if( firstcall ) > 179 if( 0x8000<=m_pArc->melt( m_fname, m_tdir, &m_files ) ) > 180 return false; > 181 > 182 unsigned int i; > 183 BOOL fWide = (app()->osver().dwPlatformId==VER_PLATFORM_WIN32_NT); > 184 kiArray<kiPath> lst; > 185 kiPath tmp; > 186 int flen = 0; > 187 wchar_t wbuf[600]; > 188 > 189 for( i=0; i!=m_files.len(); i++ ) > 190 if( m_files[i].selected ) > 191 { > 192 tmp = m_tdir; > 193 tmp += m_files[i].inf.szFileName; > 194 > 195 lst.add( tmp ); > 196 if( fWide ) > 197 flen += (::MultiByteToWideChar( CP_ACP, 0, tmp, > 198 else > 199 flen += (tmp.len()+1); > 200 } > 201 > 202 HDROP hDrop = (HDROP)::GlobalAlloc( GHND, sizeof(DROPFILES)+flen+1 ); > 203 > 204 DROPFILES* dr = (DROPFILES*)::GlobalLock( hDrop ); > 205 dr->pFiles = sizeof(DROPFILES); > 206 dr->pt.x = dr->pt.y = 0; > 207 dr->fNC = FALSE; > 208 dr->fWide = fWide; > 209 > 210 char* buf = (char*)(&dr[1]); > 211 for( i=0; i!=lst.len(); i++ ) > 212 { > 213 if( fWide ) > 214 { > 215 flen = ::MultiByteToWideChar( CP_ACP, 0, lst[i], -1, wbu > 216 ki_memcpy( buf, wbuf, flen*2 ); > 217 for( int k=0; k!=flen; k++ ) > 218 if( ((wchar_t*)buf)[k] == '/' ) > 219 ((wchar_t*)buf)[k] = '\\'; > 220 buf += flen*2; > 221 } > 222 else > 223 { > 224 ki_strcpy( buf,lst[i] ); > 225 for( int k=0; k!=lst[i].len(); k++ ) > 226 if( buf[k] == '/' ) > 227 buf[k] = '\\'; > 228 buf += lst[i].len() + 1; > 229 } > 230 } > 231 *buf=0; > 232 if( fWide ) > 233 buf[1]='\0'; > 234 > 235 ::GlobalUnlock( hDrop ); > 236 > 237 stg->hGlobal = hDrop; > 238 stg->tymed = TYMED_HGLOBAL; > 239 stg->pUnkForRelease = NULL; > 240 return true; > 241 } > 242 > 243 BOOL CALLBACK CArcViewDlg::proc( UINT msg, WPARAM wp, LPARAM lp ) > 244 { > 245 switch( msg ) > 246 { > 247 //-- メインウインドウ指定 --------------------- > 248 case WM_ACTIVATE: > 249 if( LOWORD(wp)==WA_ACTIVE || LOWORD(wp)==WA_CLICKACTIVE ) > 250 { > 251 app()->setMainWnd( this ); > 252 return TRUE; > 253 } > 254 break; > 255 > 256 //-- リサイズ関連の処理 --------------------- > 257 case WM_GETMINMAXINFO: > 258 { > 259 RECT self,child; > 260 ::GetWindowRect( hwnd(), &self ); > 261 ::GetWindowRect( item(IDC_REF), &child ); > 262 POINT& sz = ((MINMAXINFO*)lp)->ptMinTrackSize; > 263 sz.x = child.right - self.left + 18; > 264 sz.y = child.bottom - self.top + 100; > 265 } > 266 return TRUE; > 267 case WM_SIZE: > 268 if( wp!=SIZE_MAXHIDE && wp!=SIZE_MINIMIZED ) > 269 { > 270 RECT self,ref,child,sbar; > 271 ::GetWindowRect( hwnd(), &self ); > 272 ::GetWindowRect( item(IDC_REF), &ref ); > 273 ::GetWindowRect( item(IDC_FILELIST), &child ); > 274 ::GetClientRect( item(IDC_STATUSBAR), &sbar ); > 275 > 276 ::SetWindowPos( item(IDC_FILELIST), NULL, 0, 0, > 277 LOWORD(lp), > 278 (self.bottom-ref.bottom)-(child.top-ref.bottom) > 279 -(sbar.bottom-sbar.top)-10, > 280 SWP_NOMOVE|SWP_NOOWNERZORDER|SWP_NOZORDER ); > 281 > 282 ::GetClientRect( hwnd(), &self ); > 283 ::SetWindowPos( item(IDC_STATUSBAR), NULL, sbar.left, > 284 self.bottom - (sbar.bottom-sbar.top), > 285 0, 0, SWP_NOSIZE|SWP_NOOWNERZORDER|SWP_NOZORDER > 286 } > 287 break; > 288 > 289 case WM_NOTIFY: > 290 if( wp==IDC_FILELIST && m_bAble ) > 291 { > 292 NMHDR* phdr=(NMHDR*)lp; > 293 if( phdr->code==LVN_BEGINDRAG || phdr->code==LVN_BEGINRD > 294 { > 295 if( setSelection() ) > 296 kiDropSource::DnD( this, DROPEFFECT_COPY > 297 return TRUE; > 298 } > 299 else if( phdr->code==LVN_COLUMNCLICK ) > 300 DoSort( ((NMLISTVIEW*)lp)->iSubItem ); > 301 else if( phdr->code==NM_DBLCLK ) > 302 sendMsg( WM_COMMAND, IDC_SHOW ); > 303 else if( phdr->code==NM_RCLICK ) > 304 { > 305 if( setSelection() ) > 306 DoRMenu(); > 307 } > 308 } > 309 break; > 310 > 311 case WM_COMMAND: > 312 switch( LOWORD(wp) ) > 313 { > 314 case IDC_SELECTINV: // 選択反転 > 315 { > 316 LVITEM item; > 317 item.mask = LVIF_STATE; > 318 item.stateMask = LVIS_SELECTED; > 319 int j,m=sendMsgToItem( IDC_FILELIST, LVM_GETITEM > 320 for( j=0; j!=m; j++ ) > 321 { > 322 item.state = ~sendMsgToItem( IDC_FILELIS > 323 sendMsgToItem( IDC_FILELIST, LVM_SETITEM > 324 } > 325 ::SetFocus( this->item(IDC_FILELIST) ); > 326 } > 327 return TRUE; > 328 > 329 case IDC_REF: // 解凍先設定 > 330 kiSUtil::getFolderDlgOfEditBox( item(IDC_DDIR), hwnd(), > 331 return TRUE; > 332 > 333 case IDC_MELTEACH: // 一部解凍 > 334 if( setSelection() ) > 335 { > 336 setdir(); > 337 int result = m_pArc->melt( m_fname, m_ddir, &m_f > 338 if( result<0x8000 ) > 339 myapp().open_folder( m_ddir, 1 ); > 340 else if( result != 0x8020 ) > 341 { > 342 char str[255]; > 343 wsprintf( str, "%s\nError No: [%x]", > 344 (const char*)kiStr().loadRsrc( I > 345 app()->msgBox( str ); > 346 } > 347 kiSUtil::switchCurDirToExeDir(); // 念のため > 348 } > 349 return TRUE; > 350 > 351 case IDC_SHOW: // 表示 > 352 if( setSelection() ) > 353 { > 354 int assocCnt = hlp_cnt_check(); > 355 if( 0x8000 > m_pArc->melt( m_fname, m_tdir, &m_f > 356 { > 357 if( assocCnt != -1 ) > 358 m_files[assocCnt].selected = fal > 359 for( unsigned i=0; i!=m_files.len(); i++ > 360 if( m_files[i].selected ) > 361 { > 362 kiPath tmp(m_tdir); > 363 char yen[MAX_PATH]; > 364 ki_strcpy( yen, m_files[ > 365 for( char* p=yen; *p; p= > 366 if( *p=='/' ) > 367 *p = '\\ > 368 tmp += yen; > 369 ::ShellExecute( hwnd(), > 370 } > 371 } > 372 kiSUtil::switchCurDirToExeDir(); // 念のため > 373 } > 374 return TRUE; > 375 } > 376 } > 377 return FALSE; > 378 } > 379 > 380 int CArcViewDlg::hlp_cnt_check() > 381 { > 382 // 一個目の選択済みファイルが .hlp か否か > 383 for( unsigned i=0; i!=m_files.len(); i++ ) > 384 if( m_files[i].selected ) > 385 break; > 386 if( i==m_files.len() ) > 387 return -1; > 388 int x = kiPath::ext(m_files[i].inf.szFileName)-m_files[i].inf.szFileName > 389 if( 0!=ki_strcmpi( "hlp", m_files[i].inf.szFileName+x ) ) > 390 return -1; > 391 > 392 // .cnt のファイル名 > 393 char cntpath[FNAME_MAX32]; > 394 ki_strcpy( cntpath, m_files[i].inf.szFileName ); > 395 cntpath[x]='c', cntpath[x+1]='n', cntpath[x+2]='t'; > 396 > 397 // .cntも一時的に選択する > 398 for( i=0; i!=m_files.len(); i++ ) > 399 if( 0==ki_strcmpi( cntpath, m_files[i].inf.szFileName ) ) > 400 { > 401 if( m_files[i].selected ) > 402 return -1; > 403 m_files[i].selected = true; > 404 return i; > 405 } > 406 return -1; > 407 } > 408 > 409 int CALLBACK CArcViewDlg::lv_compare( LPARAM p1, LPARAM p2, LPARAM type ) > 410 { > 411 bool rev = false; > 412 if( type>=10000 ) > 413 rev=true, type-=10000; > 414 int ans = 0; > 415 > 416 INDIVIDUALINFO *a1=&((arcfile*)p1)->inf, *a2=&((arcfile*)p2)->inf; > 417 switch( type ) > 418 { > 419 case 0: //NAME > 420 ans = ::lstrcmp( kiPath::name(a1->szFileName), > 421 kiPath::name(a2->szFileName) ); > 422 break; > 423 case 1: //SIZE > 424 ans = (signed)a1->dwOriginalSize - (signed)a2->dwOriginalSize; > 425 break; > 426 case 2: //DATE,TIME > 427 ans = (signed)a1->wDate - (signed)a2->wDate; > 428 if( ans==0 ) > 429 ans = (signed)a1->wTime - (signed)a2->wTime; > 430 break; > 431 case 3:{//RATIO > 432 int cr1, cr2; > 433 if( a1->dwOriginalSize==0 ) cr1=100; > 434 else if( a1->dwCompressedSize==0 ) cr1=-1; > 435 else cr1 = (a1->dwCompressedSize*100)/(a1->dwOriginalSize); > 436 if( a2->dwOriginalSize==0 ) cr2=100; > 437 else if( a2->dwCompressedSize==0 ) cr2=-1; > 438 else cr2 = (int)((((__int64)a2->dwCompressedSize)*100)/(a2->dwOr > 439 ans = cr1 - cr2; > 440 }break; > 441 case 4: //METHOD > 442 ans = ::lstrcmp( a1->szMode, a2->szMode ); > 443 break; > 444 case 5:{//PATH > 445 kiPath pt1(a1->szFileName), pt2(a2->szFileName); > 446 pt1.beDirOnly(), pt2.beDirOnly(); > 447 ans = ::lstrcmp( pt1, pt2 ); > 448 }break; > 449 } > 450 > 451 return rev ? -ans : ans; > 452 } > 453 > 454 void CArcViewDlg::DoSort( int col ) > 455 { > 456 WPARAM p = col + (m_bSmallFirst[col] ? 0 : 10000); > 457 sendMsgToItem( IDC_FILELIST, LVM_SORTITEMS, p, (LPARAM)lv_compare ); > 458 m_bSmallFirst[col] = !m_bSmallFirst[col]; > 459 } > 460 > 461 void CArcViewDlg::GenerateDirMenu( HMENU m, int& id, StrArray* sx, const kiPath& > 462 { > 463 // フォルダ内リストアップ > 464 kiFindFile ff; > 465 ff.begin( kiPath(pth)+="*" ); > 466 for( WIN32_FIND_DATA fd; ff.next(&fd); ) > 467 if( fd.cFileName[0]!='.' > 468 && !(fd.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN) ) > 469 { > 470 kiPath fullpath(pth); fullpath+=fd.cFileName; > 471 const int pID=id; > 472 MENUITEMINFO mi = { sizeof(MENUITEMINFO) }; > 473 > 474 if( fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ) > 475 { > 476 // 再帰的に > 477 mi.fMask = MIIM_SUBMENU | 0x00000040;// (MIIM_ST > 478 mi.hSubMenu = ::CreatePopupMenu(); > 479 GenerateDirMenu( mi.hSubMenu, id, sx, > 480 kiPath(kiPath(fullpath)+="\\") ); > 481 } > 482 else > 483 { > 484 const char* ext = kiPath::ext(fd.cFileName); > 485 if( ::lstrlen(ext) > 4 ) continue; > 486 if( 0==::lstrcmpi(ext,"lnk") ) > 487 *const_cast<char*>(ext-1) = '\0'; > 488 mi.fMask = MIIM_ID | 0x00000040;// (MIIM_STRING) > 489 mi.wID = id++; > 490 sx->add( fullpath ); > 491 } > 492 > 493 mi.dwTypeData = const_cast<char*>((const char*)fd.cFileN > 494 mi.cch = ::lstrlen(fd.cFileName); > 495 ::InsertMenuItem( m, pID, FALSE, &mi ); > 496 } > 497 } > 498 > 499 void CArcViewDlg::DoRMenu() > 500 { > 501 // メニュー作成 > 502 HMENU m = ::CreatePopupMenu(); > 503 POINT pt; ::GetCursorPos( &pt ); > 504 const int IDSTART = 128; > 505 > 506 // フォルダの中身をリストアップしつつメニューに追加 > 507 int id = IDSTART; > 508 StrArray lst; > 509 GenerateDirMenu( m, id, &lst, kiPath(CSIDL_SENDTO) ); > 510 > 511 // メニュー表示 > 512 id = ::TrackPopupMenu( m, > 513 TPM_LEFTALIGN|TPM_TOPALIGN|TPM_RETURNCMD|TPM_NONOTIFY, > 514 pt.x, pt.y, 0, hwnd(), NULL ); > 515 ::DestroyMenu( m ); > 516 > 517 // 結果処理 > 518 if( id != 0 ) > 519 { > 520 kiStr cmd; > 521 if( 0x8000>m_pArc->melt( m_fname, m_tdir, &m_files ) ) > 522 { > 523 for( UINT i=0; i!=m_files.len(); i++ ) > 524 if( m_files[i].selected ) > 525 { > 526 cmd += "\""; > 527 cmd += m_tdir; > 528 const char* buf = m_files[i].inf.szFileN > 529 for( int k=0; buf[k]; ++k ) > 530 cmd += ( buf[k]=='/' ? '\\' : bu > 531 cmd += "\" "; > 532 } > 533 ShellExecute(hwnd(),NULL,lst[id-IDSTART],cmd,NULL,SW_SHO > 534 } > 535 } > 536 } > 537

Added SubDlg.h version [f3e6b8304ab28f87]

> 1 #ifndef AFX_ARCVIEWDLG_H__91EDF9F6_142E_4E25_BCE3_448E937E29D9__INCLUDED_ > 2 #define AFX_ARCVIEWDLG_H__91EDF9F6_142E_4E25_BCE3_448E937E29D9__INCLUDED_ > 3 > 4 #include "NoahApp.h" > 5 #include "Archiver.h" > 6 #include "resource.h" > 7 > 8 class CArcViewDlg : public kiDialog, kiDataObject > 9 { > 10 public: > 11 CArcViewDlg( CArchiver* ptr,arcname& fnm,const kiPath& ddir ) > 12 : kiDialog( IDD_ARCVIEW ), m_pArc( ptr ), > 13 m_fname( fnm ), m_ddir( ddir ) > 14 { > 15 AddRef(); > 16 myapp().get_tempdir( m_tdir ); > 17 } > 18 > 19 private: //-- ダイアログとしての処理 > 20 > 21 BOOL CALLBACK proc( UINT msg, WPARAM wp, LPARAM lp ); > 22 BOOL onInit(); > 23 bool onOK(); > 24 bool onCancel(); > 25 void setdir() > 26 { > 27 char str[MAX_PATH]; > 28 sendMsgToItem( IDC_DDIR, WM_GETTEXT, MAX_PATH, (LPARAM)s > 29 m_ddir = str; > 30 m_ddir.beBackSlash( true ); > 31 m_ddir.mkdir(); > 32 m_ddir.beShortPath(); > 33 } > 34 bool setSelection() > 35 { > 36 bool x=false; > 37 LVITEM it; > 38 it.mask = (LVIF_PARAM | LVIF_STATE); > 39 it.iSubItem = 0; > 40 it.stateMask = LVIS_SELECTED; > 41 for( it.iItem=0; sendMsgToItem( IDC_FILELIST, LVM_GETITE > 42 if( ((arcfile*)it.lParam)->selected = (0!=(LVIS_ > 43 x = true; > 44 return x; > 45 } > 46 int hlp_cnt_check(); > 47 bool m_bAble; > 48 > 49 private: //-- ドラッグ&ドロップ処理 > 50 > 51 bool giveData( const FORMATETC& fmt, STGMEDIUM* stg, bool firstcall ); > 52 > 53 private: //-- ソート処理 > 54 > 55 void DoSort( int col ); > 56 static int CALLBACK lv_compare( LPARAM p1, LPARAM p2, LPARAM type ); > 57 bool m_bSmallFirst[6]; > 58 > 59 private: //-- 右クリック > 60 > 61 void DoRMenu(); > 62 void GenerateDirMenu( HMENU m, int& id, StrArray* sx, const kiPath& pth > 63 > 64 private: //-- 解凍作業 > 65 > 66 CArchiver* m_pArc; > 67 arcname m_fname; > 68 kiPath m_ddir, m_tdir; > 69 aflArray m_files; > 70 > 71 //-- 存在しているウインドウ数管理。 > 72 public: static void clear() { st_nLife=0; } > 73 private:static void hello() { st_nLife++; } > 74 static void byebye() { if(--st_nLife==0) kiWindow::loopbreak(); > 75 static int st_nLife; > 76 }; > 77 > 78 > 79 class CArcPwdDlg : public kiDialog > 80 { > 81 char *buf; > 82 const char *nam; > 83 int siz; > 84 public: > 85 CArcPwdDlg( HWND h, char* x, int s, const char* n ) : kiDialog( IDD_PASS > 86 { > 87 doModal( h ); > 88 } > 89 BOOL onInit() > 90 { > 91 sendMsgToItem( IDC_MASK, BM_SETCHECK, BST_CHECKED ); > 92 sendMsgToItem( IDC_EDIT, EM_SETLIMITTEXT, siz ); > 93 sendMsgToItem( IDC_EDIT, EM_SETPASSWORDCHAR, '*' ); > 94 sendMsg( WM_SETTEXT, 0, (LPARAM)nam ); > 95 ::SetFocus( item(IDC_EDIT) ); > 96 return TRUE; > 97 } > 98 BOOL CALLBACK proc( UINT msg, WPARAM wp, LPARAM lp ) > 99 { > 100 if( msg==WM_COMMAND && LOWORD(wp)==IDC_MASK ) > 101 { > 102 if( BST_CHECKED==sendMsgToItem( IDC_MASK, BM_GET > 103 sendMsgToItem( IDC_EDIT, EM_SETPASSWORDC > 104 else > 105 sendMsgToItem( IDC_EDIT, EM_SETPASSWORDC > 106 ::InvalidateRect( item(IDC_EDIT), NULL, TRUE ); > 107 } > 108 return FALSE; > 109 } > 110 bool onOK() > 111 { > 112 sendMsgToItem( IDC_EDIT, WM_GETTEXT, siz, (LPARAM)buf ); > 113 return true; > 114 } > 115 }; > 116 > 117 class CArcProgressDlg : public kiDialog > 118 { > 119 unsigned int bl; > 120 public: > 121 CArcProgressDlg( unsigned int barlimit, bool packing=false ) > 122 : kiDialog( IDD_PROGRESS ), bl( barlimit ) > 123 { > 124 createModeless(); > 125 if( bl<0x10000 ) > 126 sendMsgToItem( IDC_BAR, PBM_SETRANGE, 0, MAKELPA > 127 if( packing ) > 128 sendMsg( WM_SETTEXT, 0, (LPARAM)"Compressing..." > 129 kiWindow::setFront( hwnd() ); > 130 msgloop(); > 131 } > 132 ~CArcProgressDlg() > 133 { > 134 if( isAlive() ) > 135 end( IDCANCEL ); > 136 } > 137 bool msgloop() > 138 { > 139 kiWindow::msg(); > 140 return isAlive(); > 141 } > 142 void change( const char* name=NULL, unsigned int pos=0xffffffff ) > 143 { > 144 if( name ) sendMsgToItem( IDC_FNAME, WM_SETTEXT, 0, (LPA > 145 if( pos!=0xffffffff ) > 146 if( bl<0x10000 )sendMsgToItem( IDC_BAR, PBM_SETP > 147 else sendMsgToItem( IDC_BAR, > 148 } > 149 }; > 150 > 151 > 152 class CArcPathCheckDlg > 153 { > 154 private: > 155 class TheDlg : public kiDialog > 156 { > 157 public: > 158 TheDlg( const char* path, HWND h ) > 159 : kiDialog(IDD_PATHCHECK), result(CANCEL), path(path) { > 160 enum { YES, ALL_YES, CANCEL } result; > 161 private: > 162 const char* path; > 163 BOOL onInit() > 164 { > 165 sendMsgToItem( IDC_PATHNAME, WM_SETTEXT, 0, (LPARAM)path > 166 return TRUE; > 167 } > 168 BOOL CALLBACK proc( UINT msg, WPARAM wp, LPARAM lp ) > 169 { > 170 if( msg==WM_COMMAND ) > 171 switch( LOWORD(wp) ) > 172 { > 173 case IDYES: result = YES; end(IDOK); > 174 case ID_ALLYES: result = ALL_YES; end(IDOK); > 175 case ID_ALLNO: result = CANCEL; end(IDCANCEL); > 176 } > 177 return FALSE; > 178 } > 179 }; > 180 > 181 private: > 182 bool all_yes; > 183 > 184 public: > 185 CArcPathCheckDlg() : all_yes(false) {} > 186 > 187 bool is_ok_to_extract( const char* path, kiWindow* wnd ) > 188 { > 189 if( all_yes ) > 190 return true; > 191 switch( TheDlg(path,wnd?wnd->hwnd():NULL).result ) > 192 { > 193 case TheDlg::ALL_YES: all_yes = true; > 194 case TheDlg::YES: return true; > 195 } > 196 return false; > 197 } > 198 }; > 199 > 200 > 201 #endif

Added b2e.ico version [9d46d146eeea42a5]

cannot compute difference between binary files

Added kilib/kilib.h version [c66ea8b266dd9f08]

> 1 //--- K.I.LIB --- > 2 // kilib.h : main-header of K.I.LIB > 3 > 4 #ifndef AFX_KILIB_H__89998F34_A9FE_4A27_A159_671F85AA9383__INCLUDED_ > 5 #define AFX_KILIB_H__89998F34_A9FE_4A27_A159_671F85AA9383__INCLUDED_ > 6 > 7 #include "kl_str.h" > 8 #include "kl_misc.h" > 9 #include "kl_cmd.h" > 10 #include "kl_wnd.h" > 11 #include "kl_file.h" > 12 #include "kl_app.h" > 13 #include "kl_reg.h" > 14 #include "kl_find.h" > 15 #include "kl_wcmn.h" > 16 #include "kl_dnd.h" > 17 > 18 extern kiApp* app(); > 19 extern void kilib_create_new_app(); > 20 > 21 #ifdef KILIB_LOG > 22 #define Log(_s_) app()->log((const char*)(_s_)) > 23 #else > 24 #define Log(_s_) > 25 #endif > 26 > 27 #endif

Added kilib/kilibext.h version [4783cacefbe06bfc]

> 1 //--- K.I.LIB --- > 2 // kilibext.h : extra-classes of K.I.LIB > 3 > 4 #ifndef AFX_KILIBEXT_H__89998F34_A9FE_4A27_A159_671F85AA9383__INCLUDED_ > 5 #define AFX_KILIBEXT_H__89998F34_A9FE_4A27_A159_671F85AA9383__INCLUDED_ > 6 > 7 #include "kilib.h" > 8 #include "kl_carc.h" > 9 #include "kl_rythp.h" > 10 > 11 #endif

Added kilib/kl_app.cpp version [c970fd44dc7139a9]

> 1 //--- K.I.LIB --- > 2 // kl_app.h : application class for K.I.LIB > 3 > 4 #include "stdafx.h" > 5 #include "kilib.h" > 6 > 7 //------------ 唯一のアプリケーションオブジェクトの管理 ------------// > 8 > 9 kiApp* kiApp::st_pApp = NULL; > 10 > 11 kiApp* app() > 12 { > 13 return kiApp::st_pApp; > 14 } > 15 > 16 //-------------------- スタートアップコード ------------------------// > 17 > 18 void kilib_startUp() > 19 { > 20 // 英語ロケールテスト用 > 21 //::SetThreadUILanguage(0x0409); > 22 > 23 //-- K.I.LIB 初期化 > 24 kiStr::init(); > 25 kiWindow::init(); > 26 > 27 //-- キーボード状態クリア > 28 ::GetAsyncKeyState( VK_SHIFT ); > 29 > 30 //-- アプリケーションインスタンスを作成 > 31 kilib_create_new_app(); > 32 if( app() ) > 33 { > 34 // コマンドライン分割 > 35 kiCmdParser cmd( ::GetCommandLine(), true ); > 36 > 37 // 実行 > 38 app()->run( cmd ); > 39 } > 40 > 41 //-- K.I.LIB 終了 > 42 kiWindow::finish(); > 43 > 44 delete app(); > 45 ::ExitProcess( 0 ); > 46 } > 47 > 48 //--------------- C-Runtime初期化コード削除周りの処理 ---------------// > 49 > 50 #if 0 > 51 > 52 int APIENTRY WinMain( HINSTANCE, HINSTANCE, char*, int ) > 53 { > 54 kilib_startUp(); > 55 return 0; > 56 } > 57 > 58 #else > 59 > 60 void* operator new( size_t siz ) > 61 { > 62 return (void*)::GlobalAlloc( GMEM_FIXED, siz ); > 63 } > 64 > 65 void operator delete( void* ptr ) > 66 { > 67 ::GlobalFree( (HGLOBAL)ptr ); > 68 } > 69 > 70 void main() > 71 { > 72 // main がないと何故か libc.lib がリンクエラーになるのでダミー > 73 } > 74 > 75 #endif > 76 > 77 //--------------------------------------------------------------//

Added kilib/kl_app.h version [45f14add3bfa4c0a]

> 1 //--- K.I.LIB --- > 2 // kl_app.h : application class for K.I.LIB > 3 > 4 #ifndef AFX_KIAPP_H__AC24C8AF_2187_4873_83E8_AB4F2325017B__INCLUDED_ > 5 #define AFX_KIAPP_H__AC24C8AF_2187_4873_83E8_AB4F2325017B__INCLUDED_ > 6 > 7 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ > 8 // 汎用アプリケーションクラス > 9 > 10 class kiApp > 11 { > 12 friend kiApp* app(); > 13 friend void kilib_startUp(); > 14 > 15 public: //-- 外向きインターフェイス -------------------------- > 16 > 17 // インスタンス > 18 HINSTANCE inst() const > 19 { > 20 return m_hInst; > 21 } > 22 > 23 // メインウインドウ > 24 HWND mainhwnd() const > 25 { > 26 return m_pMainWnd ? m_pMainWnd->hwnd() : NULL; > 27 } > 28 kiWindow* mainwnd() const > 29 { > 30 return m_pMainWnd; > 31 } > 32 void setMainWnd( kiWindow* wnd ) > 33 { > 34 m_pMainWnd = wnd; > 35 } > 36 > 37 // OSバージョン > 38 const OSVERSIONINFO& osver() const > 39 { > 40 return m_OsVer; > 41 } > 42 > 43 // メッセージボックス > 44 int msgBox( const char* msg, const char* caption=NULL, UINT type=MB_OK ) > 45 { > 46 return ::MessageBox( mainhwnd(), msg, caption, type ); > 47 } > 48 > 49 // シェルのアロケータでメモリ解放 > 50 void shellFree( void* ptr ) const > 51 { > 52 m_pShellAlloc->Free( ptr ); > 53 } > 54 > 55 // 仮想コード vKey のキーは押されているか? > 56 static bool keyPushed( int vKey ) > 57 { > 58 return( 0!=(::GetAsyncKeyState( vKey )>>15) ); > 59 } > 60 > 61 // CommonControl / OLE 初期化 > 62 void shellInit() > 63 { > 64 if( !m_bShellInit ) > 65 { > 66 ::InitCommonControls(); > 67 ::OleInitialize( NULL ); > 68 m_bShellInit = true; > 69 } > 70 } > 71 > 72 #ifdef KILIB_LOG > 73 void log( const char* str ) > 74 { > 75 if( !m_log.isOpened() ) > 76 { > 77 kiPath logtxt( kiPath::Exe ); logtxt += "log.txt > 78 m_log.open( logtxt, false ); > 79 } > 80 m_log.write( str, ki_strlen(str) ); > 81 m_log.write( "\r\n", 2 ); > 82 } > 83 #endif > 84 > 85 protected: //-- 派生クラス向け ----------------------------- > 86 > 87 // 起動時に呼ばれる関数。必須。 > 88 virtual void run( kiCmdParser& cmd ) = 0; > 89 > 90 protected: //-- 内部処理 ----------------------------------- > 91 > 92 kiApp() > 93 { > 94 st_pApp = this; > 95 m_hInst = ::GetModuleHandle( NULL ); > 96 m_pMainWnd = NULL; > 97 m_bShellInit = false; > 98 m_OsVer.dwOSVersionInfoSize = sizeof( m_OsVer ); > 99 ::GetVersionEx( &m_OsVer ); > 100 ::SHGetMalloc( &m_pShellAlloc ); > 101 } > 102 > 103 protected: > 104 > 105 virtual ~kiApp() > 106 { > 107 m_pShellAlloc->Release(); > 108 if( m_bShellInit ) > 109 ::OleUninitialize(); > 110 } > 111 > 112 private: > 113 > 114 HINSTANCE m_hInst; > 115 IMalloc* m_pShellAlloc; > 116 bool m_bShellInit; > 117 OSVERSIONINFO m_OsVer; > 118 kiWindow* m_pMainWnd; > 119 static kiApp* st_pApp; > 120 #ifdef KILIB_LOG > 121 kiFile m_log; > 122 #endif > 123 }; > 124 > 125 #endif

Added kilib/kl_carc.cpp version [2cd48208f91bb969]

> 1 //--- K.I.LIB --- > 2 // kl_carc.cpp : handling "common archivers' dll" > 3 > 4 #include "stdafx.h" > 5 #include "kilibext.h" > 6 > 7 > 8 //------------------------ load/unload 制御 ----------------------// > 9 > 10 > 11 kiArcDLLRaw::kiArcDLLRaw( const char* dllname ) > 12 : m_DllPath( dllname ), not_loaded_yet( true ) > 13 { > 14 ki_memzero( m_Proc, ISARC_FUNCTION_END*sizeof(FARPROC) ); > 15 f_VSb = NULL; > 16 } > 17 > 18 kiArcDLLRaw::~kiArcDLLRaw() > 19 { > 20 unload(); > 21 } > 22 > 23 bool kiArcDLLRaw::load() > 24 { > 25 not_loaded_yet = false; > 26 > 27 m_hDLL = kiSUtil::loadLibrary( m_DllPath ); > 28 if( !m_hDLL ) > 29 return false; > 30 > 31 // DLLの名前部分を切り出し > 32 char str[MAX_PATH], *p; > 33 const char *x, *y, *z; > 34 for( x=y=m_DllPath; *x!='\0'; x=kiStr::next(x) ) > 35 if( *x=='\\' || *x=='/' ) > 36 y = x + 1; > 37 for( p=str, z=y; (*z!='.' && *z!='3' && *z!='\0'); p++, z++ ) > 38 *p = *z; > 39 *p = '\0'; > 40 > 41 // コマンド送りAPIを取得。ccで始まるAPI名かも? > 42 f_Cmd = ::GetProcAddress( m_hDLL, str ); > 43 if( f_Cmd ) > 44 m_DllNameBody = str; > 45 else > 46 { > 47 f_Cmd = ::GetProcAddress( m_hDLL, "ccCommand" ); > 48 if( f_Cmd ) > 49 m_DllNameBody = "cc"; > 50 else > 51 { > 52 if( str[0]=='7' && (f_Cmd=::GetProcAddress(m_hDLL,"Seven > 53 m_DllNameBody = "SevenZip"; > 54 else > 55 return false; > 56 } > 57 } > 58 > 59 return true; > 60 } > 61 > 62 void kiArcDLLRaw::unload() > 63 { > 64 if( !not_loaded_yet && m_hDLL ) > 65 { > 66 ki_memzero( m_Proc, ISARC_FUNCTION_END*sizeof(FARPROC) ); > 67 ::FreeLibrary( m_hDLL ); > 68 not_loaded_yet = true; > 69 } > 70 } > 71 > 72 bool kiArcDLLRaw::isAlive() > 73 { > 74 if( not_loaded_yet ) > 75 load(); > 76 > 77 return (m_hDLL != NULL); > 78 } > 79 > 80 FARPROC kiArcDLLRaw::getProc( const char* procname ) > 81 { > 82 kiStr funcName = (const char*)m_DllNameBody; > 83 funcName += procname; > 84 return ::GetProcAddress( m_hDLL, funcName ); > 85 } > 86 > 87 //----------------------------- APIのラッパ群 --------------------------// > 88 > 89 > 90 int kiArcDLLRaw::command( const HWND wnd, LPCSTR cmd, LPSTR buf, const DWORD siz > 91 { > 92 if( not_loaded_yet ) > 93 if( !load() ) > 94 return ERROR_NOT_SUPPORT; > 95 > 96 // コマンド関数は必ずロードされている > 97 > 98 typedef int (WINAPI * CARC_CMD)(const HWND,const char*,char*,const DWORD > 99 return ((CARC_CMD)f_Cmd)( wnd, cmd, buf, siz ); > 100 } > 101 > 102 WORD kiArcDLLRaw::getVer() > 103 { > 104 if( not_loaded_yet ) > 105 if( !load() ) > 106 return 0; > 107 > 108 if( !f_Ver ) > 109 f_Ver = getProc( "GetVersion" ); > 110 > 111 typedef WORD (WINAPI * CARC_VER)(void); > 112 return f_Ver ? ((CARC_VER)f_Ver)() : 0; > 113 } > 114 > 115 WORD kiArcDLLRaw::getVerSub() > 116 { > 117 if( not_loaded_yet ) > 118 if( !load() ) > 119 return 0; > 120 > 121 if( !f_VSb ) > 122 f_VSb = getProc( "GetSubVersion" ); > 123 > 124 typedef WORD (WINAPI * CARC_VER)(void); > 125 return f_VSb ? ((CARC_VER)f_VSb)() : 0; > 126 } > 127 > 128 BOOL kiArcDLLRaw::check( LPCSTR filename, const int mode ) > 129 { > 130 if( not_loaded_yet ) > 131 if( !load() ) > 132 return FALSE; > 133 > 134 if( !f_Chk ) > 135 f_Chk = getProc( "CheckArchive" ); > 136 > 137 typedef BOOL (WINAPI * CARC_CHK)(const char*,const int); > 138 return f_Chk ? ((CARC_CHK)f_Chk)( filename, mode ) : FALSE; > 139 } > 140 > 141 int kiArcDLLRaw::getArcType( LPCSTR filename ) > 142 { > 143 if( not_loaded_yet ) > 144 if( !load() ) > 145 return FALSE; > 146 > 147 if( !f_Gat ) > 148 f_Gat = getProc( "GetArchiveType" ); > 149 > 150 typedef BOOL (WINAPI * CARC_GAT)(const char*); > 151 return f_Gat ? ((CARC_GAT)f_Gat)( filename ) : 0; > 152 } > 153 > 154 HARC kiArcDLLRaw::openArc( const HWND wnd, LPCSTR arcname, const DWORD flag ) > 155 { > 156 if( not_loaded_yet ) > 157 if( !load() ) > 158 return NULL; > 159 > 160 if( !f_Opn ) > 161 f_Opn = getProc( "OpenArchive" ); > 162 > 163 typedef HARC (WINAPI * CARC_OPN)(const HWND,LPCSTR,const DWORD); > 164 return f_Opn ? ((CARC_OPN)f_Opn)( wnd, arcname, flag ) : NULL; > 165 } > 166 > 167 void kiArcDLLRaw::closeArc( HARC arc ) > 168 { > 169 if( not_loaded_yet ) > 170 if( !load() ) > 171 return; > 172 > 173 if( !f_Cls ) > 174 f_Cls = getProc( "CloseArchive" ); > 175 > 176 typedef int (WINAPI * CARC_CLS)(HARC); > 177 if( f_Cls ) > 178 ((CARC_CLS)f_Cls)( arc ); > 179 } > 180 > 181 int kiArcDLLRaw::findfirst( HARC arc, LPCSTR wildname, INDIVIDUALINFO* inf ) > 182 { > 183 if( not_loaded_yet ) > 184 if( !load() ) > 185 return ERROR_NOT_SUPPORT; > 186 > 187 if( !f_Ffs ) > 188 f_Ffs = getProc( "FindFirst" ); > 189 > 190 typedef int (WINAPI * CARC_FFS)(HARC,LPCSTR,INDIVIDUALINFO FAR *); > 191 return f_Ffs ? ((CARC_FFS)f_Ffs)( arc, wildname, inf ) : ERROR_NOT_SUPPO > 192 } > 193 > 194 int kiArcDLLRaw::findnext( HARC arc, INDIVIDUALINFO* inf ) > 195 { > 196 if( not_loaded_yet ) > 197 if( !load() ) > 198 return ERROR_NOT_SUPPORT; > 199 > 200 if( !f_Fnx ) > 201 f_Fnx = getProc( "FindNext" ); > 202 > 203 typedef int (WINAPI * CARC_FNX)(HARC,INDIVIDUALINFO FAR *); > 204 return f_Fnx ? ((CARC_FNX)f_Fnx)( arc, inf ) : ERROR_NOT_SUPPORT; > 205 } > 206 > 207 int kiArcDLLRaw::getAttr( HARC arc ) > 208 { > 209 if( not_loaded_yet ) > 210 if( !load() ) > 211 return ERROR_NOT_SUPPORT; > 212 > 213 if( !f_GAr ) > 214 f_GAr = getProc( "GetAttribute" ); > 215 > 216 typedef int (WINAPI * CARC_GAR)(HARC); > 217 return f_GAr ? ((CARC_GAR)f_GAr)( arc ) : 0; > 218 } > 219 > 220 BOOL kiArcDLLRaw::setOwner( HWND wnd ) > 221 { > 222 if( not_loaded_yet ) > 223 if( !load() ) > 224 return ERROR_NOT_SUPPORT; > 225 > 226 if( !f_SOw ) > 227 f_SOw = getProc( "SetOwnerWindow" ); > 228 > 229 typedef BOOL (WINAPI * CARC_SOW)(HWND); > 230 return f_SOw ? ((CARC_SOW)f_SOw)( wnd ) : FALSE; > 231 } > 232 > 233 BOOL kiArcDLLRaw::clearOwner() > 234 { > 235 if( not_loaded_yet ) > 236 if( !load() ) > 237 return ERROR_NOT_SUPPORT; > 238 > 239 if( !f_COw ) > 240 f_COw = getProc( "ClearOwnerWindow" ); > 241 > 242 typedef BOOL (WINAPI * CARC_COW)(); > 243 return f_COw ? ((CARC_COW)f_COw)() : FALSE; > 244 } > 245

Added kilib/kl_carc.h version [f3a830d4992fbcda]

> 1 //--- K.I.LIB --- > 2 // kl_carc.h : handling "common archivers' dll" > 3 > 4 #ifndef AFX_KIARCDLLRAW_H__C94DE2A0_4292_49CE_8471_2CAA1340D216__INCLUDED_ > 5 #define AFX_KIARCDLLRAW_H__C94DE2A0_4292_49CE_8471_2CAA1340D216__INCLUDED_ > 6 > 7 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ > 8 // 統合アーカイバDLL共通の定義 > 9 > 10 // FNAME_MAX > 11 #if !defined(FNAME_MAX32) > 12 #define FNAME_MAX32 512 > 13 #define FNAME_MAX FNAME_MAX32 > 14 #else > 15 #if !defined(FNAME_MAX) > 16 #define FNAME_MAX 128 > 17 #endif > 18 #endif > 19 > 20 // CHECKARCHIVE > 21 #if !defined(CHECKARCHIVE_RAPID) > 22 #define CHECKARCHIVE_RAPID 0 > 23 #define CHECKARCHIVE_BASIC 1 > 24 #define CHECKARCHIVE_FULLCRC 2 > 25 #endif > 26 > 27 // ISARC > 28 #if !defined(ISARC_FUNCTION_START) > 29 #define ISARC_FUNCTION_START 0 > 30 #define ISARC 0 > 31 #define ISARC_GET_VERSION 1 > 32 #define ISARC_GET_CURSOR_INTERVAL 2 > 33 #define ISARC_SET_CURSOR_INTERVAL 3 > 34 #define ISARC_GET_BACK_GROUND_MODE 4 > 35 #define ISARC_SET_BACK_GROUND_MODE 5 > 36 #define ISARC_GET_CURSOR_MODE 6 > 37 #define ISARC_SET_CURSOR_MODE 7 > 38 #define ISARC_GET_RUNNING 8 > 39 > 40 #define ISARC_CHECK_ARCHIVE 16 > 41 #define ISARC_CONFIG_DIALOG 17 > 42 #define ISARC_GET_FILE_COUNT 18 > 43 #define ISARC_QUERY_FUNCTION_LIST 19 > 44 #define ISARC_HOUT 20 > 45 #define ISARC_STRUCTOUT 21 > 46 #define ISARC_GET_ARC_FILE_INFO 22 > 47 > 48 #define ISARC_OPEN_ARCHIVE 23 > 49 #define ISARC_CLOSE_ARCHIVE 24 > 50 #define ISARC_FIND_FIRST 25 > 51 #define ISARC_FIND_NEXT 26 > 52 #define ISARC_EXTRACT 27 > 53 #define ISARC_ADD 28 > 54 #define ISARC_MOVE 29 > 55 #define ISARC_DELETE 30 > 56 #define ISARC_SETOWNERWINDOW 31 > 57 #define ISARC_CLEAROWNERWINDOW 32 > 58 #define ISARC_SETOWNERWINDOWEX 33 > 59 #define ISARC_KILLOWNERWINDOWEX 34 > 60 > 61 #define ISARC_GET_ARC_FILE_NAME 40 > 62 #define ISARC_GET_ARC_FILE_SIZE 41 > 63 #define ISARC_GET_ARC_ORIGINAL_SIZE 42 > 64 #define ISARC_GET_ARC_COMPRESSED_SIZE 43 > 65 #define ISARC_GET_ARC_RATIO 44 > 66 #define ISARC_GET_ARC_DATE 45 > 67 #define ISARC_GET_ARC_TIME 46 > 68 #define ISARC_GET_ARC_OS_TYPE 47 > 69 #define ISARC_GET_ARC_IS_SFX_FILE 48 > 70 #define ISARC_GET_ARC_WRITE_TIME_EX 49 > 71 #define ISARC_GET_ARC_CREATE_TIME_EX 50 > 72 #define ISARC_GET_ARC_ACCESS_TIME_EX 51 > 73 #define ISARC_GET_ARC_CREATE_TIME_EX2 52 > 74 #define ISARC_GET_ARC_WRITE_TIME_EX2 53 > 75 #define ISARC_GET_FILE_NAME 57 > 76 #define ISARC_GET_ORIGINAL_SIZE 58 > 77 #define ISARC_GET_COMPRESSED_SIZE 59 > 78 #define ISARC_GET_RATIO 60 > 79 #define ISARC_GET_DATE 61 > 80 #define ISARC_GET_TIME 62 > 81 #define ISARC_GET_CRC 63 > 82 #define ISARC_GET_ATTRIBUTE 64 > 83 #define ISARC_GET_OS_TYPE 65 > 84 #define ISARC_GET_METHOD 66 > 85 #define ISARC_GET_WRITE_TIME 67 > 86 #define ISARC_GET_CREATE_TIME 68 > 87 #define ISARC_GET_ACCESS_TIME 69 > 88 #define ISARC_GET_WRITE_TIME_EX 70 > 89 #define ISARC_GET_CREATE_TIME_EX 71 > 90 #define ISARC_GET_ACCESS_TIME_EX 72 > 91 #define ISARC_SET_ENUM_MEMBERS_PROC 80 > 92 #define ISARC_CLEAR_ENUM_MEMBERS_PROC 81 > 93 > 94 #define ISARC_FUNCTION_END 81 > 95 #endif > 96 > 97 // ERROR > 98 #if !defined(ERROR_START) > 99 #define ERROR_START 0x8000 > 100 // warning > 101 #define ERROR_DISK_SPACE 0x8005 > 102 #define ERROR_READ_ONLY 0x8006 > 103 #define ERROR_USER_SKIP 0x8007 > 104 #define ERROR_UNKNOWN_TYPE 0x8008 > 105 #define ERROR_METHOD 0x8009 > 106 #define ERROR_PASSWORD_FILE 0x800A > 107 #define ERROR_VERSION 0x800B > 108 #define ERROR_FILE_CRC 0x800C > 109 #define ERROR_FILE_OPEN 0x800D > 110 #define ERROR_MORE_FRESH 0x800E > 111 #define ERROR_NOT_EXIST 0x800F > 112 #define ERROR_ALREADY_EXIST 0x8010 > 113 > 114 #define ERROR_TOO_MANY_FILES 0x8011 > 115 // error > 116 #define ERROR_MAKEDIRECTORY 0x8012 > 117 #define ERROR_CANNOT_WRITE 0x8013 > 118 #define ERROR_HUFFMAN_CODE 0x8014 > 119 #define ERROR_COMMENT_HEADER 0x8015 > 120 #define ERROR_HEADER_CRC 0x8016 > 121 #define ERROR_HEADER_BROKEN 0x8017 > 122 #define ERROR_ARC_FILE_OPEN 0x8018 > 123 #define ERROR_NOT_ARC_FILE 0x8019 > 124 #define ERROR_CANNOT_READ 0x801A > 125 #define ERROR_FILE_STYLE 0x801B > 126 #define ERROR_COMMAND_NAME 0x801C > 127 #define ERROR_MORE_HEAP_MEMORY 0x801D > 128 #define ERROR_ENOUGH_MEMORY 0x801E > 129 #if !defined(ERROR_ALREADY_RUNNING) > 130 #define ERROR_ALREADY_RUNNING 0x801F > 131 #endif > 132 #define ERROR_USER_CANCEL 0x8020 > 133 #define ERROR_HARC_ISNOT_OPENED 0x8021 > 134 #define ERROR_NOT_SEARCH_MODE 0x8022 > 135 #define ERROR_NOT_SUPPORT 0x8023 > 136 #define ERROR_TIME_STAMP 0x8024 > 137 #define ERROR_TMP_OPEN 0x8025 > 138 #define ERROR_LONG_FILE_NAME 0x8026 > 139 #define ERROR_ARC_READ_ONLY 0x8027 > 140 #define ERROR_SAME_NAME_FILE 0x8028 > 141 #define ERROR_NOT_FIND_ARC_FILE 0x8029 > 142 #define ERROR_RESPONSE_READ 0x802A > 143 #define ERROR_NOT_FILENAME 0x802B > 144 #define ERROR_TMP_COPY 0x802C > 145 #define ERROR_EOF 0x802D > 146 #define ERROR_ADD_TO_LARC 0x802E > 147 #define ERROR_TMP_BACK_SPACE 0x802F > 148 #define ERROR_SHARING 0x8030 > 149 #define ERROR_NOT_FIND_FILE 0x8031 > 150 #define ERROR_LOG_FILE 0x8032 > 151 #define ERROR_NO_DEVICE 0x8033 > 152 #define ERROR_GET_ATTRIBUTES 0x8034 > 153 #define ERROR_SET_ATTRIBUTES 0x8035 > 154 #define ERROR_GET_INFORMATION 0x8036 > 155 #define ERROR_GET_POINT 0x8037 > 156 #define ERROR_SET_POINT 0x8038 > 157 #define ERROR_CONVERT_TIME 0x8039 > 158 #define ERROR_GET_TIME 0x803a > 159 #define ERROR_SET_TIME 0x803b > 160 #define ERROR_CLOSE_FILE 0x803c > 161 #define ERROR_HEAP_MEMORY 0x803d > 162 #define ERROR_HANDLE 0x803e > 163 #define ERROR_TIME_STAMP_RANGE 0x803f > 164 #define ERROR_MAKE_ARCHIVE 0x8040 > 165 > 166 #define ERROR_END ERROR_MAKE_ARCHIVE > 167 #define ERROR_BUF_TOO_SMALL 0x8041 /**/ > 168 #endif > 169 > 170 // CONFIG > 171 #if !defined(UNPACK_CONFIG_MODE) > 172 #define UNPACK_CONFIG_MODE 1 > 173 #define PACK_CONFIG_MODE 2 > 174 #endif > 175 > 176 // OPENARCHIVE > 177 #if !defined(EXTRACT_FOUND_FILE) > 178 #define M_INIT_FILE_USE 0x00000001L > 179 #define M_REGARDLESS_INIT_FILE 0x00000002L > 180 #define M_NO_BACKGROUND_MODE 0x00000004L > 181 #define M_NOT_USE_TIME_STAMP 0x00000008L > 182 #define M_EXTRACT_REPLACE_FILE 0x00000010L > 183 #define M_EXTRACT_NEW_FILE 0x00000020L > 184 #define M_EXTRACT_UPDATE_FILE 0x00000040L > 185 #define M_CHECK_ALL_PATH 0x00000100L > 186 #define M_CHECK_FILENAME_ONLY 0x00000200L > 187 #define M_CHECK_DISK_SIZE 0x00000400L > 188 #define M_REGARDLESS_DISK_SIZE 0x00000800L > 189 #define M_USE_DRIVE_LETTER 0x00001000L > 190 #define M_NOT_USE_DRIVE_LETTER 0x00002000L > 191 #define M_INQUIRE_DIRECTORY 0x00004000L > 192 #define M_NOT_INQUIRE_DIRECTORY 0x00008000L > 193 #define M_INQUIRE_WRITE 0x00010000L > 194 #define M_NOT_INQUIRE_WRITE 0x00020000L > 195 #define M_CHECK_READONLY 0x00040000L > 196 #define M_REGARDLESS_READONLY 0x00080000L > 197 #define M_REGARD_E_COMMAND 0x00100000L > 198 #define M_REGARD_X_COMMAND 0x00200000L > 199 #define M_ERROR_MESSAGE_ON 0x00400000L > 200 #define M_ERROR_MESSAGE_OFF 0x00800000L > 201 #define M_BAR_WINDOW_ON 0x01000000L > 202 #define M_BAR_WINDOW_OFF 0x02000000L > 203 #define M_CHECK_PATH 0x04000000L > 204 #define M_RECOVERY_ON 0x08000000L > 205 > 206 #define M_MAKE_INDEX_FILE 0x10000000L > 207 #define M_NOT_MAKE_INDEX_FILE 0x20000000L > 208 #define EXTRACT_FOUND_FILE 0x40000000L > 209 #define EXTRACT_NAMED_FILE 0x80000000L > 210 #endif > 211 > 212 // ATTRIBUTE > 213 #ifndef FA_RDONLY > 214 #define FA_RDONLY 0x01 > 215 #define FA_HIDDEN 0x02 > 216 #define FA_SYSTEM 0x04 > 217 #define FA_LABEL 0x08 > 218 #define FA_DIREC 0x10 > 219 #define FA_ARCH 0x20 > 220 #endif > 221 #ifndef FA_ENCRYPTED > 222 #define FA_ENCRYPTED 0x40 > 223 #endif > 224 > 225 // STRUCTURES > 226 #if defined(__BORLANDC__) > 227 #pragma option -a- > 228 #else > 229 #pragma pack(1) > 230 #endif > 231 > 232 typedef HGLOBAL HARCHIVE; > 233 > 234 #ifndef ARC_DECSTRACT > 235 #define ARC_DECSTRACT > 236 typedef HGLOBAL HARC; > 237 > 238 typedef struct { > 239 DWORD dwOriginalSize; > 240 DWORD dwCompressedSize; > 241 DWORD dwCRC; > 242 UINT uFlag; > 243 UINT uOSType; > 244 WORD wRatio; > 245 WORD wDate; > 246 WORD wTime; > 247 char szFileName[FNAME_MAX32 + 1]; > 248 char dummy1[3]; > 249 char szAttribute[8]; > 250 char szMode[8]; > 251 } INDIVIDUALINFO, FAR *LPINDIVIDUALINFO; > 252 > 253 typedef struct { > 254 DWORD dwFileSize; > 255 DWORD dwWriteSize; > 256 char szSourceFileName[FNAME_MAX32 + 1]; > 257 char dummy1[3]; > 258 char szDestFileName[FNAME_MAX32 + 1]; > 259 char dummy[3]; > 260 } EXTRACTINGINFO, FAR *LPEXTRACTINGINFO; > 261 > 262 typedef struct { > 263 EXTRACTINGINFO exinfo; > 264 DWORD dwCompressedSize; > 265 DWORD dwCRC; > 266 UINT uOSType; > 267 WORD wRatio; > 268 WORD wDate; > 269 WORD wTime; > 270 char szAttribute[8]; > 271 char szMode[8]; > 272 } EXTRACTINGINFOEX, *LPEXTRACTINGINFOEX; > 273 #endif > 274 > 275 #if !defined(__BORLANDC__) > 276 #pragma pack() > 277 #else > 278 #pragma option -a. > 279 #endif > 280 > 281 #if !defined(__BORLANDC__) > 282 #define _export > 283 #endif > 284 > 285 // WindowsMessage > 286 #ifndef WM_ARCEXTRACT > 287 #define WM_ARCEXTRACT "wm_arcextract" > 288 #define ARCEXTRACT_BEGIN 0 > 289 #define ARCEXTRACT_INPROCESS 1 > 290 #define ARCEXTRACT_END 2 > 291 #define ARCEXTRACT_OPEN 3 > 292 #define ARCEXTRACT_COPY 4 > 293 typedef BOOL CALLBACK ARCHIVERPROC(HWND,UINT,UINT,LPEXTRACTINGINFOEX); > 294 typedef ARCHIVERPROC *LPARCHIVERPROC; > 295 #endif > 296 > 297 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ > 298 // 統合アーカイバDLLを非常に薄く覆うレイヤ > 299 > 300 class kiArcDLLRaw > 301 { > 302 public: //-- 外向きインターフェイス -------------------------- > 303 > 304 // DLL名で初期化。 > 305 kiArcDLLRaw( const char* dllname ); > 306 kiPath& name() > 307 { return m_DllPath; } > 308 > 309 // DLLが生きているかどうか。 > 310 bool isAlive(); > 311 > 312 // API のラッパ [ DLLやAPIが無いときの返値 ] > 313 > 314 // バージョンx100 [ 0 ] > 315 WORD getVer(); > 316 // バージョンサブx100 [ 0 ] > 317 WORD getVerSub(); > 318 // コマンド送り [ ERROR_NOT_SUPPORT ] > 319 int command( const HWND wnd, LPCSTR cmd, LPSTR buf, const DWORD > 320 // 書庫チェック [ FALSE ] > 321 BOOL check( LPCSTR filename, const int mode ); > 322 // 書庫の種類 [ 0 ] > 323 int getArcType( LPCSTR filename ); > 324 > 325 // 開く [ NULL ] > 326 HARC openArc( const HWND wnd, LPCSTR arcname, const DWORD flag ) > 327 // 閉じる > 328 void closeArc( HARC arc ); > 329 // 一つ目を検索 [ ERROR_NOT_SUPPORT ] > 330 int findfirst( HARC arc, LPCSTR wildname, INDIVIDUALINFO* inf ); > 331 // 二つ目以降を検索 [ ERROR_NOT_SUPPORT ] > 332 int findnext( HARC arc, INDIVIDUALINFO* inf ); > 333 // 属性取得 [ 0 ] > 334 int getAttr( HARC arc ); > 335 > 336 // オーナー指定 [ FALSE ] > 337 BOOL setOwner( HWND wnd ); > 338 // オーナー解除 [ FALSE ] > 339 BOOL clearOwner(); > 340 > 341 // ※load系は呼ばなくても内部で何とかするのでできれば使わないこと。 > 342 bool load(); > 343 void unload(); > 344 > 345 private: //-- 内部処理 ----------------------------------- > 346 > 347 HINSTANCE m_hDLL; > 348 bool not_loaded_yet; > 349 > 350 kiPath m_DllPath; > 351 kiStr m_DllNameBody; > 352 FARPROC getProc( const char* procname ); > 353 > 354 FARPROC m_Proc[ ISARC_FUNCTION_END ]; > 355 FARPROC f_VSb; > 356 #define f_Cmd m_Proc[ ISARC ] > 357 #define f_Chk m_Proc[ ISARC_GET_VERSION ] > 358 #define f_Gat m_Proc[ 13 ] > 359 #define f_Ver m_Proc[ ISARC_CHECK_ARCHIVE ] > 360 #define f_Opn m_Proc[ ISARC_OPEN_ARCHIVE ] > 361 #define f_Cls m_Proc[ ISARC_CLOSE_ARCHIVE ] > 362 #define f_Ffs m_Proc[ ISARC_FIND_FIRST ] > 363 #define f_Fnx m_Proc[ ISARC_FIND_NEXT ] > 364 #define f_GAr m_Proc[ ISARC_GET_ATTRIBUTE ] > 365 #define f_SOw m_Proc[ ISARC_SETOWNERWINDOW ] > 366 #define f_COw m_Proc[ ISARC_CLEAROWNERWINDOW ] > 367 > 368 public: > 369 virtual ~kiArcDLLRaw(); > 370 }; > 371 > 372 #endif

Added kilib/kl_cmd.cpp version [815f69faf09d6d48]

> 1 //--- K.I.LIB --- > 2 // kl_cmd.h : commandline parser > 3 > 4 #include "stdafx.h" > 5 #include "kilib.h" > 6 > 7 > 8 //------------------------ 文字列のメモリ処理など -----------------------// > 9 > 10 > 11 kiCmdParser::kiCmdParser( char* cmd, bool ignoreFirst ) > 12 { > 13 m_Buffer = NULL; > 14 if( cmd ) > 15 doit( cmd, ignoreFirst ); > 16 } > 17 > 18 kiCmdParser::kiCmdParser( const char* cmd, bool ignoreFirst ) > 19 { > 20 m_Buffer=NULL; > 21 if( cmd ) > 22 { > 23 m_Buffer = new char[ ki_strlen(cmd)+1 ]; > 24 ki_strcpy( m_Buffer, cmd ); > 25 doit( m_Buffer, ignoreFirst ); > 26 } > 27 } > 28 > 29 kiCmdParser::~kiCmdParser() > 30 { > 31 delete [] m_Buffer; > 32 } > 33 > 34 > 35 //---------------------------- 分割の処理 -----------------------------// > 36 > 37 > 38 void kiCmdParser::doit( char* start, bool ignoreFirst ) > 39 { > 40 char* p=start; > 41 char endc; > 42 bool first = true; > 43 > 44 while( *p!='\0' ) > 45 { > 46 // 余分な空白はスキップ > 47 while( *p==' ' ) //|| *p=='\t' || *p=='\r' || *p=='\n' ) > 48 p++; > 49 > 50 // " だったら、その旨記録してさらに一個進める > 51 if( *p=='"' ) > 52 endc='"', p++; > 53 else > 54 endc=' '; > 55 > 56 // end-of-text なら終了 > 57 if( *p=='\0' ) > 58 break; > 59 > 60 if( first && ignoreFirst ) > 61 first = false; > 62 else > 63 { > 64 // 引数を保存 > 65 if( *p=='-' ) > 66 m_Switch.add( p ); > 67 else > 68 m_Param.add( p ); > 69 } > 70 > 71 // 引数の終わりへ… > 72 while( *p!=endc && *p!='\0' ) > 73 p++; > 74 > 75 // 終わりは'\0'にすることによって、引数を区切る > 76 if( *p!='\0' ) > 77 *(p++) = '\0'; > 78 } > 79 }

Added kilib/kl_cmd.h version [12ecf570cf0caedb]

> 1 //--- K.I.LIB --- > 2 // kl_cmd.h : commandline parser > 3 > 4 #ifndef AFX_KICMDPARSER_H__843A27E0_5DBF_48AF_A748_FA7F111F699A__INCLUDED_ > 5 #define AFX_KICMDPARSER_H__843A27E0_5DBF_48AF_A748_FA7F111F699A__INCLUDED_ > 6 > 7 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ > 8 // kiCmdParser : コマンド文字列をchar*の配列に分割 > 9 > 10 class kiCmdParser > 11 { > 12 public: //-- 外向きインターフェイス -------------------------- > 13 > 14 // 文字列で初期化 > 15 kiCmdParser( char* cmd, bool ignoreFirst=false ); > 16 kiCmdParser( const char* cmd, bool ignoreFirst=false ); > 17 > 18 // スイッチ文字列の配列 > 19 cCharArray& option() > 20 { return m_Switch; } > 21 > 22 // スイッチ以外の文字列の配列 > 23 cCharArray& param() > 24 { return m_Param; } > 25 > 26 private: //-- 内部処理 ----------------------------------- > 27 > 28 void doit( char* start, bool ignoreFirst ); > 29 cCharArray m_Param; > 30 cCharArray m_Switch; > 31 char* m_Buffer; > 32 > 33 public: > 34 > 35 virtual ~kiCmdParser(); > 36 }; > 37 > 38 #endif

Added kilib/kl_dnd.cpp version [c1d100a942724719]

> 1 //--- K.I.LIB --- > 2 // kl_dnd.h : drag and drop operation > 3 > 4 #include "stdafx.h" > 5 #include "kilib.h" > 6 > 7 //--------------------------------------------------------------------// > 8 > 9 bool kiDropSource::DnD( kiDataObject* pObj, DWORD efct, DWORD* pefct ) > 10 { > 11 kiDropSource* pDrpSrc = new kiDropSource; > 12 pDrpSrc->AddRef(); > 13 pObj->begin(); > 14 > 15 DWORD d, *p=(pefct==NULL ? &d : pefct); > 16 HRESULT hr = ::DoDragDrop( pObj, pDrpSrc, efct, p ); > 17 > 18 pDrpSrc->Release(); > 19 return (hr == DRAGDROP_S_DROP); > 20 } > 21 > 22 //------------------------ IUnknown Implement -------------------------// > 23 > 24 kiDropSource::kiDropSource() : m_cRef( 0L ) > 25 { > 26 app()->shellInit(); // OleInitialize() > 27 } > 28 > 29 STDMETHODIMP_(ULONG) kiDropSource::AddRef() > 30 { > 31 return ++m_cRef; > 32 } > 33 > 34 STDMETHODIMP_(ULONG) kiDropSource::Release() > 35 { > 36 if( --m_cRef ) > 37 return m_cRef; > 38 > 39 delete this; > 40 return 0L; > 41 } > 42 > 43 STDMETHODIMP kiDropSource::QueryInterface( REFIID riid, void** ppObj ) > 44 { > 45 if( ::IsEqualIID( riid, IID_IUnknown ) > 46 || ::IsEqualIID( riid, IID_IDropSource ) ) > 47 { > 48 *ppObj = (void*)this; > 49 AddRef(); > 50 return S_OK; > 51 } > 52 > 53 *ppObj = NULL; > 54 return E_NOINTERFACE; > 55 } > 56 > 57 //------------------------ IDropSource Implement -------------------------// > 58 > 59 STDMETHODIMP kiDropSource::GiveFeedback( DWORD dwEffect ) > 60 { > 61 return DRAGDROP_S_USEDEFAULTCURSORS; > 62 } > 63 > 64 STDMETHODIMP kiDropSource::QueryContinueDrag( BOOL keyESC, DWORD keyOther ) > 65 { > 66 if( keyESC ) > 67 return DRAGDROP_S_CANCEL; > 68 if( !(keyOther&MK_LBUTTON) && !(keyOther&MK_RBUTTON) ) > 69 return DRAGDROP_S_DROP; > 70 return S_OK; > 71 } > 72 > 73 //------------------------ IUnknown Implement -------------------------// > 74 > 75 kiDataObject::kiDataObject() : m_cRef( 0L ), m_FormatList( 2 ) > 76 { > 77 } > 78 > 79 STDMETHODIMP_(ULONG) kiDataObject::AddRef() > 80 { > 81 return ++m_cRef; > 82 } > 83 > 84 STDMETHODIMP_(ULONG) kiDataObject::Release() > 85 { > 86 if( --m_cRef ) > 87 return m_cRef; > 88 > 89 delete this; > 90 return 0L; > 91 } > 92 > 93 STDMETHODIMP kiDataObject::QueryInterface( REFIID riid, void** ppObj ) > 94 { > 95 if( ::IsEqualIID( riid, IID_IUnknown ) > 96 || ::IsEqualIID( riid, IID_IDataObject ) ) > 97 { > 98 *ppObj = (void*)this; > 99 AddRef(); > 100 return S_OK; > 101 } > 102 > 103 *ppObj = NULL; > 104 return E_NOINTERFACE; > 105 } > 106 > 107 //------------------------ IDataObject Implement -------------------------// > 108 > 109 > 110 STDMETHODIMP kiDataObject::GetData( FORMATETC* fmtc, STGMEDIUM* stg ) > 111 { > 112 HRESULT hr = QueryGetData( fmtc ); > 113 if( FAILED(hr) ) > 114 return hr; > 115 bool res = giveData( *fmtc, stg, m_bFirst ); > 116 m_bFirst = false; > 117 return res ? S_OK : STG_E_MEDIUMFULL; > 118 } > 119 > 120 STDMETHODIMP kiDataObject::QueryGetData( FORMATETC* fmtc ) > 121 { > 122 for( unsigned int i=0; i!=m_FormatList.len(); i++ ) > 123 if( m_FormatList[i].cfFormat == fmtc->cfFormat ) > 124 // if(fmtc & TYMED_HGLOBAL) > 125 return S_OK; > 126 return DV_E_FORMATETC; > 127 } > 128 > 129 //---------- Enumrator ---------// > 130 > 131 class kiDataObject_Enum : public IEnumFORMATETC > 132 { > 133 public: > 134 kiDataObject_Enum( kiDataObject* p ) > 135 : m_cRef( 0L ), m_pObj( p ), m_nCur( 0L ) > 136 { > 137 m_pObj->AddRef(); > 138 } > 139 ~kiDataObject_Enum() > 140 { > 141 m_pObj->Release(); > 142 } > 143 STDMETHODIMP_(ULONG) AddRef() > 144 { > 145 return ++m_cRef; > 146 } > 147 STDMETHODIMP_(ULONG) Release() > 148 { > 149 if( --m_cRef ) > 150 return m_cRef; > 151 delete this; > 152 return 0L; > 153 } > 154 STDMETHODIMP QueryInterface( REFIID riid, void** ppObj ) > 155 { > 156 if( ::IsEqualIID( riid, IID_IUnknown ) > 157 || ::IsEqualIID( riid, IID_IEnumFORMATETC ) ) > 158 { > 159 *ppObj = (void*)this; > 160 AddRef(); > 161 return S_OK; > 162 } > 163 *ppObj = NULL; > 164 return E_NOINTERFACE; > 165 } > 166 STDMETHODIMP Clone( IEnumFORMATETC** ppNew ) > 167 { > 168 *ppNew = new kiDataObject_Enum( m_pObj ); > 169 ((kiDataObject_Enum*)(*ppNew))->m_nCur = m_nCur; > 170 (*ppNew)->AddRef(); > 171 return S_OK; > 172 } > 173 STDMETHODIMP Reset() > 174 { > 175 m_nCur = 0; > 176 return S_OK; > 177 } > 178 STDMETHODIMP Skip( ULONG celt ) > 179 { > 180 m_nCur += celt; > 181 if( m_pObj->m_FormatList.len() <= m_nCur ) > 182 { > 183 m_nCur = m_pObj->m_FormatList.len() - 1; > 184 return S_FALSE; > 185 } > 186 return S_OK; > 187 } > 188 STDMETHODIMP Next( ULONG celt, FORMATETC* pFmt, ULONG* fetched ) > 189 { > 190 if( fetched ) > 191 *fetched = 0L; > 192 if( !pFmt ) > 193 return E_POINTER; > 194 ULONG i; > 195 for( i=0; i < celt && m_nCur < m_pObj->m_FormatList.len( > 196 *pFmt++ = m_pObj->m_FormatList[m_nCur]; > 197 if( fetched ) > 198 *fetched = i; > 199 return i==celt ? S_OK : S_FALSE; > 200 } > 201 private: > 202 ULONG m_cRef; > 203 ULONG m_nCur; > 204 kiDataObject* m_pObj; > 205 }; > 206 > 207 STDMETHODIMP kiDataObject::EnumFormatEtc( DWORD drctn, IEnumFORMATETC** ppEnm ) > 208 { > 209 if( !ppEnm ) > 210 return E_INVALIDARG; > 211 *ppEnm = NULL; > 212 if( drctn!=DATADIR_GET ) > 213 return E_NOTIMPL; > 214 > 215 (*ppEnm = new kiDataObject_Enum( this ))->AddRef(); > 216 return S_OK; > 217 }

Added kilib/kl_dnd.h version [3378ce3cda9a549d]

> 1 //--- K.I.LIB --- > 2 // kl_dnd.h : drag and drop operation > 3 > 4 #ifndef AFX_KIDROPSOURCE_H__141BEF0D_0DA2_4156_93E4_313535916A23__INCLUDED_ > 5 #define AFX_KIDROPSOURCE_H__141BEF0D_0DA2_4156_93E4_313535916A23__INCLUDED_ > 6 > 7 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ > 8 // kiDataObject : ドロップデータとしての標準処理 > 9 > 10 class kiDataObject : public IDataObject > 11 { > 12 protected: // 派生クラス向け処理 > 13 > 14 virtual bool giveData( const FORMATETC& fmt, STGMEDIUM* stg, bool firstc > 15 void addFormat( const FORMATETC& frm ) > 16 { > 17 m_FormatList.add( frm ); > 18 } > 19 > 20 protected: //-- IUnknown ----------- > 21 > 22 kiDataObject(); > 23 STDMETHODIMP QueryInterface( REFIID, void** ); > 24 STDMETHODIMP_(ULONG) AddRef(); > 25 STDMETHODIMP_(ULONG) Release(); > 26 private: > 27 ULONG m_cRef; > 28 > 29 private: //-- IDataObject ------------ > 30 > 31 STDMETHODIMP GetData( FORMATETC*, STGMEDIUM* ); > 32 STDMETHODIMP QueryGetData( FORMATETC* ); > 33 STDMETHODIMP EnumFormatEtc( DWORD, IEnumFORMATETC** ); > 34 STDMETHODIMP GetDataHere( FORMATETC*, STGMEDIUM* ) > 35 { > 36 return E_NOTIMPL; > 37 } > 38 STDMETHODIMP GetCanonicalFormatEtc( FORMATETC*, FORMATETC* ) > 39 { > 40 return E_NOTIMPL; > 41 } > 42 STDMETHODIMP SetData( FORMATETC*, STGMEDIUM*, BOOL ) > 43 { > 44 return E_NOTIMPL; > 45 } > 46 STDMETHODIMP DAdvise( FORMATETC*, DWORD, IAdviseSink*, DWORD* ) > 47 { > 48 return OLE_E_ADVISENOTSUPPORTED; > 49 } > 50 STDMETHODIMP DUnadvise( DWORD ) > 51 { > 52 return OLE_E_NOCONNECTION; > 53 } > 54 STDMETHODIMP EnumDAdvise( IEnumSTATDATA** ) > 55 { > 56 return OLE_E_ADVISENOTSUPPORTED; > 57 } > 58 > 59 private: //-- 内部処理 ----------------- > 60 > 61 kiArray<FORMATETC> m_FormatList; > 62 bool m_bFirst; > 63 friend class kiDataObject_Enum; > 64 > 65 public: > 66 void begin() > 67 { > 68 m_bFirst = true; > 69 } > 70 }; > 71 > 72 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ > 73 // kiDropSource : ドロップ元としての標準処理 > 74 > 75 class kiDropSource : public IDropSource > 76 { > 77 public: //-- ドラッグ&ドロップ実行! > 78 > 79 static bool DnD( kiDataObject* pObj, DWORD efct, DWORD* pefct=NULL ); > 80 > 81 private: //-- IUnknown > 82 > 83 kiDropSource(); > 84 STDMETHODIMP QueryInterface( REFIID, void** ); > 85 STDMETHODIMP_(ULONG) AddRef(); > 86 STDMETHODIMP_(ULONG) Release(); > 87 ULONG m_cRef; > 88 > 89 private: //-- IDropSource > 90 > 91 STDMETHODIMP QueryContinueDrag( BOOL, DWORD ); > 92 STDMETHODIMP GiveFeedback( DWORD ); > 93 }; > 94 > 95 #endif

Added kilib/kl_file.cpp version [0fee3831c01ce648]

> 1 //--- K.I.LIB --- > 2 // kl_file.cpp : file operations > 3 > 4 #include "stdafx.h" > 5 #include "kilib.h" > 6 > 7 //--------------------------- static --------------------------// > 8 > 9 __int64 kiFile::getSize64( const char* fname ) > 10 { > 11 HANDLE h = ::CreateFile( fname, > 12 GENERIC_READ, FILE_SHARE_WRITE|FILE_SHARE_READ, > 13 NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL|FILE_ > 14 if( h==INVALID_HANDLE_VALUE ) > 15 return 0; > 16 > 17 DWORD low, hi; > 18 low = ::GetFileSize( h, &hi ); > 19 ::CloseHandle( h ); > 20 > 21 return (__int64(hi)<<32) | low; > 22 } > 23 > 24 unsigned long kiFile::getSize( const char* fname, unsigned long err ) > 25 { > 26 HANDLE h = ::CreateFile( fname, > 27 GENERIC_READ, FILE_SHARE_WRITE|FILE_SHARE_READ, > 28 NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL|FILE_ > 29 if( h==INVALID_HANDLE_VALUE ) > 30 return err; > 31 > 32 unsigned long ans = ::GetFileSize( h, NULL ); > 33 ::CloseHandle( h ); > 34 > 35 return ans==0xffffffff ? err : ans; > 36 } > 37 > 38 //--------------------------- 結んで開いて --------------------------// > 39 > 40 > 41 bool kiFile::open( const char* filename, bool read, bool create ) > 42 { > 43 close(); > 44 > 45 if( m_bReadMode = read ) > 46 m_hFile = ::CreateFile( filename, > 47 GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTI > 48 FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCA > 49 else > 50 m_hFile = ::CreateFile( filename, > 51 GENERIC_WRITE, FILE_SHARE_READ, NULL, > 52 create ? CREATE_ALWAYS : OPEN_EXISTING, > 53 FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCA > 54 if( m_hFile == INVALID_HANDLE_VALUE ) > 55 return false; > 56 > 57 m_nBufPos = 0; > 58 if( m_bReadMode ) > 59 flush(); > 60 > 61 return true; > 62 } > 63 > 64 void kiFile::close() > 65 { > 66 if( m_hFile != INVALID_HANDLE_VALUE ) > 67 { > 68 if( !m_bReadMode ) > 69 flush(); > 70 > 71 ::CloseHandle( m_hFile ); > 72 m_hFile = INVALID_HANDLE_VALUE; > 73 } > 74 } > 75 > 76 > 77 //-------------------------- 読み書き ----------------------------// > 78 > 79 > 80 unsigned long kiFile::read( unsigned char* buf, unsigned long len ) > 81 { > 82 unsigned long ans = 0; > 83 if( m_nBufSize!=0 && m_hFile!=INVALID_HANDLE_VALUE && m_bReadMode ) > 84 { > 85 while( (m_nBufSize-m_nBufPos) <= len ) > 86 { > 87 ans += (m_nBufSize-m_nBufPos); > 88 ki_memcpy( buf, m_pBuf+m_nBufPos, m_nBufSize-m_nBufPos ) > 89 len -= (m_nBufSize-m_nBufPos); > 90 buf += (m_nBufSize-m_nBufPos); > 91 > 92 flush(); > 93 if( m_nBufSize == 0 ) > 94 return ans; > 95 } > 96 ans += len; > 97 ki_memcpy( buf, m_pBuf+m_nBufPos, len ); > 98 m_nBufPos += len; > 99 } > 100 return ans; > 101 } > 102 > 103 void kiFile::write( const void* buf, unsigned long len ) > 104 { > 105 if( m_hFile==INVALID_HANDLE_VALUE || m_bReadMode ) > 106 return; > 107 const unsigned char* ubuf = (const unsigned char*)buf; > 108 > 109 while( (kifile_bufsize-m_nBufPos) <= len ) > 110 { > 111 ki_memcpy( m_pBuf+m_nBufPos, buf, (kifile_bufsize-m_nBufPos) ); > 112 len -= (kifile_bufsize-m_nBufPos); > 113 ubuf += (kifile_bufsize-m_nBufPos); > 114 m_nBufPos = kifile_bufsize; > 115 flush(); > 116 } > 117 ki_memcpy( m_pBuf+m_nBufPos, ubuf, len ); > 118 m_nBufPos += len; > 119 } > 120 > 121 #undef putc > 122 void kiFile::putc( unsigned char c ) > 123 { > 124 if( m_hFile==INVALID_HANDLE_VALUE || m_bReadMode ) > 125 return; > 126 if( (kifile_bufsize-m_nBufPos) <= 1 ) > 127 flush(); > 128 m_pBuf[ m_nBufPos++ ] = c; > 129 } > 130 > 131 #undef getc > 132 int kiFile::getc() > 133 { > 134 if( m_nBufSize==0 || m_hFile==INVALID_HANDLE_VALUE || !m_bReadMode ) > 135 return -1; > 136 > 137 if( 0==(m_nBufSize-m_nBufPos) ) > 138 { > 139 flush(); > 140 if( m_nBufSize==0 ) > 141 return -1; > 142 } > 143 if( 1==(m_nBufSize-m_nBufPos) ) > 144 { > 145 int ans = m_pBuf[ m_nBufPos++ ]; > 146 flush(); > 147 return ans; > 148 } > 149 > 150 return m_pBuf[ m_nBufPos++ ]; > 151 } > 152 > 153 void kiFile::flush() > 154 { > 155 if( m_bReadMode ) > 156 { > 157 ::ReadFile( m_hFile, m_pBuf, kifile_bufsize, &m_nBufSize, NULL ) > 158 m_nBufPos = 0; > 159 } > 160 else > 161 { > 162 ::WriteFile( m_hFile, m_pBuf, m_nBufPos, &m_nBufSize, NULL ); > 163 m_nBufSize = m_nBufPos = 0; > 164 } > 165 }

Added kilib/kl_file.h version [15fdc1958c9c2f88]

> 1 //--- K.I.LIB --- > 2 // kl_file.h : file operations > 3 > 4 #ifndef AFX_KIFILE_H__7D126C1E_3E5C_476E_9A4E_81CA8055621D__INCLUDED_ > 5 #define AFX_KIFILE_H__7D126C1E_3E5C_476E_9A4E_81CA8055621D__INCLUDED_ > 6 > 7 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ > 8 // バイナリファイル操作 > 9 > 10 class kiFile > 11 { > 12 public: //-- static ---------------------------------------- > 13 > 14 // ファイルサイズ取得( 名前, エラー時に返したい値 ) > 15 static unsigned long getSize( const char* fname, unsigned long err=0xfff > 16 static __int64 getSize64( const char* fname ); > 17 > 18 public: //-- 外向きインターフェイス -------------------------- > 19 > 20 // 開いて閉じて > 21 bool open( const char* filename, bool read=true, bool create=true ); > 22 void close(); > 23 > 24 // 読んで書いて > 25 unsigned long read( unsigned char* buf, unsigned long len ); > 26 void write( const void* buf, unsigned long len ); > 27 int getc(); > 28 void putc( unsigned char c ); > 29 > 30 // シーク > 31 void seekTo( unsigned long pos ) > 32 { > 33 if( !m_bReadMode ) flush(); > 34 ::SetFilePointer( m_hFile, pos, NULL, FILE_BEGIN ); > 35 if( m_bReadMode ) flush(); > 36 } > 37 void seek( long pos ) > 38 { > 39 if( !m_bReadMode ) flush(); > 40 ::SetFilePointer( m_hFile, > 41 pos-(signed)m_nBufSize+(signed)m_nBufPos, NULL, > 42 FILE_CURRENT ); > 43 if( m_bReadMode ) flush(); > 44 } > 45 unsigned long tell() > 46 { > 47 return ::SetFilePointer( m_hFile, 0, NULL, FILE_CURRENT > 48 - m_nBufSize + m_nBufPos; > 49 } > 50 > 51 // 情報取得 > 52 bool isOpened() > 53 { > 54 return m_hFile != INVALID_HANDLE_VALUE; > 55 } > 56 unsigned long getSize( unsigned long* higher=NULL ) > 57 { > 58 return ::GetFileSize( m_hFile, higher ); > 59 } > 60 bool isEOF() > 61 { > 62 return (m_nBufPos==0 && m_nBufSize==0); > 63 } > 64 > 65 public: //-- 内部処理 ----------------------------------- > 66 > 67 kiFile() : kifile_bufsize( 65536 ) > 68 { > 69 m_hFile= INVALID_HANDLE_VALUE; > 70 m_pBuf = new unsigned char[kifile_bufsize]; > 71 } > 72 > 73 virtual ~kiFile() > 74 { > 75 close(); > 76 delete [] m_pBuf; > 77 } > 78 > 79 HANDLE getHandle() const > 80 { > 81 return m_hFile; > 82 } > 83 > 84 private: > 85 const int kifile_bufsize; > 86 void flush(); > 87 > 88 HANDLE m_hFile; > 89 bool m_bReadMode; > 90 unsigned char* m_pBuf; > 91 unsigned long m_nBufSize, m_nBufPos; > 92 }; > 93 > 94 #endif

Added kilib/kl_find.cpp version [16c2c7129051abe4]

> 1 //--- K.I.LIB --- > 2 // kl_find.h : FindFirstFile wrapper > 3 > 4 #include "stdafx.h" > 5 #include "kilib.h" > 6 > 7 #define isDots(p) (*p=='.' && (p[1]=='\0' || (p[1]=='.' && p[2]=='\0'))) > 8 > 9 bool kiFindFile::findfirst( const char* wild, WIN32_FIND_DATA* pfd ) > 10 { > 11 HANDLE xh = ::FindFirstFile( wild, pfd ); > 12 if( xh==INVALID_HANDLE_VALUE ) > 13 return false; > 14 while( isDots(pfd->cFileName) ) > 15 if( !::FindNextFile( xh, pfd ) ) > 16 { > 17 ::FindClose( xh ); > 18 return false; > 19 } > 20 ::FindClose( xh ); > 21 return true; > 22 } > 23 > 24 void kiFindFile::close() > 25 { > 26 first=true; > 27 if( h!=INVALID_HANDLE_VALUE ) > 28 { > 29 ::FindClose( h ), h=INVALID_HANDLE_VALUE; > 30 } > 31 } > 32 > 33 bool kiFindFile::begin( const char* wild ) > 34 { > 35 close(); > 36 > 37 h = ::FindFirstFile( wild, &fd ); > 38 if( h==INVALID_HANDLE_VALUE ) > 39 return false; > 40 while( isDots(fd.cFileName) ) > 41 if( !::FindNextFile( h, &fd ) ) > 42 { > 43 close(); > 44 return false; > 45 } > 46 return true; > 47 } > 48 > 49 bool kiFindFile::next( WIN32_FIND_DATA* pfd ) > 50 { > 51 if( h==INVALID_HANDLE_VALUE ) > 52 return false; > 53 if( first ) > 54 { > 55 first = false; > 56 ki_memcpy( pfd, &fd, sizeof(fd) ); > 57 return true; > 58 } > 59 if( !::FindNextFile( h, pfd ) ) > 60 return false; > 61 while( isDots(fd.cFileName) ) > 62 if( !::FindNextFile( h, pfd ) ) > 63 return false; > 64 return true; > 65 } > 66 > 67 #undef isDots

Added kilib/kl_find.h version [64a6dbf816844dba]

> 1 //--- K.I.LIB --- > 2 // kl_find.h : FindFirstFile wrapper > 3 > 4 #ifndef AFX_KIFINDFILE_H__86462791_815C_4F44_9F16_802B54B411BA__INCLUDED_ > 5 #define AFX_KIFINDFILE_H__86462791_815C_4F44_9F16_802B54B411BA__INCLUDED_ > 6 > 7 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ > 8 // ファイル検索 > 9 > 10 class kiFindFile > 11 { > 12 public: //-- 外向きインターフェイス -------------------------- > 13 > 14 static bool findfirst( const char* wild, WIN32_FIND_DATA* pfd ); > 15 bool begin( const char* wild ); > 16 bool next( WIN32_FIND_DATA* pfd ); > 17 > 18 public: //-- 内部処理 ----------------------------------- > 19 > 20 kiFindFile() > 21 { h = INVALID_HANDLE_VALUE; } > 22 virtual ~kiFindFile() > 23 { close(); } > 24 void close(); > 25 > 26 private: > 27 HANDLE h; > 28 bool first; > 29 WIN32_FIND_DATA fd; > 30 }; > 31 > 32 #endif

Added kilib/kl_misc.h version [497c03c8bc7cf457]

> 1 //--- K.I.LIB --- > 2 // kl_misc.h : common-classes for K.I.LIB > 3 > 4 #ifndef AFX_KILIBBASE_H__89998F34_A9FE_4A27_A159_671F85AA9383__INCLUDED_ > 5 #define AFX_KILIBBASE_H__89998F34_A9FE_4A27_A159_671F85AA9383__INCLUDED_ > 6 > 7 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ > 8 // 使用する外部関数を何となくマクロ化しておく > 9 // 追記:何でこんなことやったんだ…? > 昔の自分(^^; > 10 > 11 #define ki_strlen(p) ::lstrlen(p) > 12 #define ki_strcpy(p,s) ::lstrcpy(p,s) > 13 #define ki_strcat(p,s) ::lstrcat(p,s) > 14 #define ki_strcmp(p,s) ::lstrcmp(p,s) > 15 #define ki_strcmpi(p,s) ::lstrcmpi(p,s) > 16 #define ki_memzero(p,l) ::ZeroMemory(p,l) > 17 #define ki_memcpy(p,s,l) ::CopyMemory(p,s,l) > 18 #define ki_memmov(p,s,l) ::MoveMemory(p,s,l) > 19 #define ki_memset(p,c,l) ::FillMemory(p,l,c) > 20 inline bool ki_memcmp( const char* x, const char* y, int l ) > 21 { > 22 while( *x++==*y++ && --l ); > 23 return l==0; > 24 } > 25 > 26 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ > 27 // kiArray : 配列のようなキューのような代物 > 28 > 29 template <class T> class kiArray > 30 { > 31 public: //-- 外向きインターフェイス -------------------------- > 32 > 33 // 初期サイズ( 10〜255 )で初期化 > 34 kiArray( unsigned char start_size=10 ) > 35 { > 36 m_pArray = new T[ m_ALen=start_size ]; > 37 m_Len = 0; > 38 } > 39 > 40 // 配列を空にする > 41 void empty() > 42 { > 43 m_Len = 0; > 44 } > 45 > 46 // 要素数を取得 > 47 unsigned long len() const > 48 { > 49 return m_Len; > 50 } > 51 > 52 // 末尾に一個追加 > 53 void add( const T& obj ) > 54 { > 55 if( m_Len>=m_ALen ) > 56 { > 57 T* p = new T[ m_ALen<<=1 ]; > 58 for( unsigned long i=0; i!=m_Len; i++ ) > 59 p[i] = m_pArray[i]; > 60 delete [] m_pArray; > 61 m_pArray = p; > 62 } > 63 m_pArray[ m_Len++ ] = obj; > 64 } > 65 > 66 // 要素にアクセス > 67 T& operator []( unsigned long i ) > 68 { > 69 return m_pArray[i]; > 70 } > 71 const T& operator []( unsigned long i ) const > 72 { > 73 return m_pArray[i]; > 74 } > 75 > 76 // 配列コピー > 77 kiArray<T>& operator = ( const kiArray<T>& o ) > 78 { > 79 if( &o != this ) > 80 { > 81 empty(); > 82 for( unsigned int i=0; i!=o.len(); i++ ) > 83 add( o[i] ); > 84 } > 85 return *this; > 86 } > 87 > 88 //-- ちょっと危険なメソッド群 > 89 void alloc( unsigned long x ) > 90 { > 91 if( x > m_ALen ) > 92 { > 93 T* p = new T[ m_ALen=(m_ALen<<1)>x?(m_ALen<<1):x > 94 for( unsigned long i=0; i!=m_Len; i++ ) > 95 p[i] = m_pArray[i]; > 96 delete [] m_pArray; > 97 m_pArray = p; > 98 } > 99 } > 100 void forcelen( unsigned long x ) > 101 { > 102 alloc( x ); > 103 m_Len = x; > 104 } > 105 > 106 private: //-- 内部処理 ----------------------------------- > 107 > 108 T* m_pArray; > 109 unsigned long m_Len, m_ALen; > 110 > 111 public: > 112 > 113 virtual ~kiArray() > 114 { > 115 delete [] m_pArray; > 116 } > 117 }; > 118 > 119 #define BoolArray kiArray<bool> > 120 #define CharArray kiArray<char*> > 121 #define cCharArray kiArray<const char*> > 122 #define StrArray kiArray<kiStr> > 123 > 124 #endif

Added kilib/kl_reg.cpp version [7e2055bca5da9935]

> 1 //--- K.I.LIB --- > 2 // kl_reg.h : registry and ini-file operation > 3 > 4 #include "stdafx.h" > 5 #include "kilib.h" > 6 > 7 > 8 //---------------------------- open系 ----------------------------// > 9 > 10 > 11 bool kiRegKey::open( HKEY parent, LPCTSTR keyname, REGSAM access ) > 12 { > 13 return (ERROR_SUCCESS == RegOpenKeyEx( parent, > 14 keyname, 0, access, &m_hKey )); > 15 } > 16 > 17 bool kiRegKey::create( HKEY parent, LPCTSTR keyname, REGSAM access ) > 18 { > 19 DWORD x; > 20 return (ERROR_SUCCESS == RegCreateKeyEx( parent, > 21 keyname, 0, REG_NONE, REG_OPTION_NON_VOLATILE, access, NULL, &m_ > 22 } > 23 > 24 > 25 //------------------------- query/set系 ----------------------------// > 26 > 27 > 28 bool kiRegKey::get( LPCTSTR valname, DWORD* val ) > 29 { > 30 DWORD x=4; > 31 return (ERROR_SUCCESS == RegQueryValueEx( m_hKey, > 32 valname, NULL, NULL, (BYTE*)val, &x )); > 33 } > 34 > 35 bool kiRegKey::get( LPCTSTR valname, BYTE* val, DWORD siz ) > 36 { > 37 return (ERROR_SUCCESS == RegQueryValueEx( m_hKey, > 38 valname, NULL, NULL, val, &siz )); > 39 } > 40 > 41 bool kiRegKey::get( LPCTSTR valname, kiStr* val ) > 42 { > 43 static char dat[2048]; > 44 DWORD x = 2048; > 45 if( ERROR_SUCCESS == RegQueryValueEx( m_hKey, > 46 valname, NULL, NULL, (BYTE*)dat, &x )) > 47 { > 48 *val = dat; > 49 return true; > 50 } > 51 return false; > 52 } > 53 > 54 bool kiRegKey::set( LPCTSTR valname, DWORD val ) > 55 { > 56 return (ERROR_SUCCESS == RegSetValueEx( m_hKey, > 57 valname, 0, REG_DWORD, (BYTE*)&val, 4 )); > 58 } > 59 > 60 bool kiRegKey::set( LPCTSTR valname, BYTE* val, DWORD siz ) > 61 { > 62 return (ERROR_SUCCESS == RegSetValueEx( m_hKey, > 63 valname, 0, REG_BINARY, (BYTE*)val, siz )); > 64 } > 65 > 66 bool kiRegKey::set( LPCTSTR valname, LPCTSTR val ) > 67 { > 68 return (ERROR_SUCCESS == RegSetValueEx( m_hKey, > 69 valname, 0, REG_SZ, (BYTE*)val, ki_strlen(val)+1 )); > 70 } > 71 > 72 > 73 //--------------------------- delete系 ----------------------------// > 74 > 75 > 76 bool kiRegKey::del( LPCTSTR valname ) > 77 { > 78 return (ERROR_SUCCESS == RegDeleteValue( m_hKey, valname )); > 79 } > 80 > 81 bool kiRegKey::delSubKey( LPCTSTR keyname ) > 82 { > 83 if( app()->osver().dwPlatformId == VER_PLATFORM_WIN32_NT ) > 84 return delSubKeyRecursive( m_hKey, keyname ); > 85 else > 86 return (ERROR_SUCCESS == RegDeleteKey( m_hKey, keyname )); > 87 } > 88 > 89 bool kiRegKey::delSubKeyRecursive( HKEY k, LPCTSTR n ) > 90 { > 91 HKEY k2; > 92 if( ERROR_SUCCESS!=RegOpenKeyEx( k,n,0,KEY_READ,&k2 ) ) > 93 return false; > 94 > 95 bool ans = true; > 96 static char buf[2048]; > 97 DWORD bs = sizeof(buf); > 98 > 99 for( int i=0; > 100 ERROR_SUCCESS==RegEnumKeyEx( k2,i,buf,&bs,NULL,NULL,NULL,NULL ); > 101 i++ ) > 102 { > 103 if( !delSubKeyRecursive( k2,buf ) ) > 104 ans = false; > 105 bs = sizeof(buf); > 106 } > 107 > 108 RegCloseKey( k2 ); > 109 RegDeleteKey( k,n ); > 110 return ans; > 111 } > 112 > 113 //--------------------------- ini:初期化 ----------------------------// > 114 > 115 > 116 void kiIniFile::setFileName( const char* ini, bool exepath ) > 117 { > 118 if( !exepath ) > 119 m_FileName = ""; > 120 else > 121 { > 122 m_FileName.beSpecialPath( kiPath::Exe ); > 123 m_FileName.beBackSlash( true ); > 124 } > 125 m_FileName += ini; > 126 } > 127 > 128 > 129 //--------------------------- ini:read系 ----------------------------// > 130 > 131 > 132 int kiIniFile::getInt( const char* key, int defval ) > 133 { > 134 return ::GetPrivateProfileInt( m_CurSec, key, defval, m_FileName ); > 135 } > 136 > 137 bool kiIniFile::getBool( const char* key, bool defval ) > 138 { > 139 return (0 != ::GetPrivateProfileInt( m_CurSec, > 140 key, defval?1:0, m_FileName ) ); > 141 } > 142 > 143 const char* kiIniFile::getStr( const char* key, const char* defval ) > 144 { > 145 ::GetPrivateProfileString( m_CurSec, key, defval, > 146 m_StrBuf, sizeof(m_StrBuf), m_FileName ) > 147 return m_StrBuf; > 148 } > 149 > 150 > 151 //--------------------------- ini:write系 ----------------------------// > 152 > 153 > 154 bool kiIniFile::putStr( const char* key, const char* val ) > 155 { > 156 return (FALSE != ::WritePrivateProfileString( > 157 m_CurSec, key, val, m_FileName ) ); > 158 } > 159 > 160 bool kiIniFile::putInt( const char* key, int val ) > 161 { > 162 ::wsprintf( m_StrBuf, "%d", val ); > 163 return putStr( key, m_StrBuf ); > 164 } > 165 > 166 bool kiIniFile::putBool( const char* key, bool val ) > 167 { > 168 return putStr( key, val ? "1" : "0" ); > 169 }

Added kilib/kl_reg.h version [b513b5f4430bdfd8]

> 1 //--- K.I.LIB --- > 2 // kl_reg.h : registry and ini-file operation > 3 > 4 #ifndef AFX_KIREGKEY_H__4FD5E1B3_B8FE_45B3_B19E_3D30407C94BA__INCLUDED_ > 5 #define AFX_KIREGKEY_H__4FD5E1B3_B8FE_45B3_B19E_3D30407C94BA__INCLUDED_ > 6 > 7 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ > 8 // レジストリ操作&ini操作 > 9 > 10 class kiRegKey > 11 { > 12 public: //-- 外向きインターフェイス -------------------------- > 13 > 14 // 開く&閉じる > 15 bool open( HKEY parent, LPCTSTR keyname, REGSAM access = KEY_ALL_ACCESS > 16 bool create( HKEY parent, LPCTSTR keyname, REGSAM access = KEY_ALL_ACCES > 17 void close() > 18 { > 19 if( m_hKey ) > 20 RegCloseKey( m_hKey ); > 21 } > 22 > 23 // サブキーが存在するや否や > 24 bool exist( LPCTSTR keyname ) > 25 { > 26 HKEY k; > 27 if( ERROR_SUCCESS==RegOpenKeyEx( m_hKey,keyname,0,KEY_RE > 28 { > 29 RegCloseKey( k ); > 30 return true; > 31 } > 32 return false; > 33 } > 34 // HKEYへキャスト > 35 operator HKEY() const > 36 { > 37 return m_hKey; > 38 } > 39 > 40 // 値を得る > 41 bool get( LPCTSTR valname, DWORD* val ); > 42 bool get( LPCTSTR valname, BYTE* val, DWORD siz ); > 43 bool get( LPCTSTR valname, kiStr* val ); > 44 > 45 // 値を設定 > 46 bool set( LPCTSTR valname, DWORD val ); > 47 bool set( LPCTSTR valname, BYTE* val, DWORD siz ); > 48 bool set( LPCTSTR valname, LPCTSTR val ); > 49 > 50 // 削除 > 51 bool del( LPCTSTR valname ); > 52 bool delSubKey( LPCTSTR keyname ); > 53 > 54 public: //-- 内部処理 ----------------------------------- > 55 > 56 kiRegKey() > 57 { > 58 m_hKey = NULL; > 59 } > 60 > 61 virtual ~kiRegKey() > 62 { > 63 close(); > 64 } > 65 > 66 private: > 67 > 68 HKEY m_hKey; > 69 static bool delSubKeyRecursive( HKEY k, LPCTSTR n ); > 70 }; > 71 > 72 class kiIniFile > 73 { > 74 public: //-- 外向きインターフェイス -------------------------- > 75 > 76 // iniファイル名を設定 > 77 void setFileName( const char* ini, bool exepath=true ); > 78 void setSection( const char* section ) > 79 { m_CurSec = section; } > 80 > 81 // 読み込み > 82 // ※ 注意!getStrの返値は内部バッファな為、 > 83 // ※    呼び出し直後以外は内容を保証しない。 > 84 int getInt( const char* key, int defval ); > 85 bool getBool( const char* key, bool defval ); > 86 const char* getStr( const char* key, const char* defval ); > 87 > 88 // 書き込み > 89 bool putStr( const char* key, const char* val ); > 90 bool putInt( const char* key, int val ); > 91 bool putBool( const char* key, bool val ); > 92 > 93 private: //-- 内部処理 ----------------------------------- > 94 > 95 kiPath m_FileName; > 96 kiStr m_CurSec; > 97 char m_StrBuf[256]; > 98 }; > 99 > 100 #endif

Added kilib/kl_rythp.cpp version [3294a27309b29b65]

> 1 //--- K.I.LIB --- > 2 // kl_rythp.cpp : interpretor for simple script langauage 'Rythp' > 3 > 4 #include "stdafx.h" > 5 #include "kilibext.h" > 6 > 7 //-------------------- Variant 型変数 --------------------------// > 8 > 9 int kiVar::getInt() > 10 { > 11 int n=0; > 12 bool minus = (*m_pBuf=='-'); > 13 for( char* p = minus ? m_pBuf+1 : m_pBuf; *p; p=next(p) ) > 14 { > 15 if( '0'>*p || *p>'9' ) > 16 return 0; > 17 n = (10*n) + (*p-'0'); > 18 } > 19 return minus ? -n : n; > 20 } > 21 > 22 kiVar& kiVar::quote() > 23 { > 24 if( m_pBuf[0]=='\"' ) > 25 return *this; > 26 for( const char* p=m_pBuf; *p; p=next(p) ) > 27 if( *p==' ' ) > 28 break; > 29 if( !(*p) ) > 30 return *this; > 31 > 32 int ln=len()+1; > 33 if( m_ALen<ln+2 ) > 34 { > 35 char* tmp = new char[m_ALen=ln+2]; > 36 ki_memcpy( tmp+1,m_pBuf,ln ); > 37 delete [] m_pBuf; > 38 m_pBuf = tmp; > 39 } > 40 else > 41 ki_memmov( m_pBuf+1,m_pBuf,ln ); > 42 m_pBuf[0]=m_pBuf[ln]='\"', m_pBuf[ln+1]='\0'; > 43 return *this; > 44 } > 45 > 46 kiVar& kiVar::unquote() > 47 { > 48 if( *m_pBuf!='\"' ) > 49 return *this; > 50 for( const char *last=m_pBuf+1,*p=m_pBuf+1; *p; p=next(p) ) > 51 last=p; > 52 if( *last!='\"' ) > 53 return *this; > 54 > 55 ki_memmov( m_pBuf,m_pBuf+1,(last-m_pBuf)-1 ); > 56 m_pBuf[(last-m_pBuf)-1]='\0'; > 57 return *this; > 58 } > 59 > 60 //---------------------- 初期化・破棄 ----------------------------// > 61 > 62 kiRythpVM::kiRythpVM() > 63 { > 64 ele['%'] = "%"; > 65 ele['('] = "("; > 66 ele[')'] = ")"; > 67 ele['"'] = "\""; > 68 ele['/'] = "\n"; > 69 } > 70 > 71 //---------------------- パラメータ毎に分割 ----------------------// > 72 > 73 char* kiRythpVM::split_tonext( char* p ) > 74 { > 75 while( *p!='\0' && ( *p=='\t' || *p==' ' || *p=='\r' || *p=='\n' ) ) > 76 p++; > 77 return (*p=='\0' ? NULL : p); > 78 } > 79 > 80 char* kiRythpVM::split_toend( char* p ) > 81 { > 82 int kkc=0, dqc=0; > 83 while( *p!='\0' && kkc>=0 ) > 84 { > 85 if( *p=='(' && !(dqc&1) ) > 86 kkc++; > 87 else if( *p==')' && !(dqc&1) ) > 88 kkc--; > 89 else if( *p=='\"' ) > 90 dqc++; > 91 else if( *p=='%' ) > 92 p++; > 93 else if( (*p=='\t' || *p==' ' || *p=='\r' || *p=='\n') && kkc==0 > 94 return p; > 95 p++; > 96 } > 97 return (kkc==0 && !(dqc&1)) ? p : NULL; > 98 } > 99 > 100 bool kiRythpVM::split( char* buf, kiArray<char*>& argv, kiArray<bool>& argb, int > 101 { > 102 argv.empty(), argb.empty(), argc=0; > 103 > 104 for( char* p=buf; p=split_tonext(p); p++,argc++ ) > 105 { > 106 argv.add( p ); > 107 argb.add( *p=='(' ); > 108 > 109 if( !(p=split_toend(p)) ) > 110 return false; > 111 > 112 if( argv[argc][0]=='(' || argv[argc][0]=='"' ) > 113 argv[argc]++, *(p-1)='\0'; > 114 if( *p=='\0' ) > 115 { > 116 argc++; > 117 break; > 118 } > 119 *p='\0'; > 120 } > 121 return true; > 122 } > 123 > 124 //------------------------- 実行 -------------------------// > 125 > 126 void kiRythpVM::eval( char* str, kiVar* ans ) > 127 { > 128 // 返値をクリアしておく > 129 kiVar tmp,*aaa=&tmp; > 130 if(ans) > 131 *ans="",aaa=ans; > 132 > 133 // "function param1 param2 ..." 形式の文字列をパラメータに分割 > 134 kiArray<char*> av; > 135 kiArray<bool> ab; > 136 int ac; > 137 if( split( str,av,ab,ac ) && ac ) > 138 { > 139 // function名取得 > 140 kiVar name; > 141 getarg( av[0],ab[0],&name ); > 142 > 143 // function実行! > 144 exec_function( name, av, ab, ac, aaa ); > 145 } > 146 } > 147 > 148 void kiRythpVM::getarg( char* a, bool b, kiVar* arg ) > 149 { > 150 kiVar t; > 151 const char* p; > 152 > 153 // (...) なら eval する。 > 154 if( b ) > 155 { > 156 eval( a, &t ), *arg = t; > 157 } > 158 else > 159 { > 160 p = a; > 161 > 162 // 変数置き換え > 163 *arg=""; > 164 for( ; *p; *p && p++ ) > 165 if( *p!='%' ) > 166 { > 167 *arg += *p; > 168 } > 169 else > 170 { > 171 p++, *arg+=ele[(*p)&0xff]; > 172 } > 173 } > 174 } > 175 > 176 //------------------------- Minimum-Rythp環境 -------------------------// > 177 > 178 namespace { > 179 static bool isIntStr( const char* str ) { > 180 for(;*str;++str) > 181 if( !('0'<=*str && *str<='9' || *str==',' || *str=='-') > 182 return false; > 183 return true; > 184 } > 185 } > 186 > 187 bool kiRythpVM::exec_function( const kiVar& name, > 188 const kiArray<char*>& a, const kiArray<bool>& b,int c, kiVar* r > 189 { > 190 // Minimum-Rythp で利用できる function は以下の通り。 > 191 // exec, while, if, let, +, -, *, /, =, !, between, mod, <, > > 192 > 193 kiVar t; > 194 int i,A,B,C; > 195 > 196 //----- ---- --- -- - - - > 197 //-- (exec 実行文 実行文 ...) returns last-result > 198 //----- ---- --- -- - - - > 199 if( name=="exec" ) > 200 { > 201 for( i=1; i<c; i++ ) > 202 getarg( a[i],b[i],r ); > 203 } > 204 //----- ---- --- -- - - - > 205 //-- (while 条件 繰り返す内容) returns last-result > 206 //----- ---- --- -- - - - > 207 else if( name=="while" ) > 208 { > 209 if( c>=3 ) > 210 { > 211 // (特殊処理)複数回呼ぶコードなのでコピらなきゃ駄目。 > 212 int L1=ki_strlen(a[1]), L2=ki_strlen(a[2]); > 213 char* tmp = new char[ 1 + (L1>L2 ? L1 : L2) ]; > 214 while( getarg( ki_strcpy(tmp,a[1]), b[1], &t ), t.getInt > 215 getarg( ki_strcpy(tmp,a[2]), b[2], r ); > 216 delete [] tmp; > 217 } > 218 } > 219 //----- ---- --- -- - - - > 220 //-- (if 条件 真なら [偽なら]) returns executed-result > 221 //----- ---- --- -- - - - > 222 else if( name=="if" ) > 223 { > 224 if( c>=3 ) > 225 { > 226 if( getarg( a[1],b[1],&t ), t.getInt()!=0 ) > 227 getarg( a[2],b[2],r ); > 228 else if( c>=4 ) > 229 getarg( a[3],b[3],r ); > 230 } > 231 } > 232 //----- ---- --- -- - - - > 233 //-- (let 変数名 値 値 ...) returns new-value > 234 //----- ---- --- -- - - - > 235 else if( name=="let" ) > 236 { > 237 if( c>=2 ) > 238 { > 239 *r = ""; > 240 for( i=2; i<c; i++ ) > 241 getarg( a[i],b[i],&t ), *r+=t; > 242 ele[a[1][0]&0xff] = *r; > 243 } > 244 } > 245 //----- ---- --- -- - - - > 246 //-- (= 値A 値B) returns A==B ? > 247 //----- ---- --- -- - - - > 248 else if( name=="=" ) > 249 { > 250 if( c>=3 ) > 251 { > 252 kiVar t2; > 253 getarg(a[1],b[1],&t), A=t.getInt(); > 254 getarg(a[2],b[2],&t2), B=t2.getInt(); > 255 if( isIntStr(t) && isIntStr(t2) ) > 256 *r = A==B ? "1" : "0"; > 257 else > 258 *r = t==t2 ? "1" : "0"; > 259 } > 260 } > 261 //----- ---- --- -- - - - > 262 //-- (between 値A 値B 値C) returns A <= B <= C ? > 263 //----- ---- --- -- - - - > 264 else if( name=="between" ) > 265 { > 266 if( c>=4 ) > 267 { > 268 getarg(a[1],b[1],&t), A=t.getInt(); > 269 getarg(a[2],b[2],&t), B=t.getInt(); > 270 getarg(a[3],b[3],&t), C=t.getInt(); > 271 *r = (A<=B && B<=C) ? "1" : "0"; > 272 } > 273 } > 274 //----- ---- --- -- - - - > 275 //-- (< 値A 値B) returns A < B ? > 276 //----- ---- --- -- - - - > 277 else if( name=="<" ) > 278 { > 279 if( c>=3 ) > 280 { > 281 getarg(a[1],b[1],&t), A=t.getInt(); > 282 getarg(a[2],b[2],&t), B=t.getInt(); > 283 *r = (A<B) ? "1" : "0"; > 284 } > 285 } > 286 //----- ---- --- -- - - - > 287 //-- (> 値A 値B) returns A > B ? > 288 //----- ---- --- -- - - - > 289 else if( name==">" ) > 290 { > 291 if( c>=3 ) > 292 { > 293 getarg(a[1],b[1],&t), A=t.getInt(); > 294 getarg(a[2],b[2],&t), B=t.getInt(); > 295 *r = (A>B) ? "1" : "0"; > 296 } > 297 } > 298 //----- ---- --- -- - - - > 299 //-- (! 値A [値B]) returns A!=B ? or !A > 300 //----- ---- --- -- - - - > 301 else if( name=="!" ) > 302 { > 303 if( c>=2 ) > 304 { > 305 getarg(a[1],b[1],&t), A=t.getInt(); > 306 if( c==2 ) > 307 *r = A==0 ? "1" : "0"; > 308 else > 309 { > 310 kiVar t2; > 311 getarg(a[1],b[1],&t), A=t.getInt(); > 312 getarg(a[2],b[2],&t2), B=t2.getInt(); > 313 if( isIntStr(t) && isIntStr(t2) ) > 314 *r = A!=B ? "1" : "0"; > 315 else > 316 *r = t!=t2 ? "1" : "0"; > 317 } > 318 } > 319 } > 320 //----- ---- --- -- - - - > 321 //-- (+ 値A 値B) returns A+B > 322 //----- ---- --- -- - - - > 323 else if( name=="+" ) > 324 { > 325 int A = 0; > 326 for( i=1; i<c; i++ ) > 327 A += (getarg(a[i],b[i],&t), t.getInt()); > 328 r->setInt(A); > 329 } > 330 //----- ---- --- -- - - - > 331 //-- (- 値A 値B) returns A-B > 332 //----- ---- --- -- - - - > 333 else if( name=="-" ) > 334 { > 335 if( c >= 2 ) > 336 { > 337 getarg(a[1],b[1],&t); > 338 int A = t.getInt(); > 339 if( c==2 ) > 340 A = -A; > 341 else > 342 for( i=2; i<c; ++i ) > 343 A -= (getarg(a[i],b[i],&t), t.getInt()) > 344 r->setInt(A); > 345 } > 346 else > 347 r->setInt(0); > 348 } > 349 //----- ---- --- -- - - - > 350 //-- (* 値A 値B) returns A*B > 351 //----- ---- --- -- - - - > 352 else if( name=="*" ) > 353 { > 354 int A = 1; > 355 for( i=1; i<c; i++ ) > 356 A *= (getarg(a[i],b[i],&t), t.getInt()); > 357 r->setInt(A); > 358 } > 359 //----- ---- --- -- - - - > 360 //-- (/ 値A 値B) returns A/B > 361 //----- ---- --- -- - - - > 362 else if( name=="/" ) > 363 { > 364 if( c>=3 ) > 365 { > 366 getarg(a[1],b[1],&t), A=t.getInt(); > 367 getarg(a[2],b[2],&t), B=t.getInt(); > 368 r->setInt( B ? A/B : A ); > 369 } > 370 } > 371 //----- ---- --- -- - - - > 372 //-- (mod 値A 値B) returns A%B > 373 //----- ---- --- -- - - - > 374 else if( name=="mod" ) > 375 { > 376 if( c>=3 ) > 377 { > 378 getarg(a[1],b[1],&t), A=t.getInt(); > 379 getarg(a[2],b[2],&t), B=t.getInt(); > 380 r->setInt( B ? A%B : 0 ); > 381 } > 382 } > 383 //----- ---- --- -- - - - > 384 //-- (slash 値A) returns A.replaceAll("\\", "/") > 385 //----- ---- --- -- - - - > 386 else if( name=="slash" ) > 387 { > 388 if( c>=2 ) > 389 { > 390 getarg(a[1],b[1],&t); > 391 *r = (const char*)t; > 392 r->replaceToSlash(); > 393 } > 394 } > 395 else > 396 return false; > 397 return true; > 398 } > 399

Added kilib/kl_rythp.h version [3d5e049ef5397815]

> 1 //--- K.I.LIB --- > 2 // kl_rythp.h : interpretor for simple script langauage 'Rythp' > 3 > 4 #ifndef AFX_KIRYTHPVM_H__4F3C28A9_7EFE_4605_A149_2C0B9A9236E5__INCLUDED_ > 5 #define AFX_KIRYTHPVM_H__4F3C28A9_7EFE_4605_A149_2C0B9A9236E5__INCLUDED_ > 6 > 7 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ > 8 // kiVar : Rythp用のVariant変数型。ほとんどただのkiStr。 > 9 > 10 class kiVar : public kiStr > 11 { > 12 public: > 13 kiVar() : kiStr(20) {} > 14 explicit kiVar( const char* s ) : kiStr( s, 20 ){} > 15 explicit kiVar( const kiStr& s ) : kiStr( s, 20 ){} > 16 explicit kiVar( const kiVar& s ) : kiStr( s, 20 ){} > 17 void operator = ( const char* s ){ kiStr::operator =(s); } > 18 > 19 int getInt(); > 20 kiVar& quote(); > 21 kiVar& unquote(); > 22 }; > 23 > 24 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ > 25 // kiRythpVM : 最小限Rythp。実用には、派生して独自の exec_function を実装すべし > 26 > 27 class kiRythpVM > 28 { > 29 public: > 30 kiRythpVM(); > 31 virtual ~kiRythpVM() {} > 32 > 33 public: > 34 // eval > 35 void eval( char* str, kiVar* ans=NULL ); > 36 > 37 protected: > 38 // 引数を適当にevalや変数置き換えをした形で取得 > 39 void getarg( char* a, bool b, kiVar* arg ); > 40 > 41 // function実行。[ bool=処理したか?、 name=function名、 a,b,c=引数、 r=返値 ] > 42 virtual bool exec_function( const kiVar& name, > 43 const CharArray& a, const BoolArray& b,int c, kiVar* r ); > 44 > 45 private: > 46 // 変数 > 47 kiVar ele[256]; > 48 > 49 // パラメータ分割 > 50 static char* split_tonext( char* p ); > 51 static char* split_toend( char* p ); > 52 static bool split( char* buf, CharArray& argv, BoolArray& argb, int& arg > 53 }; > 54 > 55 #endif

Added kilib/kl_str.cpp version [39bddacbff2819d9]

> 1 //--- K.I.LIB --- > 2 // kl_str.cpp : string classes for K.I.LIB > 3 > 4 #include "stdafx.h" > 5 #include "kilib.h" > 6 > 7 > 8 //------------------------ 2byte文字処理用 ----------------------// > 9 > 10 > 11 char kiStr::st_lb[256]; > 12 > 13 void kiStr::init() > 14 { > 15 st_lb[0] = 0; > 16 for( int c=1; c!=256; c++ ) > 17 st_lb[c] = (::IsDBCSLeadByte(c) ? 2 : 1); > 18 } > 19 > 20 > 21 //-------------------------- コピー系色々 ------------------------// > 22 > 23 > 24 kiStr::kiStr( int start_size ) > 25 { > 26 (m_pBuf = new char[ m_ALen = start_size ])[0] = '\0'; > 27 } > 28 > 29 kiStr::kiStr( const char* s, int min_size ) > 30 { > 31 int slen = ki_strlen(s) + 1; > 32 m_ALen = ( slen < min_size ) ? min_size : slen; > 33 ki_memcpy( m_pBuf=new char[m_ALen], s, slen ); > 34 } > 35 > 36 kiStr::kiStr( const kiStr& s ) > 37 { > 38 ki_memcpy( m_pBuf=new char[m_ALen=s.m_ALen], s.m_pBuf, m_ALen=s.m_ALen ) > 39 } > 40 > 41 kiStr& kiStr::operator = ( const kiStr& s ) > 42 { > 43 if( this != &s ) > 44 *this = (const char*)s; > 45 return *this; > 46 } > 47 > 48 kiStr& kiStr::operator = ( const char* s ) > 49 { > 50 int slen = ki_strlen( s ) + 1; > 51 int len = this->len(); > 52 > 53 if( m_ALen < slen || s <= m_pBuf+len || m_pBuf <= s+slen ) > 54 { > 55 char* tmp = new char[ m_ALen = ( m_ALen>slen ? m_ALen : slen) ]; > 56 ki_memcpy( tmp, s, slen ); > 57 delete [] m_pBuf; > 58 m_pBuf = tmp; > 59 } > 60 else > 61 ki_memcpy( m_pBuf, s, slen ); > 62 return *this; > 63 } > 64 > 65 kiStr& kiStr::operator += ( const char* s ) > 66 { > 67 int slen = ki_strlen( s ) + 1; > 68 int len = this->len(); > 69 > 70 if( m_ALen < len+slen+1 > 71 || ( s <= m_pBuf && m_pBuf <= s+len ) > 72 || ( m_pBuf <= s && s <= m_pBuf+slen ) ) > 73 { > 74 char* tmp = new char[ m_ALen = ( m_ALen>slen+len+1 ? m_ALen : sl > 75 ki_memcpy( tmp, m_pBuf, len ); > 76 delete [] m_pBuf; > 77 m_pBuf = tmp; > 78 } > 79 > 80 ki_memcpy( m_pBuf+len, s, slen ); > 81 return *this; > 82 } > 83 > 84 kiStr& kiStr::operator += ( char c ) > 85 { > 86 int len = this->len(); > 87 > 88 if( m_ALen < len+2 ) > 89 { > 90 char* tmp = new char[ m_ALen=len+20 ]; > 91 ki_memcpy( tmp, m_pBuf, len ); > 92 delete [] m_pBuf; > 93 m_pBuf = tmp; > 94 } > 95 > 96 m_pBuf[len]=c, m_pBuf[len+1]='\0'; > 97 return *this; > 98 } > 99 > 100 kiStr& kiStr::setInt( int n, bool cm ) > 101 { > 102 if( n==0 ) > 103 m_pBuf[0] = '0', m_pBuf[1] = '\0'; > 104 else > 105 { > 106 bool minus = (n<0); > 107 if( minus ) > 108 n= -n; > 109 > 110 char tmp[30]; > 111 tmp[29]='\0'; > 112 int i; > 113 > 114 for( i=28; i>=0; i-- ) > 115 { > 116 if( cm && (29-i)%4==0 ) > 117 tmp[i--] = ','; > 118 tmp[i] = '0' + n%10; > 119 n /= 10; > 120 if( n==0 ) > 121 break; > 122 } > 123 > 124 if( minus ) > 125 tmp[--i] = '-'; > 126 > 127 (*this) = tmp+i; > 128 } > 129 return (*this); > 130 } > 131 > 132 //-------------------------- 文字列処理全般 ------------------------// > 133 > 134 > 135 kiStr::~kiStr() > 136 { > 137 delete [] m_pBuf; > 138 } > 139 > 140 kiStr::operator const char*() const > 141 { > 142 return m_pBuf; > 143 } > 144 > 145 bool kiStr::operator == ( const char* s ) const > 146 { > 147 return 0==ki_strcmp( m_pBuf, s ); > 148 } > 149 > 150 bool kiStr::isSame( const char* s ) const > 151 { > 152 return 0==ki_strcmpi( m_pBuf, s ); > 153 } > 154 > 155 int kiStr::len() const > 156 { > 157 return ki_strlen( m_pBuf ); > 158 } > 159 > 160 > 161 //-------------------------- ユーティリティー ------------------------// > 162 > 163 > 164 kiStr& kiStr::removeTrailWS() > 165 { > 166 char* m=m_pBuf-1; > 167 for( char *p=m_pBuf; *p!='\0'; p=next(p) ) > 168 if( *p!=' ' && *p!='\t' && *p!='\n' ) > 169 m = p; > 170 *next(m) = '\0'; > 171 return *this; > 172 } > 173 > 174 kiStr& kiStr::loadRsrc( UINT id ) > 175 { > 176 ::LoadString( GetModuleHandle(NULL), id, m_pBuf, m_ALen ); > 177 return *this; > 178 } > 179 > 180 void kiPath::beSpecialPath( int nPATH ) > 181 { > 182 switch( nPATH ) > 183 { > 184 case Win: ::GetWindowsDirectory( m_pBuf, m_ALen ); break; > 185 case Sys: ::GetSystemDirectory( m_pBuf, m_ALen ); break; > 186 case Tmp: ::GetTempPath( m_ALen, m_pBuf ); > 187 case Cur: ::GetCurrentDirectory( m_ALen, m_pBuf ); break; > 188 case Exe_name: > 189 ::GetModuleFileName( NULL, m_pBuf, m_ALen );brea > 190 case Exe: > 191 { > 192 ::GetModuleFileName( NULL, m_pBuf, m_ALen ); > 193 > 194 char* m=NULL; > 195 for( char *p=m_pBuf; *p!='\0'; p=next(p) ) > 196 if( *p=='\\' ) > 197 m = p; > 198 if( m ) > 199 *m='\0'; > 200 break; > 201 } > 202 default: > 203 { > 204 *m_pBuf = '\0'; > 205 > 206 LPITEMIDLIST il; > 207 if( NOERROR!=::SHGetSpecialFolderLocation( NULL, nPATH, > 208 return; > 209 ::SHGetPathFromIDList( il, m_pBuf ); > 210 app()->shellFree( il ); > 211 } > 212 } > 213 } > 214 > 215 void kiPath::beBackSlash( bool add ) > 216 { > 217 char* last = m_pBuf; > 218 for( char* p=m_pBuf; *p!='\0'; p=next(p) ) > 219 last=p; > 220 if( *last=='\\' || *last=='/' ) > 221 { > 222 if( !add ) > 223 *last = '\0'; > 224 } > 225 else if( add && last!=m_pBuf ) > 226 *this += '\\'; > 227 } > 228 > 229 bool kiPath::beDirOnly() > 230 { > 231 char* lastslash = m_pBuf-1; > 232 for( char* p=m_pBuf; *p; p=next(p) ) > 233 if( *p=='\\' || *p=='/' ) > 234 lastslash = p; > 235 > 236 *(lastslash+1) = '\0'; > 237 > 238 return (lastslash+1 != m_pBuf); > 239 } > 240 > 241 bool kiPath::isInSameDir(const char* q) const > 242 { > 243 bool diff=false; > 244 for( const char *p=m_pBuf; *p && *q; p=next(p), q=next(q) ) > 245 if( *p != *q ) > 246 diff = true; > 247 else if( diff && (*p=='\\' || *p=='/' || *q=='\\' || *q=='/') ) > 248 return false; > 249 > 250 const char* r = (*p ? p : q); > 251 if( *r ) > 252 for( ; *r; r=next(r) ) > 253 if( *r=='\\' || *r=='/' ) > 254 return false; > 255 return true; > 256 } > 257 > 258 void kiPath::beShortPath() > 259 { > 260 ::GetShortPathName( m_pBuf, m_pBuf, m_ALen ); > 261 } > 262 > 263 void kiPath::mkdir() > 264 { > 265 for( char *p=m_pBuf; *p; p=kiStr::next(p) ) > 266 { > 267 if( (*p!='\\' && *p!='/') || (p-m_pBuf<=4) ) > 268 continue; > 269 *p = '\0'; > 270 if( !kiSUtil::exist(m_pBuf) ) > 271 if( ::CreateDirectory( m_pBuf, NULL ) ) > 272 ::SHChangeNotify( SHCNE_MKDIR,SHCNF_PATH,(const > 273 *p = '\\'; > 274 } > 275 } > 276 > 277 void kiPath::remove() > 278 { > 279 if( !kiSUtil::exist(*this) ) > 280 return; > 281 if( !kiSUtil::isdir(*this) ) > 282 { > 283 ::DeleteFile(*this); > 284 return; > 285 } > 286 > 287 // buf == filename with no last '\\' > 288 kiPath buf(*this); > 289 buf.beBackSlash(false); > 290 > 291 kiPath tmp(buf); > 292 WIN32_FIND_DATA fd; > 293 kiFindFile find; > 294 find.begin( tmp += "\\*" ); > 295 while( find.next( &fd ) ) > 296 { > 297 tmp = buf; > 298 tmp += '\\'; > 299 tmp += fd.cFileName; > 300 tmp.remove(); > 301 } > 302 find.close(); > 303 > 304 ::RemoveDirectory( buf ); > 305 } > 306 > 307 void kiPath::getBody( kiStr& str ) const > 308 { > 309 char *p=const_cast<char*>(name()),*x,c; > 310 for( x=(*p=='.'?p+1:p); *x; x=next(x) ) // 先頭の.は拡張子と見なさない > 311 if( *x=='.' ) > 312 break; > 313 c=*x, *x='\0'; > 314 str=p; > 315 *x=c; > 316 } > 317 > 318 void kiPath::getBody_all( kiStr& str ) const > 319 { > 320 // 最後の拡張子だけ削る版 > 321 char *p=const_cast<char*>(name()),*x=NULL, *n, c; > 322 for( n=(*p=='.'?p+1:p); *n; n=next(n) ) // 先頭の.は拡張子と見なさない > 323 if( *n=='.' ) > 324 x = n; > 325 if( !x )x = n; > 326 > 327 c =*x; > 328 *x ='\0'; > 329 str=p; > 330 *x =c; > 331 } > 332 > 333 const char* kiPath::ext( const char* str ) > 334 { > 335 const char *ans = NULL, *p = name(str); > 336 if( *p == '.' ) ++p; // 先頭の.は拡張子と見なさない > 337 for( ; *p; p=next(p) ) > 338 if( *p=='.' ) > 339 ans = p; > 340 return ans ? (ans+1) : p; > 341 } > 342 > 343 const char* kiPath::ext_all( const char* str ) > 344 { > 345 const char* p = name(str); > 346 if( *p == '.' ) ++p; // 先頭の.は拡張子と見なさない > 347 for( ; *p; p=next(p) ) > 348 if( *p=='.' ) > 349 return (p+1); > 350 return p; > 351 } > 352 > 353 const char* kiPath::name( const char* str ) > 354 { > 355 const char* ans = str - 1; > 356 for( const char* p=str; *p; p=next(p) ) > 357 if( *p=='\\' || *p=='/' ) > 358 ans = p; > 359 return (ans+1); > 360 } > 361 > 362 UINT kiPath::getDriveType() const > 363 { > 364 char* p; > 365 for( p=m_pBuf; *p=='\\'; p=next(p) ); > 366 for( p=m_pBuf; *p && *p!='\\'; p=next(p) ); > 367 char c=*(++p);*p='\0'; > 368 UINT ans=::GetDriveType( m_pBuf ); > 369 *p=c; return ans; > 370 } > 371 > 372 bool kiPath::endwithyen( const char* str ) > 373 { > 374 for( const char *p=str,*last=str; *p; p=next(p) ) > 375 last=p; > 376 return ( *last=='\\' || *last=='/' ); > 377 } > 378

Added kilib/kl_str.h version [db7b4a9cec9be918]

> 1 //--- K.I.LIB --- > 2 // kl_str.h : string classes for K.I.LIB > 3 > 4 #ifndef AFX_KISTR_H__1932CA2C_ACA6_4606_B57A_ACD0B7D1D35B__INCLUDED_ > 5 #define AFX_KISTR_H__1932CA2C_ACA6_4606_B57A_ACD0B7D1D35B__INCLUDED_ > 6 > 7 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ > 8 // kiStr : 単純文字列 > 9 > 10 class kiStr > 11 { > 12 friend void kilib_startUp(); > 13 > 14 private: //-- グローバルな初期化処理など --------------------- > 15 > 16 static void init(); > 17 > 18 public: //-- 外向きインターフェイス -------------------------- > 19 > 20 // 2byte文字の処理を高速化(したような気分) > 21 static char* next( char* p ) > 22 { return p+st_lb[(*p)&0xff]; } > 23 static const char* next( const char* p ) > 24 { return p+st_lb[(*p)&0xff]; } > 25 static bool isLeadByte( char c ) > 26 { return st_lb[c&0xff]==2; } > 27 > 28 // 初期化 > 29 kiStr( int start_size = 100 ); > 30 kiStr( const char* s, int min_size = 100 ); > 31 explicit kiStr( const kiStr& s ); > 32 > 33 // 演算子 > 34 kiStr& operator = ( const kiStr& ); > 35 kiStr& operator = ( const char* s ); > 36 kiStr& operator += ( const char* s ); > 37 kiStr& operator += ( char c ); > 38 bool operator == ( const char* s ) const; > 39 bool isSame( const char* s ) const; > 40 operator const char*() const; > 41 int len() const; > 42 void lower() > 43 { ::CharLower(m_pBuf); } > 44 void upper() > 45 { ::CharUpper(m_pBuf); } > 46 kiStr& setInt( int n, bool cm=false ); > 47 void replaceToSlash() { > 48 for(char* p=m_pBuf; *p; p=next(p)) > 49 if(*p=='\\') > 50 *p='/'; > 51 } > 52 > 53 // リソースからロード > 54 kiStr& loadRsrc( UINT id ); > 55 > 56 kiStr& removeTrailWS(); > 57 > 58 protected: //-- 派生クラス向け ----------------------------- > 59 > 60 char* m_pBuf; > 61 int m_ALen; > 62 > 63 private: //-- 内部処理 ------------------------------------- > 64 > 65 static char st_lb[256]; > 66 > 67 public: > 68 > 69 virtual ~kiStr(); > 70 }; > 71 > 72 inline const kiStr operator+(const kiStr& x, const kiStr& y) > 73 { return kiStr(x) += y; } > 74 inline const kiStr operator+(const char* x, const kiStr& y) > 75 { return kiStr(x) += y; } > 76 inline const kiStr operator+(const kiStr& x, const char* y) > 77 { return kiStr(x) += y; } > 78 > 79 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ > 80 // kiPath : パス特有の処理用関数付き文字列 > 81 > 82 class kiPath : public kiStr > 83 { > 84 public: //-- 外向きインターフェイス -------------------------- > 85 > 86 // 初期化 > 87 kiPath() : kiStr( MAX_PATH ){} > 88 explicit kiPath( const char* s ) : kiStr( s, MAX_PATH ){} > 89 explicit kiPath( const kiStr& s ) : kiStr( s, MAX_PATH ){} > 90 explicit kiPath( const kiPath& s ) : kiStr( s, MAX_PATH ){} > 91 kiPath( int nPATH, bool bs = true ) : kiStr( MAX_PATH ) > 92 { > 93 beSpecialPath( nPATH ); > 94 if( nPATH != Exe_name ) > 95 beBackSlash( bs ); > 96 } > 97 > 98 // operator > 99 void operator = ( const char* s ){ kiStr::operator =(s); } > 100 > 101 // 特殊パス取得 > 102 void beSpecialPath( int nPATH ); > 103 enum { Win=0x1787, Sys, Tmp, Prg, Exe, Cur, Exe_name, > 104 Snd=CSIDL_SENDTO, Dsk=CSIDL_DESKTOP, Doc=CSIDL_PERSONAL > 105 > 106 // 短いパス > 107 void beShortPath(); > 108 > 109 // 最後のバックスラッシュ制御 > 110 void beBackSlash( bool add ); > 111 > 112 // ディレクトリ名のみ > 113 bool beDirOnly(); > 114 // ファイル名except拡張子全部 > 115 void getBody( kiStr& str ) const; > 116 // ファイル名except拡張子一つ > 117 void getBody_all( kiStr& str ) const; > 118 > 119 // 複数階層mkdir > 120 void mkdir(); > 121 // 複数階層rmdir > 122 void remove(); > 123 > 124 // ドライブタイプ > 125 UINT getDriveType() const; > 126 // 同じディレクトリにあるかどうか > 127 bool isInSameDir(const char* r) const; > 128 > 129 // [static] ディレクトリ情報を含まない、ファイル名のみ抽出 > 130 static const char* name( const char* str ); > 131 // [static] 最後の拡張子。無ければNULL > 132 static const char* ext( const char* str ); > 133 // [static] 拡張子全部。無ければNULL > 134 static const char* ext_all( const char* str ); > 135 // [static] \ / で終わるか否か > 136 static bool endwithyen( const char* str ); > 137 > 138 // non-static-ver > 139 const char* name() const > 140 { return name(m_pBuf); } > 141 const char* ext() const > 142 { return ext(m_pBuf); } > 143 const char* ext_all() const > 144 { return ext_all(m_pBuf); } > 145 }; > 146 > 147 #endif

Added kilib/kl_wcmn.cpp version [9208018681295ced]

> 1 //--- K.I.LIB --- > 2 // kl_wcmn.h : windows-common-interface operatin > 3 > 4 #include "stdafx.h" > 5 #include "kilib.h" > 6 > 7 void kiSUtil::switchCurDirToExeDir() > 8 { > 9 char exepath[MAX_PATH+50]; > 10 GetModuleFileName( NULL, exepath, MAX_PATH ); > 11 char* lastslash = 0; > 12 for( char* p=exepath; *p; p=CharNext(p) ) > 13 if( *p=='\\' || *p=='/' ) > 14 lastslash = p; > 15 if(lastslash) > 16 *lastslash = '\0'; > 17 SetCurrentDirectory(exepath); > 18 } > 19 > 20 static int CALLBACK __ki__ofp( HWND w, UINT m, LPARAM l, LPARAM d ) > 21 { > 22 if( m==BFFM_INITIALIZED && d ) > 23 ::SendMessage( w, BFFM_SETSELECTION, TRUE, d ); > 24 return 0; > 25 } > 26 > 27 bool kiSUtil::getFolderDlg( char* buf, HWND par, const char* title, const char* > 28 { > 29 // 情報セット > 30 BROWSEINFO bi; > 31 ki_memzero( &bi, sizeof(bi) ); > 32 bi.hwndOwner = par; > 33 bi.pszDisplayName = buf; > 34 bi.lpszTitle = title; > 35 bi.ulFlags = BIF_RETURNONLYFSDIRS | BIF_DONTGOBELOWDOMAIN; > 36 bi.lpfn = __ki__ofp; > 37 bi.lParam = (long)def; > 38 > 39 // ダイアログ表示 > 40 ITEMIDLIST* id = ::SHBrowseForFolder( &bi ); > 41 if( id==NULL ) > 42 return false; > 43 ::SHGetPathFromIDList( id, buf ); > 44 app()->shellFree( id ); > 45 > 46 // 終了 > 47 return true; > 48 } > 49 > 50 void kiSUtil::getFolderDlgOfEditBox( HWND wnd, HWND par, const char* title ) > 51 { > 52 char str[MAX_PATH]; > 53 ::SendMessage( wnd, WM_GETTEXT, MAX_PATH, (LPARAM)str ); > 54 for( char* x=str,*l=str; *x; x=kiStr::next(x) ) > 55 l=x; > 56 if( *l=='\\' || *l=='/' ) > 57 *l='\0'; > 58 if( getFolderDlg( str, par, title, str ) ) > 59 ::SendMessage( wnd, WM_SETTEXT, 0, (LPARAM)str ); > 60 } > 61 > 62 int kiSUtil::getSysIcon( const char* ext ) > 63 { > 64 kiPath tmp( kiPath::Tmp ); > 65 tmp += "noahicontest."; > 66 tmp += ext; > 67 > 68 SHFILEINFO fi; > 69 ::SHGetFileInfo( tmp, 0, &fi, sizeof(fi), > 70 SHGFI_USEFILEATTRIBUTES | SHGFI_SYSICONINDEX ); > 71 return fi.iIcon; > 72 } > 73 > 74 void kiSUtil::msgLastError( const char* msg ) > 75 { > 76 char* pMsg; > 77 ::FormatMessage( > 78 FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM|FORMAT > 79 NULL,::GetLastError(),MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT),( > 80 if( msg ) > 81 app()->msgBox( kiStr(msg) + "\r\n\r\n" + pMsg ); > 82 else > 83 app()->msgBox( pMsg ); > 84 ::LocalFree( pMsg ); > 85 } > 86 > 87 void kiSUtil::createShortCut( const kiPath& at, const char* name ) > 88 { > 89 ::CoInitialize(NULL); > 90 > 91 IShellLink* psl; > 92 if( SUCCEEDED(::CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SE > 93 { > 94 psl->SetPath( kiPath(kiPath::Exe_name) ); > 95 psl->SetWorkingDirectory( kiPath(kiPath::Exe,false) ); > 96 > 97 IPersistFile* ppf; > 98 if( SUCCEEDED(psl->QueryInterface(IID_IPersistFile,(void**)&ppf) > 99 { > 100 wchar_t wsz[MAX_PATH]; > 101 kiPath lnkfile( at ); > 102 lnkfile += name, lnkfile += ".lnk"; > 103 ::MultiByteToWideChar(CP_ACP,0,lnkfile,-1,wsz,MAX_PATH); > 104 ppf->Save(wsz,TRUE); > 105 ppf->Release(); > 106 } > 107 psl->Release(); > 108 } > 109 ::CoUninitialize(); > 110 } > 111 > 112 bool kiSUtil::exist( const char* fname ) > 113 { > 114 return 0xffffffff != ::GetFileAttributes( fname ); > 115 } > 116 > 117 bool kiSUtil::isdir( const char* fname ) > 118 { > 119 DWORD attr = ::GetFileAttributes( fname ); > 120 return attr!=0xffffffff && (attr&FILE_ATTRIBUTE_DIRECTORY); > 121 }

Added kilib/kl_wcmn.h version [78e05bd9298c6705]

> 1 //--- K.I.LIB --- > 2 // kl_wcmn.h : windows-common-interface operatin > 3 > 4 #ifndef AFX_KIWINCOMMON_H__0686721C_CAFB_4C2C_9FE5_0F482EA6A60B__INCLUDED_ > 5 #define AFX_KIWINCOMMON_H__0686721C_CAFB_4C2C_9FE5_0F482EA6A60B__INCLUDED_ > 6 > 7 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ > 8 // シェルユーティリティークラス > 9 > 10 class kiSUtil > 11 { > 12 public: > 13 // カレントディレクトリ退避 > 14 static void switchCurDirToExeDir(); > 15 > 16 // 「フォルダの選択」ダイアログ > 17 static bool getFolderDlg( char* buf, HWND par, const char* title, const > 18 static void getFolderDlgOfEditBox( HWND wnd, HWND par, const char* title > 19 > 20 // 対応する拡張子用アイコンの、システムイメージリストのインデックスを返す。 > 21 static int getSysIcon( const char* ext ); > 22 > 23 // 最後のエラーを表示 > 24 static void msgLastError( const char* msg = NULL ); > 25 > 26 // 自分へのショートカット作成 > 27 static void createShortCut( const kiPath& at, const char* name ); > 28 > 29 // ファイルが存在する? > 30 static bool exist( const char* fname ); > 31 static bool isdir( const char* fname ); > 32 > 33 // カレントディレクトリを安全なところに移してLoadLibrary > 34 static HMODULE loadLibrary(LPCTSTR lpFileName) > 35 { > 36 char original_cur[MAX_PATH], sys[MAX_PATH]; > 37 ::GetCurrentDirectory(MAX_PATH, original_cur); > 38 ::GetSystemDirectory(sys, MAX_PATH); > 39 ::SetCurrentDirectory(sys); > 40 HMODULE han = ::LoadLibrary(lpFileName); > 41 ::SetCurrentDirectory(original_cur); > 42 return han; > 43 } > 44 }; > 45 > 46 #endif

Added kilib/kl_wnd.cpp version [619c2be4e23fbad6]

> 1 //--- K.I.LIB --- > 2 // kl_wnd.cpp : window information manager > 3 > 4 #include "stdafx.h" > 5 #include "kilib.h" > 6 > 7 > 8 //-------- Windowを作成時に HWND に kiWindow* をセットするための処理 -------// > 9 > 10 > 11 kiWindow* kiWindow::st_pCurInit = NULL; > 12 HHOOK kiWindow::st_hHook = NULL; > 13 > 14 void kiWindow::init() > 15 { > 16 // CreateWindow 用フック設置 > 17 st_hHook = ::SetWindowsHookEx( WH_CBT, &CBTProc, NULL, ::GetCurrentThrea > 18 } > 19 > 20 void kiWindow::finish() > 21 { > 22 // CreateWindow 用フック解除 > 23 ::UnhookWindowsHookEx( st_hHook ); > 24 } > 25 > 26 LRESULT CALLBACK kiWindow::CBTProc( int code, WPARAM wp, LPARAM lp ) > 27 { > 28 if( code == HCBT_CREATEWND ) > 29 { > 30 if( st_pCurInit ) > 31 { > 32 // k.i.lib のウインドウが CreateWindow された場合 > 33 st_pCurInit->setHwnd( (HWND)wp ); > 34 ::SetWindowLong( (HWND)wp, GWL_USERDATA, (LONG)st_pCurIn > 35 st_pCurInit = NULL; > 36 } > 37 else > 38 ::SetWindowLong( (HWND)wp, GWL_USERDATA, 0 ); > 39 } > 40 > 41 return ::CallNextHookEx( st_hHook, code, wp, lp ); > 42 } > 43 > 44 void kiWindow::detachHwnd() > 45 { > 46 ::SetWindowLong( hwnd(), GWL_USERDATA, 0 ); > 47 if( this == app()->mainwnd() ) > 48 app()->setMainWnd( NULL ); > 49 setHwnd( NULL ); > 50 } > 51 > 52 > 53 //------------ Window にまつわるエトセトラな処理 (static) ---------------// > 54 > 55 > 56 bool kiWindow::loopbreaker = false; > 57 > 58 void kiWindow::msg() > 59 { > 60 for( MSG msg; ::PeekMessage( &msg,NULL,0,0,PM_REMOVE ); ) > 61 ::TranslateMessage( &msg ), ::DispatchMessage( &msg ); > 62 } > 63 > 64 void kiWindow::msgLoop( msglooptype type ) > 65 { > 66 kiWindow* wnd; > 67 MSG msg; > 68 while( !loopbreaker && > 69 type==GET ? ::GetMessage( &msg,NULL,0,0 ) > 70 : ::PeekMessage( &msg,NULL,0,0,PM_REMOVE > 71 { > 72 if( wnd = app()->mainwnd() ) > 73 { > 74 if( wnd->m_hAccel ) > 75 if( ::TranslateAccelerator( wnd->hwnd(), wnd->m_ > 76 continue; > 77 if( msg.message!=WM_CHAR && wnd->isDlgMsg( &msg ) ) > 78 continue; > 79 } > 80 ::TranslateMessage( &msg ), ::DispatchMessage( &msg ); > 81 } > 82 loopbreaker = false; > 83 } > 84 > 85 void kiWindow::setFront( HWND wnd ) > 86 { > 87 const OSVERSIONINFO& v = app()->osver(); > 88 > 89 // Win2000 以上 or Win98 以上 > 90 if( ( v.dwPlatformId==VER_PLATFORM_WIN32_NT && v.dwMajorVersion>=5 ) > 91 || ( v.dwPlatformId==VER_PLATFORM_WIN32_WINDOWS && > 92 v.dwMajorVersion*100+v.d > 93 { > 94 DWORD pid; > 95 DWORD th1 = ::GetWindowThreadProcessId( ::GetForegroundWindow(), > 96 DWORD th2 = ::GetCurrentThreadId(); > 97 ::AttachThreadInput( th2, th1, TRUE ); > 98 ::SetForegroundWindow( wnd ); > 99 ::AttachThreadInput( th2, th1, FALSE ); > 100 ::BringWindowToTop( wnd ); > 101 } > 102 else // 古いWin > 103 ::SetForegroundWindow( wnd ); > 104 > 105 // Special Thanks To kazubon !! ( the author of TClock ) > 106 } > 107 > 108 void kiWindow::setCenter( HWND wnd, HWND rel ) > 109 { > 110 RECT rc,pr; > 111 ::GetWindowRect( wnd, &rc ); > 112 > 113 if( rel ) > 114 ::GetWindowRect( rel, &pr ); > 115 else > 116 ::SystemParametersInfo( SPI_GETWORKAREA, 0, &pr, 0 ); > 117 > 118 ::SetWindowPos( wnd, 0, > 119 pr.left + ( (pr.right-pr.left)-(rc.right-rc.left) )/2, > 120 pr.top + ( (pr.bottom-pr.top)-(rc.bottom-rc.top) )/2, > 121 0, 0, SWP_NOSIZE|SWP_NOZORDER ); > 122 } > 123 > 124 > 125 //------------------ Windowベースクラスとしての処理 ----------------------// > 126 > 127 > 128 kiWindow::kiWindow() > 129 { > 130 m_hWnd = NULL; > 131 m_hAccel = NULL; > 132 app()->shellInit(); > 133 } > 134 > 135 kiWindow::~kiWindow() > 136 { > 137 if( m_hWnd && ::IsWindow( m_hWnd ) ) > 138 { > 139 ::SetWindowLong( m_hWnd, GWL_USERDATA, 0 ); > 140 ::DestroyWindow( m_hWnd ); > 141 } > 142 } > 143 > 144 void kiWindow::loadAccel( UINT id ) > 145 { > 146 m_hAccel = ::LoadAccelerators( app()->inst(), MAKEINTRESOURCE(id) ); > 147 } > 148 > 149 > 150 //---------------- スタンドアロンのWindowの処理 ---------------------// > 151 > 152 // …未完成… > 153 > 154 //---------------------------- Dialog -----------------------------// > 155 > 156 > 157 kiDialog::kiDialog( UINT id ) > 158 { > 159 m_Rsrc = id; > 160 } > 161 > 162 void kiDialog::doModal( HWND parent ) > 163 { > 164 setState( true ); > 165 preCreate( this ); > 166 > 167 ::DialogBoxParam( app()->inst(), MAKEINTRESOURCE(m_Rsrc), > 168 parent, commonDlg, (LPARAM)this > 169 } > 170 > 171 void kiDialog::createModeless( HWND parent ) > 172 { > 173 setState( false ); > 174 preCreate( this ); > 175 > 176 ::CreateDialogParam( app()->inst(), MAKEINTRESOURCE(m_Rsrc), > 177 parent, commonDlg, (LPARAM)this > 178 > 179 ::ShowWindow( hwnd(), SW_SHOW ); > 180 ::UpdateWindow( hwnd() ); > 181 } > 182 > 183 void kiDialog::end( UINT endcode ) > 184 { > 185 setEndCode( endcode ); > 186 > 187 if( isModal() ) > 188 ::EndDialog( hwnd(), getEndCode() ); > 189 else > 190 ::DestroyWindow( hwnd() ); > 191 } > 192 > 193 BOOL kiDialog::commonDlg( HWND dlg, UINT msg, WPARAM wp, LPARAM lp ) > 194 { > 195 // kiDialog インターフェイスへのポインタを取得 > 196 kiDialog* ptr = (kiDialog*)::GetWindowLong( dlg, GWL_USERDATA ); > 197 if( !ptr ) return FALSE; > 198 > 199 // WM_INITDIALOG なら onInit を呼ぶ > 200 if( msg == WM_INITDIALOG ) > 201 return ptr->onInit(); > 202 > 203 // OK / Cancel 処理 > 204 else if( msg == WM_COMMAND ) > 205 { > 206 switch( LOWORD(wp) ) > 207 { > 208 case IDOK: > 209 if( ptr->onOK() ) > 210 ptr->end( IDOK ); > 211 return TRUE; > 212 case IDCANCEL: > 213 if( ptr->onCancel() ) > 214 ptr->end( IDCANCEL ); > 215 return TRUE; > 216 } > 217 } > 218 > 219 // 普通のメッセージ > 220 BOOL ans = ptr->proc( msg, wp, lp ); > 221 > 222 // WM_DESTORY ならウインドウハンドル切り離し > 223 if( msg == WM_DESTROY ) > 224 ptr->detachHwnd(); > 225 > 226 return ans; > 227 } > 228 > 229 > 230 //------------------------ PropertySheet -------------------------// > 231 > 232 > 233 kiPropSheet* kiPropSheet::st_CurInitPS = NULL; > 234 > 235 kiPropSheet::kiPropSheet() : kiDialog( 0 ) > 236 { > 237 ki_memzero( &m_Header, sizeof(m_Header) ); > 238 m_Header.dwSize = sizeof(m_Header); > 239 m_Header.dwFlags |=PSH_USECALLBACK | PSH_PROPSHEETPAGE; > 240 m_Header.pfnCallback = main_initProc; > 241 m_Header.hInstance = app()->inst(); > 242 m_Header.nStartPage = 0; > 243 } > 244 > 245 void kiPropSheet::begin() > 246 { > 247 int l = m_Pages.len(); > 248 PROPSHEETPAGE* ppsp = new PROPSHEETPAGE[ l ]; > 249 ki_memzero( ppsp, sizeof(PROPSHEETPAGE)*l ); > 250 > 251 for( int i=0; i<l; i++ ) > 252 { > 253 ppsp[i].dwSize = sizeof( PROPSHEETPAGE ); > 254 ppsp[i].hInstance = app()->inst(); > 255 ppsp[i].pfnCallback = page_initProc; > 256 ppsp[i].pfnDlgProc = page_cmmnProc; > 257 ppsp[i].dwFlags = PSP_USECALLBACK | PSP_HASHELP; > 258 m_Pages[i]->setInfo( ppsp+i ); > 259 } > 260 > 261 m_Header.ppsp = ppsp; > 262 m_Header.nPages = l; > 263 > 264 st_CurInitPS = this; > 265 PropertySheet( &m_Header ); > 266 delete [] ppsp; > 267 } > 268 > 269 void kiPropSheet::doModal( HWND parent ) > 270 { > 271 m_Header.dwFlags &= (~PSH_MODELESS); > 272 setState( true ); > 273 begin(); > 274 } > 275 > 276 void kiPropSheet::createModeless( HWND parent ) > 277 { > 278 m_Header.dwFlags |= PSH_MODELESS; > 279 setState( false ); > 280 begin(); > 281 } > 282 > 283 void kiPropSheet::end( UINT endcode ) > 284 { > 285 // 終了コードセット > 286 setEndCode( endcode ); > 287 > 288 // サブクラス化解除 > 289 ::SetWindowLong( hwnd(), GWL_WNDPROC, (LONG)m_DefProc ); > 290 > 291 // 終了 > 292 if( isModal() ) // サブクラス化解除してるので、再度 end が呼ばれることはないはク。 > 293 ::PostMessage( hwnd(), WM_COMMAND, IDCANCEL, 0 ); > 294 else > 295 ::DestroyWindow( hwnd() ); > 296 > 297 // WM_DESTROY時相当の動作 > 298 detachHwnd(); > 299 } > 300 > 301 LRESULT CALLBACK kiPropSheet::main_cmmnProc( HWND dlg, UINT msg, WPARAM wp, LPAR > 302 { > 303 kiPropSheet* ptr = (kiPropSheet*)::GetWindowLong( dlg, GWL_USERDATA ); > 304 if( !ptr ) > 305 return 0; > 306 > 307 // まずデフォルトの処理 > 308 LRESULT result = ::CallWindowProc( ptr->m_DefProc, dlg, msg, wp, lp ); > 309 > 310 // ×ボタンはキャンセル扱い > 311 if( msg==WM_SYSCOMMAND && wp==SC_CLOSE ) > 312 ::PostMessage( dlg, WM_COMMAND, IDCANCEL, 0 ); > 313 > 314 // コマンド処理 > 315 else if( msg==WM_COMMAND ) > 316 { > 317 switch( LOWORD(wp) ) > 318 { > 319 case IDOK: > 320 if( ptr->onOK() ) > 321 ptr->end( IDOK ); > 322 return TRUE; > 323 case IDCANCEL: > 324 if( ptr->onCancel() ) > 325 ptr->end( IDCANCEL ); > 326 return TRUE; > 327 case IDAPPLY: > 328 ptr->onApply(); > 329 break; > 330 case ID_KIPS_HELP: > 331 ptr->onHelp(); > 332 break; > 333 default: > 334 ptr->onCommand( LOWORD(wp) ); > 335 break; > 336 } > 337 } > 338 > 339 // ドラッグ&ドロップ > 340 else if( msg==WM_DROPFILES ) > 341 ptr->onDrop( (HDROP)wp ); > 342 > 343 return result; > 344 } > 345 > 346 struct DLGTEMPLATEEX > 347 { > 348 WORD dlgVer; > 349 WORD signature; > 350 DWORD helpID; > 351 DWORD exStyle; > 352 DWORD style; > 353 WORD cDlgItems; > 354 short x; > 355 short y; > 356 short cx; > 357 short cy; > 358 }; > 359 > 360 int CALLBACK kiPropSheet::main_initProc( HWND dlg, UINT msg, LPARAM lp ) > 361 { > 362 if( msg == PSCB_PRECREATE ) > 363 { > 364 // スタイルを指すDWORDのアドレスを取得 > 365 DWORD* pst = ( 0xffff==((DLGTEMPLATEEX*)lp)->signature ) ? > 366 &(((DLGTEMPLATEEX*)lp)->style) : > 367 // ヘルプボタンを消して最小化ボタンを付ける > 368 (*pst) &= ~DS_CONTEXTHELP; > 369 (*pst) |= WS_MINIMIZEBOX; > 370 > 371 preCreate( st_CurInitPS ); > 372 } > 373 else if( msg == PSCB_INITIALIZED ) > 374 { > 375 // 何故か出来てしまう余計なメニューを削除 > 376 HMENU sysm = ::GetSystemMenu( dlg, FALSE ); > 377 ::DeleteMenu( sysm, SC_SIZE, MF_BYCOMMAND ); > 378 ::DeleteMenu( sysm, SC_MAXIMIZE, MF_BYCOMMAND ); > 379 > 380 // 起動時はウインドウを必ず前面へ > 381 setFront( dlg ); > 382 > 383 //サブクラス化する > 384 st_CurInitPS->m_DefProc = (WNDPROC)::SetWindowLong( dlg, GWL_WND > 385 st_CurInitPS->onInit(); > 386 } > 387 return 0; > 388 } > 389 > 390 BOOL kiPropSheet::page_cmmnProc( HWND dlg, UINT msg, WPARAM wp, LPARAM lp ) > 391 { > 392 kiPropSheetPage* ptr = (kiPropSheetPage*)::GetWindowLong( dlg, GWL_USERD > 393 if( !ptr ) > 394 return FALSE; > 395 > 396 // ここで、共通処理 > 397 switch( msg ) > 398 { > 399 case WM_INITDIALOG: > 400 return ptr->onInit(); > 401 > 402 case WM_NOTIFY: > 403 switch( ((NMHDR*)lp)->code ) > 404 { > 405 case PSN_APPLY: > 406 ptr->onOK(); > 407 return TRUE; > 408 } > 409 break; > 410 > 411 case WM_COMMAND: > 412 if( lp ) > 413 switch( HIWORD(wp) ) > 414 { > 415 case BN_CLICKED: > 416 if((HWND)lp==::GetFocus()) > 417 case EN_CHANGE: > 418 case CBN_SELCHANGE: > 419 PropSheet_Changed( ptr->parent()->hwnd(), dlg ); > 420 } > 421 break; > 422 > 423 case WM_DESTROY: > 424 BOOL ans=ptr->proc( msg, wp, lp ); > 425 ptr->detachHwnd(); > 426 return ans; > 427 } > 428 > 429 return ptr->proc( msg, wp, lp ); > 430 } > 431 > 432 UINT CALLBACK kiPropSheet::page_initProc( HWND dlg, UINT msg, LPPROPSHEETPAGE pp > 433 { > 434 if( msg == PSPCB_CREATE ) > 435 preCreate( (kiWindow*)(ppsp->lParam) ); > 436 return TRUE; > 437 } > 438 > 439 void kiPropSheetPage::setInfo( PROPSHEETPAGE* p ) > 440 { > 441 p->pszTemplate = MAKEINTRESOURCE( getRsrcID() ); > 442 p->lParam = (LPARAM)this; > 443 > 444 if( m_hIcon ) > 445 { > 446 p->dwFlags|= PSP_USEHICON; > 447 p->hIcon = m_hIcon; > 448 } > 449 } > 450

Added kilib/kl_wnd.h version [3ef6f1b75010ab26]

> 1 //--- K.I.LIB --- > 2 // kl_wnd.h : window information manager > 3 > 4 #ifndef AFX_KIWINDOW_H__26105B94_1E36_42FA_8916_C2F7FB9EF994__INCLUDED_ > 5 #define AFX_KIWINDOW_H__26105B94_1E36_42FA_8916_C2F7FB9EF994__INCLUDED_ > 6 > 7 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ > 8 // kiWindow : Windowの簡単な管理 > 9 > 10 class kiWindow > 11 { > 12 friend void kilib_startUp(); > 13 > 14 private: //-- グローバルな初期化処理など --------------------- > 15 > 16 static void init(); > 17 static void finish(); > 18 > 19 public: //-- 外向きインターフェイス -------------------------- > 20 > 21 // 関連付けられているHWND > 22 HWND hwnd() > 23 { > 24 return m_hWnd; > 25 } > 26 > 27 // そのWindow用にアクセラレータをロード > 28 void loadAccel( UINT id ); > 29 > 30 // ウインドウがまだ残っているかどうかチェック > 31 bool isAlive() > 32 { > 33 if( !m_hWnd ) > 34 return false; > 35 if( ::IsWindow(m_hWnd) ) > 36 return true; > 37 m_hWnd = NULL; > 38 return false; > 39 } > 40 > 41 // 親 > 42 kiWindow* parent() > 43 { > 44 return kiwnd( ::GetParent( hwnd() ) ); > 45 } > 46 > 47 // メッセージ送信 > 48 int sendMsg( UINT msg, WPARAM wp=0, LPARAM lp=0 ) > 49 { > 50 return ::SendMessage( hwnd(), msg, wp, lp ); > 51 } > 52 > 53 // [static] キューにあるメッセージを全て処理 > 54 static void msg(); > 55 > 56 // [static] メッセージループをまわす。 > 57 enum msglooptype {PEEK, GET}; > 58 static void msgLoop( msglooptype type = GET ); > 59 > 60 // [static] Windowを強制的に front へ > 61 static void setFront( HWND wnd ); > 62 > 63 // [static] Windowを中央へ > 64 static void setCenter( HWND wnd, HWND rel=NULL ); > 65 > 66 // [static] HWND -> kiWindow ( もしあれば ) > 67 static kiWindow* kiwnd( HWND wnd ) > 68 { > 69 kiWindow* ptr = (kiWindow*)::GetWindowLong( wnd, GWL_USE > 70 if( !ptr ) return NULL; > 71 if( ::IsBadCodePtr((FARPROC)&ptr) ) return NULL; > 72 return ptr; > 73 } > 74 > 75 protected: //-- 派生クラス向け ----------------------------- > 76 > 77 // 派生クラスは、作成直前にコレを呼ぶこと。 > 78 static void preCreate( kiWindow* wnd ) > 79 { st_pCurInit = wnd; } > 80 // 破棄直前にコレを呼ぶこと。 > 81 void detachHwnd(); > 82 // いったんGET/POSTメッセージループを停止 > 83 static void loopbreak() > 84 { > 85 loopbreaker = true; > 86 } > 87 > 88 private: //-- 内部処理 ------------------------------------- > 89 > 90 // ウインドウハンドル設定 > 91 static LRESULT CALLBACK CBTProc( int code, WPARAM wp, LPARAM lp ); > 92 static HHOOK st_hHook; > 93 static kiWindow* st_pCurInit; > 94 void setHwnd( HWND wnd ) > 95 { > 96 m_hWnd = wnd; > 97 } > 98 > 99 // ウインドウ情報保持用変数 > 100 HWND m_hWnd; > 101 HACCEL m_hAccel; > 102 // ダイアログメッセージ > 103 virtual bool isDlgMsg( MSG* msg ) > 104 { return false; } > 105 // GETループ一時抜けだし > 106 static bool loopbreaker; > 107 > 108 protected: > 109 kiWindow(); > 110 public: > 111 virtual ~kiWindow(); > 112 }; > 113 > 114 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ > 115 // kiDialog : DialogをkiWindowとして管理する > 116 > 117 class kiDialog : public kiWindow > 118 { > 119 public: //-- 外向きインターフェイス -------------------------- > 120 > 121 // モーダルダイアログとして実行 > 122 virtual void doModal( HWND parent=NULL ); > 123 > 124 // モードレスダイアログとして作成 > 125 virtual void createModeless( HWND parent=NULL ); > 126 > 127 // 終了コード取得 > 128 UINT getEndCode() > 129 { > 130 return m_EndCode; > 131 } > 132 > 133 // モーダルか否か > 134 bool isModal() > 135 { > 136 return m_bStateModal; > 137 } > 138 > 139 // ダイアログアイテム > 140 int sendMsgToItem( UINT id, UINT msg, WPARAM wp=0, LPARAM lp=0 ) > 141 { > 142 return ::SendDlgItemMessage( hwnd(), id, msg, wp, lp ); > 143 } > 144 HWND item( UINT id ) > 145 { > 146 return ::GetDlgItem( hwnd(), id ); > 147 } > 148 > 149 protected: //-- 派生クラス向け ----------------------------- > 150 > 151 // リソースIDで初期化 > 152 kiDialog( UINT id ); > 153 > 154 // リソースID取得 > 155 UINT getRsrcID() > 156 { > 157 return m_Rsrc; > 158 } > 159 > 160 // 終了コードをセット > 161 void setEndCode( UINT endcode ) > 162 { > 163 m_EndCode = endcode; > 164 } > 165 > 166 // モーダルか否かのフラグ"のみ"を切替 > 167 void setState( bool modal ) > 168 { > 169 m_bStateModal = modal; > 170 } > 171 > 172 // 終了コードをセットして、終了する( IDOK を渡しても onOK() は呼ばれないことに壕モ! ) > 173 virtual void end( UINT endcode ); > 174 > 175 // コマンド・メッセージ発生時に呼ばれる > 176 > 177 // OK -> onOK -> if true end(IDOK) > 178 virtual bool onOK() {return true;} > 179 // 取消 -> onCancel -> if true end(IDCANCEL) > 180 virtual bool onCancel() {return true;} > 181 // WM_INITDIALOG -> onInit > 182 virtual BOOL onInit() {return FALSE;} > 183 // WM_???? -> proc > 184 virtual BOOL CALLBACK proc( UINT msg, WPARAM wp, LPARAM lp ) {re > 185 > 186 private: //-- 内部処理 ------------------------------------- > 187 > 188 UINT m_EndCode; > 189 UINT m_Rsrc; > 190 bool m_bStateModal; > 191 bool isDlgMsg( MSG* msg ) > 192 { > 193 return (!!::IsDialogMessage( hwnd(), msg )); > 194 } > 195 static BOOL CALLBACK commonDlg( HWND dlg, UINT msg, WPARAM wp, LPARAM lp > 196 }; > 197 > 198 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ > 199 // kiPropSheet : PropertySheetをkiWindowとして管理する。 > 200 > 201 #define IDAPPLY (0x3021) > 202 #define ID_KIPS_HELP (0x0009) > 203 > 204 class kiPropSheetPage : public kiDialog > 205 { > 206 friend class kiPropSheet; > 207 > 208 protected: //-- 派生クラス向け ---------------------------- > 209 > 210 // ダイアログやアイコンのIDで初期化 > 211 kiPropSheetPage( UINT dlgid ) > 212 : kiDialog( dlgid ), m_hIcon( NULL ) {} > 213 void setIcon( HICON h ) > 214 { m_hIcon = h; } > 215 > 216 // OK/適用 -> page::onOK -> sheet::onOK -> (if ok 終了) > 217 // virtual bool onOK() > 218 // WM_INITDIALOG > 219 // virtual BOOL onInit() > 220 // その他 > 221 // virtual BOOL CALLBACK proc( UINT msg, WPARAM wp, LPARAM lp ) > 222 > 223 private: //-- 内部処理 ------------------------------------- > 224 > 225 void end( UINT endcode ) {} > 226 void setInfo( PROPSHEETPAGE* p ); > 227 HICON m_hIcon; > 228 }; > 229 > 230 class kiPropSheet : public kiDialog > 231 { > 232 friend class kiPropSheetPage; > 233 > 234 public: //-- 外向きインターフェイス -------------------------- > 235 > 236 // モーダルダイアログとして実行 > 237 void doModal( HWND parent ); > 238 > 239 // モードレスダイアログとして作成 > 240 void createModeless( HWND parent ); > 241 > 242 protected: //-- 派生クラス向け ---------------------------- > 243 > 244 // コンストラクタ辺りで↓これをいじるべし > 245 PROPSHEETHEADER m_Header; > 246 kiArray<kiPropSheetPage*> m_Pages; > 247 > 248 // 終了 > 249 void end( UINT endcode ); > 250 // > 251 void sendOK2All() > 252 { > 253 for( unsigned int i=0;i!=m_Pages.len(); i++ ) > 254 if( m_Pages[i]->isAlive() ) > 255 m_Pages[i]->onOK(); > 256 } > 257 > 258 // OK/適用 -> page::onOK -> sheet::onOK -> (if ok 終了) > 259 // virtual void onOK() > 260 // キャンセル -> sheet::onCancel -> 終了 > 261 // virtual void onCancel() > 262 // PSCB_INITIALIZED > 263 // virtual BOOL onInit() > 264 // 適用 > 265 virtual void onApply() {} > 266 // ヘルプ > 267 virtual void onHelp() {} > 268 // その他コマンド > 269 virtual void onCommand( UINT id ) {} > 270 // ファイルドロップ > 271 virtual void onDrop( HDROP hdrop ) {} > 272 > 273 private: //-- 内部処理 --------------------------------------- > 274 > 275 void begin(); > 276 bool m_bStateModal; > 277 > 278 static kiPropSheet* st_CurInitPS; > 279 WNDPROC m_DefProc; > 280 bool isDlgMsg( MSG* msg ) > 281 { return !!PropSheet_IsDialogMessage( hwnd(),msg ); } > 282 static int CALLBACK main_initProc( HWND dlg, UINT msg, LPARAM lp ); > 283 static LRESULT CALLBACK main_cmmnProc( HWND dlg, UINT msg, WPARAM wp, LP > 284 static BOOL CALLBACK page_cmmnProc( HWND dlg, UINT msg, WPARAM wp, LPARA > 285 static UINT CALLBACK page_initProc( HWND dlg, UINT msg, LPPROPSHEETPAGE > 286 > 287 protected: > 288 kiPropSheet(); > 289 public: > 290 ~kiPropSheet() > 291 { for( unsigned int i=0; i!=m_Pages.len(); i++ ) delete m_Pages[ > 292 }; > 293 > 294 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ > 295 // kiListView : ListViewコントロールの簡単なラッパ > 296 > 297 class kiListView > 298 { > 299 public: > 300 kiListView( kiDialog* dlg, UINT id ) > 301 { > 302 m_hWnd = ::GetDlgItem( dlg->hwnd(), id ); > 303 } > 304 > 305 void insertColumn( int y, const char* title, > 306 int width=100, int fmt=LVCFMT_LE > 307 { > 308 LVCOLUMN col; > 309 col.mask = LVCF_TEXT | LVCF_FMT | LVCF_WIDTH; > 310 col.pszText = const_cast<char*>(title); > 311 col.cx = width; > 312 col.fmt = fmt; > 313 ::SendMessage( m_hWnd, LVM_INSERTCOLUMN, y, (LPARAM)&col > 314 } > 315 > 316 void insertItem( int x, const char* str, LPARAM param=0, int iImage=-1 ) > 317 { > 318 LVITEM item; > 319 item.mask = LVIF_TEXT | LVIF_PARAM | (iImage!=-1 ? LVIF_ > 320 item.pszText = const_cast<char*>(str); > 321 item.iItem = x; > 322 item.iSubItem = 0; > 323 item.iImage = iImage; > 324 item.lParam = param; > 325 ::SendMessage( m_hWnd, LVM_INSERTITEM, 0, (LPARAM)&item > 326 } > 327 > 328 void setSubItem( int x, int y, const char* str ) > 329 { > 330 LVITEM item; > 331 item.mask = LVIF_TEXT; > 332 item.pszText = const_cast<char*>(str); > 333 item.iItem = x; > 334 item.iSubItem = y; > 335 ::SendMessage( m_hWnd, LVM_SETITEM, 0, (LPARAM)&item ); > 336 } > 337 > 338 void setImageList( HIMAGELIST Large, HIMAGELIST Small ) > 339 { > 340 ::SendMessage( m_hWnd, LVM_SETIMAGELIST, LVSIL_NORMAL, ( > 341 ::SendMessage( m_hWnd, LVM_SETIMAGELIST, LVSIL_SMALL, ( > 342 } > 343 > 344 private: > 345 HWND m_hWnd; > 346 }; > 347 > 348 #endif

Added manifest.xml version [3c5cdefb4ff321c0]

> 1 <?xml version="1.0" encoding="UTF-8" standalone="yes"?> > 2 <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> > 3 <assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="KI > 4 <description>DnD Melter/Freezer</description> > 5 <dependency><dependentAssembly> > 6 <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Co > 7 </dependentAssembly></dependency> > 8 </assembly>

Added stdafx.cpp version [b9d654a8de580c4e]

> 1 // stdafx.cpp : to make Pre-Compiled-Header(pch) file > 2 > 3 #include "stdafx.h"

Added stdafx.h version [0d3c7f49b3d1068c]

> 1 // stdafx.h : frequently used headers > 2 > 3 #ifndef AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_ > 4 #define AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_ > 5 > 6 // windows general header > 7 #undef WINVER > 8 #define WINVER 0x0400 > 9 #undef _WIN32_IE > 10 #define _WIN32_IE 0x0200 > 11 #include <windows.h> > 12 #include <lzexpand.h> > 13 > 14 // shell header > 15 #include <shlobj.h> > 16 > 17 // k.i.lib > 18 #include "kilib/kilibext.h" > 19 > 20 #endif

Added unacedef.h version [e8ff6e20f86f7178]

> 1 #ifndef __UNACEDEF_H_BY_K_INABA__ > 2 #define __UNACEDEF_H_BY_K_INABA__ > 3 #ifdef __cplusplus > 4 extern "C" { > 5 #endif > 6 > 7 //ヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘ > 8 //ヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘ=====--- Part 1: different structures ---====ヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘ > 9 //ヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘ > 10 > 11 //--------------------------------------------------------------------------- > 12 // > 13 // Here in different structures used at callback functions and > 14 // ACE.DLL functions are declared. > 15 // > 16 //--------------------------------------------------------------------------- > 17 // > 18 // Contents: > 19 // Part 1.1: structures used in callback structures > 20 // Part 1.2: structures used in function structures > 21 // > 22 //--------------------------------------------------------------------------- > 23 > 24 > 25 //ヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘ > 26 //========--- Part 1.1: structures used in callback structures ---========= > 27 //ヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘ > 28 > 29 //トトトトトトトトトトトトトトトトトトトトトトト comment buffer structure トトトトトトトトトトトトトトトトトトトトトト > 30 // Used in tACEGlobalDataStruc. Application has to specify where the > 31 // comment is or should be stored. > 32 //------------------------------------------------------------------------- > 33 > 34 typedef struct sACECommentStruc > 35 { > 36 LPSTR Buf; // area where the comments are stored > 37 // by the application or by the Dll > 38 // comments must be zero-terminated > 39 ULONG BufSize; // size of this area > 40 ULONG State; // state of comment - see ACE_COMMENT > 41 // constants below > 42 } tACECommentStruc, > 43 *pACECommentStruc; > 44 > 45 > 46 //----------------------------------------------------------------------- > 47 // Defines for the tACECommentStruc.State field, which tells about > 48 // the result of the last comment extraction. > 49 //----------------------------------------------------------------------- > 50 > 51 #define ACE_COMMENT_OK 0 // comment extraction went fine > 52 > 53 #define ACE_COMMENT_SMALLBUF 1 // comment buffer too small to > 54 // store the whole comment in > 55 > 56 #define ACE_COMMENT_NONE 255 // No comment present > 57 > 58 > 59 //トトトトトトトトトトトトトトトトトトトトトトト global data structure トトトトトトトトトトトトトトトトトトトトトトトトト > 60 // This structure contains information for the Dll being interesting for > 61 // nearly all functions. The Dll has to be initialized with this > 62 // structure passed to tACEInitDll(). This structure is also passed > 63 // by the callback functions. > 64 //------------------------------------------------------------------------- > 65 > 66 //--------------------------------------------------------------- > 67 // Forward declarations of callback function parameters > 68 // used in this structure. > 69 //--------------------------------------------------------------- > 70 > 71 typedef union sACEInfoCallbackProcStruc > 72 *pACEInfoCallbackProcStruc; > 73 > 74 typedef union sACEErrorCallbackProcStruc > 75 *pACEErrorCallbackProcStruc; > 76 > 77 typedef union sACERequestCallbackProcStruc > 78 *pACERequestCallbackProcStruc; > 79 > 80 typedef union sACEStateCallbackProcStruc > 81 *pACEStateCallbackProcStruc; > 82 > 83 > 84 typedef struct sACEGlobalDataStruc > 85 { > 86 //------------------------ fields for ACE and UnACE ------------------- > 87 > 88 void *Obj; // ---- reserved for application! ---- > 89 // thought to be used as a pointer to > 90 // an object; when a callback-function is > 91 // called, the object pointer can be used to > 92 // handle the callback in a specific way; > 93 // the pointer has to be initialized by > 94 // ACEInitDll() > 95 > 96 ULONG MaxArchiveTestBytes; > 97 > 98 // how many bytes of a file should be > 99 // looked upon at archive header search? > 100 > 101 ULONG MaxFileBufSize; > 102 > 103 // maximum buffer size for buffered > 104 // I/O operations > 105 > 106 tACECommentStruc // used to exchange comment data > 107 Comment; // between application and Dll > 108 // using callback functions > 109 > 110 LPSTR DecryptPassword; > 111 > 112 // the DecryptPassword specified at > 113 // ACEInitDll() is overwritten by the > 114 // DecryptPassword field of tACEAddStruc and > 115 // other function-specific structures; > 116 // but this field can be used to change the > 117 // password at callback function calls > 118 > 119 BOOL UseVBStructures; // passes structures to callback functions > 120 // much better suited for Visual Basic > 121 > 122 CHAR Reserved1[60]; // has to be filled with zeros > 123 > 124 //--------------------------- fields for ACE only --------------------- > 125 > 126 LPSTR EncryptPassword; > 127 > 128 // things stated at the description of the > 129 // DecryptPassword field apply here as well > 130 > 131 > 132 LPSTR TempDir; // directory to save temporary archive > 133 > 134 //-------- registration (ACE DLLs only, but not used at ACL) ---------- > 135 > 136 LPSTR KeyPath; // necessary for reading and writing key file > 137 > 138 LPSTR UserAV; // Dll returns the AV string (if registered) > 139 // in this field > 140 > 141 LPSTR IsGeneralKey; // DLL returns the key, if it is a general key > 142 > 143 HWND OwnerWindow; // specifies the applications window to be > 144 // parent of the registration reminder dialog > 145 > 146 //--------------------------- fields for ACE only --------------------- > 147 > 148 ULONG CompressionLevel; > 149 // contains the currently used compression > 150 // level - may be changed during compression > 151 // operation > 152 > 153 CHAR Reserved2[56]; // has to be filled with zeros > 154 > 155 > 156 //---------------------- callback functions (ACE and UnACE) ---------- > 157 > 158 INT (__stdcall *InfoCallbackProc) > 159 (pACEInfoCallbackProcStruc Info); > 160 > 161 // Informs application about details like the > 162 // creation of a temporary archive. > 163 // See ACE_CALLBACK_INFO definitions for > 164 // more information. > 165 > 166 INT (__stdcall *ErrorCallbackProc) > 167 (pACEErrorCallbackProcStruc Error); > 168 > 169 // Called to let the application know about > 170 // errors. The Code field of Error will > 171 // contain an ACE_CALLBACK_ERROR value. > 172 > 173 INT (__stdcall *RequestCallbackProc) > 174 (pACERequestCallbackProcStruc Request); > 175 > 176 // Called to let the application know about > 177 // requests for data. Code will contain an > 178 // ACE_CALLBACK_REQUEST value. > 179 > 180 INT (__stdcall *StateCallbackProc) > 181 (pACEStateCallbackProcStruc State); > 182 > 183 // Called to let the application know about > 184 // the progress of operations. > 185 > 186 > 187 //-------------------------- different new fields --------------------- > 188 CHAR Reserved3[64]; // has to be filled with zeros > 189 } tACEGlobalDataStruc, > 190 *pACEGlobalDataStruc; > 191 > 192 > 193 //トトトトトトトトトトトトトトトトトトトトトトト archive data structure トトトトトトトトトトトトトトトトトトトトトトトト > 194 // Informs the callback functions about the current archive, its volume > 195 // number, the archive-flags (see ACE_FLAG constants), the creation host > 196 // system (see ACE_HOST constants) and the AV if present in archive. > 197 // Also used at ACEReadArchiveData(). > 198 //------------------------------------------------------------------------- > 199 > 200 typedef struct sACEArchiveDataStruc > 201 { > 202 LPSTR ArchiveName; > 203 ULONG VolumeNumber, > 204 Flags, // see ACE_ARCFLAG defines below > 205 HostCreated, // see ACE_HOST defines below > 206 TimeCreated, // in MS-DOS format > 207 VersionCreated, > 208 VersionExtract; // version needed to extract files > 209 LPSTR AV; // not used in ACL > 210 CHAR Reserved[64]; // filled with zeros > 211 } tACEArchiveDataStruc, > 212 *pACEArchiveDataStruc; > 213 > 214 > 215 //----------------------------------------------------------------------- > 216 // Flag constants for tACEArchiveDataStruc.Flags field. > 217 //----------------------------------------------------------------------- > 218 > 219 #define ACE_ARCFLAG_MAINCOMMENT 2 > 220 #define ACE_ARCFLAG_SFX 512 > 221 #define ACE_ARCFLAG_LIMITSFXJR 1024 // is an SFX archive > 222 // that supports 256k > 223 // dictionary only > 224 #define ACE_ARCFLAG_MULTIVOLUME 2048 > 225 #define ACE_ARCFLAG_AV 4096 // not used in ACL > 226 #define ACE_ARCFLAG_RECOVERYREC 8192 > 227 #define ACE_ARCFLAG_LOCK 16384 > 228 #define ACE_ARCFLAG_SOLID 32768 > 229 > 230 > 231 //----------------------------------------------------------------------- > 232 // Host system used to create an archive. Used at > 233 // tACEArchiveDataStruc.HostCreated field. > 234 //----------------------------------------------------------------------- > 235 > 236 #define ACE_HOST_MSDOS 0 // archive created by > 237 // MSDOS ACE archiver > 238 #define ACE_HOST_OS2 1 // created by OS2 ACE > 239 #define ACE_HOST_WIN32 2 // created by Win32 ACE > 240 > 241 > 242 //トトトトトトトトトトトトトトトトトトトトトトトト file data structure トトトトトトトトトトトトトトトトトトトトトトトトトト > 243 // Contains information about an archived file. > 244 //------------------------------------------------------------------------- > 245 > 246 typedef struct sACEFileDataStruc > 247 { > 248 LPSTR SourceFileName; // relative file name > 249 LPSTR DestinationFileName; // absolute file name; > 250 // valid for add and extract only! > 251 ULONG Flags, // see ACE_FILEFLAG defines below > 252 CRC32, > 253 Method, // 0=stored, 1=LZ77, 2=V20Compression > 254 Dictionary; // DictionarySize = 2^Dictionary > 255 DWORDLONG > 256 CompressedSize, > 257 Size; > 258 ULONG Time, > 259 Attributes; > 260 CHAR Reserved[64]; // filled with zeros > 261 } tACEFileDataStruc, > 262 *pACEFileDataStruc; > 263 > 264 > 265 //----------------------------------------------------------------------- > 266 // Flag constants for the tACEFileData.Flags field. > 267 //----------------------------------------------------------------------- > 268 > 269 #define ACE_FILEFLAG_FILECOMMENT 2 // file has comment > 270 #define ACE_FILEFLAG_SPLITBEFORE 4096 // continued from > 271 // previous volume > 272 #define ACE_FILEFLAG_SPLITAFTER 8192 // continued on > 273 // next volume > 274 #define ACE_FILEFLAG_PASSWORD 16384 // is encrypted > 275 #define ACE_FILEFLAG_SOLID 32768 // uses data of previous > 276 // files (solid mode) > 277 > 278 > 279 //トトトトトトトトトトトトトトトトトトトトトトトト copy info structure トトトトトトトトトトトトトトトトトトトトトトトトトト > 280 // Is passed to ACEInfoCallbackProc with ACE_CALLBACK_INFO_COPY as code. > 281 // Informs application about the progress of copying either an archive to > 282 // a temporary archive, or a temporary archive back to a normal archive. > 283 //------------------------------------------------------------------------- > 284 > 285 typedef struct sACECopyInfoStruc > 286 { > 287 LPSTR SourceFileName, // source file > 288 DestinationFileName; // the file copying the source to > 289 DWORDLONG > 290 CopiedBytes, // bytes already copied > 291 FileSize; // source file size > 292 CHAR Reserved[64]; // filled with zeros > 293 } tACECopyInfoStruc, > 294 *pACECopyInfoStruc; > 295 > 296 > 297 //トトトトトトトトトトトトトトトトトトトト operation progress structure トトトトトトトトトトトトトトトトトトトトト > 298 // Used to state the progress of the current operation. > 299 //------------------------------------------------------------------------- > 300 > 301 typedef struct sACEProgressDataStruc > 302 { > 303 LPSTR Addr; // address of uncompressed data block > 304 ULONG Size; // size of uncompressed data block > 305 DWORDLONG TotalProcessedSize; // counted by Dll: > 306 // total uncompressed bytes processed > 307 DWORDLONG TotalCompressedSize;// total compressed bytes processed > 308 DWORDLONG TotalSize; // total uncompressed bytes to process > 309 // (sum of all original file sizes) > 310 DWORDLONG FileProcessedSize; // uncompr. bytes of file processed > 311 DWORDLONG FileCompressedSize; // compr. bytes of file processed > 312 DWORDLONG FileSize; // uncompressed file size > 313 } tACEProgressDataStruc, > 314 *pACEProgressDataStruc; > 315 > 316 > 317 //ヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘ > 318 //========--- Part 1.2: structures used in function structures ---========= > 319 //ヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘ > 320 > 321 //トトトトトトトトトトトトトトトトトトトトトトトトト file list structure トトトトトトトトトトトトトトトトトトトトトトトトト > 322 // This structure is used in the function specific structures. > 323 // The application has to use this structure to indicate which files > 324 // have to be processed by the DLL. > 325 //------------------------------------------------------------------------- > 326 > 327 typedef struct sACEFilesStruc > 328 { > 329 LPSTR SourceDir; // maybe a real or an archive directory > 330 LPSTR FileList; // pointer to list of files to process; > 331 // zero-terminated; files have to be > 332 // separated by carriage-return (0xd); > 333 // FileList may/will be modified by the > 334 // Dll; if nothing is specified, "*" > 335 // will be used > 336 // (attention at ACEDelete!!) > 337 LPSTR ExcludeList; // list of files to exclude from process > 338 BOOL FullMatch; // specifications must fully match > 339 // (no files with the same name in > 340 // subdirs are processed) > 341 BOOL RecurseSubDirs; // recurse subdirectories > 342 // (valid for add operations only) > 343 CHAR Reserved[60] ; // has to be filled with zeros > 344 // for future: possibly in-/excluding > 345 // file attributes and date/time range > 346 } tACEFilesStruc, > 347 *pACEFilesStruc; > 348 > 349 > 350 //トトトトトトトトトトトトトトトトトトトトト V2.0 compression structure トトトトトトトトトトトトトトトトトトトトトトト > 351 // Specifies whether to use v2.0 compression or not. If you use v2.0 > 352 // compression you can also specify which v2.0 compression techniques > 353 // you want to use. (ACE only) > 354 //------------------------------------------------------------------------- > 355 > 356 typedef struct sACEV20CompressionStruc > 357 { > 358 BOOL DoUse, // if DoUse=1 and all other fields are > 359 DoUseDelta, // zero, then all v2.0 compression > 360 DoUseExe, // techniques will be used > 361 DoUsePic, > 362 DoUseSound; > 363 CHAR Reserved[64]; // has to be filled with zeros > 364 } tACEV20CompressionStruc, > 365 *pACEV20CompressionStruc; > 366 > 367 > 368 //トトトトトトトトトトトトトトトトトトト compression parameter structure トトトトトトトトトトトトトトトトトトト > 369 // Used in tACEAddStruc and tACEDeleteStruc. (ACE only) > 370 //------------------------------------------------------------------------- > 371 > 372 typedef struct sACECompressParamsStruc > 373 { > 374 ULONG Level, // see ACE_LEVEL constants below > 375 Dictionary; // 15(32k)..22(4Mb) > 376 > 377 tACEV20CompressionStruc // indicates if (or which) v2.0 > 378 V20Compression; // compression techniques shall be used > 379 > 380 BOOL TestAfter; // make a test for CRC check errors > 381 // after compression > 382 CHAR Reserved[64]; // has to be filled with zeros > 383 } tACECompressParamsStruc, > 384 *pACECompressParamsStruc; > 385 > 386 > 387 //----------------------------------------------------------------------- > 388 // Tells the Dll which compression level to use. (ACE only) > 389 //----------------------------------------------------------------------- > 390 > 391 #define ACE_LEVEL_STORE 0 // save file only; do not compress > 392 #define ACE_LEVEL_FASTEST 1 // compress very fast > 393 #define ACE_LEVEL_FAST 2 // compress fast > 394 #define ACE_LEVEL_NORMAL 3 // good compromise between speed and > 395 // compression rate > 396 #define ACE_LEVEL_GOOD 4 // achieves good compression > 397 #define ACE_LEVEL_BEST 5 // best compression; bit slow > 398 > 399 > 400 //ヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘ > 401 //ヘヘヘヘヘヘヘヘヘヘヘ=====--- Part 2: ACE.DLL callback declarations ---====ヘヘヘヘヘヘヘヘヘヘヘ > 402 //ヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘ > 403 > 404 //--------------------------------------------------------------------------- > 405 // > 406 // ACE.DLL makes use of four callback functions to exchange data > 407 // with the application: > 408 // > 409 // 1) InfoCallbackProc (pACEInfoCallbackProcStruc Info) > 410 // 2) ErrorCallbackProc (pACEErrorCallbackProcStruc Error) > 411 // 3) RequestCallbackProc(pACERequestCallbackProcStruc Request) > 412 // 4) StateCallbackProc (pACEStateCallbackProcStruc State) > 413 // > 414 // Meaning of different callback types: > 415 // Info - lets the application know about actions that take some > 416 // time but are not essential > 417 // (Code is one of ACE_CALLBACK_INFO constants) > 418 // Error - an error occured; if the reason for this error can > 419 // be solved by the application then the Dll can continue > 420 // the current operation, otherwise the operation has to > 421 // be canceled > 422 // (Code is one of ACE_CALLBACK_ERROR constants) > 423 // Request - the Dll needs some user input > 424 // for ex.: "Overwrite file? (yes/no/cancel)" > 425 // (Code is one of ACE_CALLBACK_REQUEST constants) > 426 // State - Dll informs application about the progress of an operation > 427 // (Code is one of ACE_CALLBACK_STATE constants) > 428 // > 429 // The pointers to the callback functions has to be set by the application > 430 // when calling ACEInitDll(). If the application does not install > 431 // a callback function, is has set the corresponding pointer to NULL. > 432 // If the ACE.DLL has to call the Error or Request callback function > 433 // and they are not installed, the ACE.DLL will cancel the operation. > 434 // > 435 // The application has the possibility to cancel the current operation > 436 // at each callback function call. So if the user clicks on a Cancel-button, > 437 // the application should return ACE_CALLBACK_RETURN_CANCEL at the next > 438 // callback function call. > 439 // > 440 // All callback function parameters are declared as unions. > 441 // The StructureType field contains he type of the structure which is used. > 442 // When the application knows which type of structure it has to use, > 443 // it will have to interpret the Code field to get to know the reason > 444 // for the callback function call. > 445 // > 446 //--------------------------------------------------------------------------- > 447 // > 448 // Contents: > 449 // Part 2.1: operation types > 450 // Part 2.2: callback function return codes > 451 // Part 2.3: callback structure types > 452 // Part 2.4: callback structures > 453 // Part 2.5: info callback function > 454 // Part 2.6: error callback function > 455 // Part 2.7: request callback function > 456 // Part 2.8: state callback function > 457 // > 458 //--------------------------------------------------------------------------- > 459 > 460 > 461 //ヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘ > 462 //=====================--- Part 2.1: operation codes ---=================== > 463 //ヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘ > 464 // Passed to callback functions indicating the current operation. > 465 //------------------------------------------------------------------------- > 466 > 467 #define ACE_CALLBACK_OPERATION_LIST 0 > 468 #define ACE_CALLBACK_OPERATION_TEST 1 > 469 #define ACE_CALLBACK_OPERATION_ANALYZE 2 > 470 #define ACE_CALLBACK_OPERATION_EXTRACT 3 > 471 #define ACE_CALLBACK_OPERATION_ADD 4 > 472 #define ACE_CALLBACK_OPERATION_REPACK 5 > 473 #define ACE_CALLBACK_OPERATION_DELETE 6 > 474 #define ACE_CALLBACK_OPERATION_REPAIR 7 // repair without > 475 // recovery record > 476 #define ACE_CALLBACK_OPERATION_SETCMT 8 > 477 #define ACE_CALLBACK_OPERATION_ENCRYPT 9 > 478 #define ACE_CALLBACK_OPERATION_KEEP 10 // file is to be > 479 // taken along > 480 // without recompress > 481 #define ACE_CALLBACK_OPERATION_RECOVER 11 // begin of > 482 // recovering archive > 483 // by recovery record > 484 #define ACE_CALLBACK_OPERATION_HEADSEARCH 12 // begin of searching > 485 // for file headers > 486 #define ACE_CALLBACK_OPERATION_RECRECSEARCH 13 // begin of searching > 487 // for recovery record > 488 #define ACE_CALLBACK_OPERATION_ADDSFX 14 > 489 #define ACE_CALLBACK_OPERATION_LOCK 15 > 490 #define ACE_CALLBACK_OPERATION_ADDAV 16 // not used in ACL > 491 #define ACE_CALLBACK_OPERATION_ADDRECOVREC 17 > 492 #define ACE_CALLBACK_OPERATION_REGISTER 18 // not used in ACL > 493 > 494 > 495 //ヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘ > 496 //=============--- Part 2.2: callback function return codes ---============ > 497 //ヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘ > 498 // One of these result codes has to be returned by the application-based > 499 // callback functions. > 500 //--------------------------------------------------------------------------- > 501 > 502 #define ACE_CALLBACK_RETURN_OK 0 // also "yes" at > 503 // requests > 504 #define ACE_CALLBACK_RETURN_NO 1 // no, do not/ > 505 // do not retry > 506 #define ACE_CALLBACK_RETURN_CANCEL 2 // abort operation > 507 > 508 > 509 //ヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘ > 510 //================--- Part 2.3: callback structure types ---=============== > 511 //ヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘ > 512 // States of which type the passed structure is when a callback function > 513 // is called. The type is written to the StructureType field. > 514 //--------------------------------------------------------------------------- > 515 > 516 #define ACE_CALLBACK_TYPE_GLOBAL 0x0 > 517 > 518 // type of structure is > 519 // tACECallbackGlobalStruc > 520 //------------------------------------------------------------- > 521 // callback function | codes using this structure > 522 // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- > 523 // InfoCallbackProc | ACE_CALLBACK_INFO_GENERALKEY // no > 524 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > 525 // ErrorCallbackProc | ACE_CALLBACK_ERROR_MEMORY // f〉 ManyFil > 526 // | ACE_CALLBACK_ERROR_REGISTER // no > 527 // | ACE_CALLBACK_ERROR_READKEY // no > 528 // | ACE_CALLBACK_ERROR_WRITEKEY // no > 529 // | ACE_CALLBACK_ERROR_NOWINACEKEY // no > 530 // | ACE_CALLBACK_ERROR_NOACTIVEACEKEY // no > 531 // | ACE_CALLBACK_ERROR_UNCSPACE // wi > 532 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > 533 // RequestCallbackProc | ACE_CALLBACK_REQUEST_REGISTER // no > 534 // > 535 > 536 > 537 #define ACE_CALLBACK_TYPE_ARCHIVE 0x1 > 538 > 539 // type of structure is > 540 // tACECallbackArchiveStruc > 541 //------------------------------------------------------------- > 542 // callback function | codes using this structure > 543 // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- > 544 // InfoCallbackProc | ACE_CALLBACK_INFO_TMPARCCREATE > 545 // | ACE_CALLBACK_INFO_TMPARCCREATEEND > 546 // | ACE_CALLBACK_INFO_ADDRECREC > 547 // | ACE_CALLBACK_INFO_ADDRECRECEND > 548 // | ACE_CALLBACK_INFO_RECREC > 549 // | ACE_CALLBACK_INFO_NORECREC > 550 // | ACE_CALLBACK_INFO_RECOVERED > 551 // | ACE_CALLBACK_INFO_NODAMAGE > 552 // | ACE_CALLBACK_INFO_FNDMAINHEAD > 553 // | ACE_CALLBACK_INFO_FILELISTCREATE > 554 // | ACE_CALLBACK_INFO_FILELISTCREATEEND > 555 // | ACE_CALLBACK_INFO_FILESORT > 556 // | ACE_CALLBACK_INFO_FILESORTEND > 557 // | ACE_CALLBACK_INFO_COPYEND > 558 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > 559 // ErrorCallbackProc | ACE_CALLBACK_ERROR_MODIFYVOLUME > 560 // | ACE_CALLBACK_ERROR_MODIFYLOCKEDARCHIVE > 561 // | ACE_CALLBACK_ERROR_AV > 562 // | ACE_CALLBACK_ERROR_TOODAMAGED > 563 // | ACE_CALLBACK_ERROR_ARCHIVEEXISTS > 564 // | ACE_CALLBACK_ERROR_OPENREPAIRARCHIVE > 565 // | ACE_CALLBACK_ERROR_OPENARCHIVEREAD > 566 // | ACE_CALLBACK_ERROR_OPENARCHIVEWRITE > 567 // | ACE_CALLBACK_ERROR_READARCHIVE > 568 // | ACE_CALLBACK_ERROR_WRITEARCHIVE > 569 // | ACE_CALLBACK_ERROR_ALREADYSFX > 570 // | ACE_CALLBACK_ERROR_ADDSFXTOVOLUME > 571 // | ACE_CALLBACK_ERROR_ARCHIVEBROKEN > 572 // | ACE_CALLBACK_ERROR_ARCHIVESAVE > 573 // | ACE_CALLBACK_ERROR_NOFILES > 574 // | ACE_CALLBACK_ERROR_ISNOTANARCHIVE > 575 // | ACE_CALLBACK_ERROR_TEMPDIRCREATE > 576 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > 577 // RequestCallbackProc | ACE_CALLBACK_REQUEST_MARKASSOLID > 578 // | ACE_CALLBACK_REQUEST_CHANGEVOLUME > 579 // | ACE_CALLBACK_REQUEST_ARCHIVEEXISTS > 580 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > 581 // StateCallbackProc | ACE_CALLBACK_STATE_STARTARCHIVE > 582 // > 583 > 584 > 585 #define ACE_CALLBACK_TYPE_ARCHIVEDFILE 0x2 > 586 > 587 // type of structure is > 588 // tACECallbackArchivedFileStruc > 589 //------------------------------------------------------------- > 590 // callback function | codes using this structure > 591 // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- > 592 // InfoCallbackProc | ACE_CALLBACK_INFO_TMPARCCREATE > 593 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > 594 // ErrorCallbackProc | ACE_CALLBACK_ERROR_CREATIONNAMEINUSE > 595 // | ACE_CALLBACK_ERROR_HIGHERVERSION > 596 // | ACE_CALLBACK_ERROR_ENCRYPTIONCRC > 597 // | ACE_CALLBACK_ERROR_WRITE > 598 // | ACE_CALLBACK_ERROR_READ > 599 // | ACE_CALLBACK_ERROR_OPENREAD > 600 // | ACE_CALLBACK_ERROR_OPENWRITE //wird noc > 601 // | ACE_CALLBACK_ERROR_FILENAMETOOLONG > 602 // | ACE_CALLBACK_ERROR_REPACKCRC > 603 // | ACE_CALLBACK_ERROR_EXCLUDEPATH > 604 // | ACE_CALLBACK_ERROR_METHOD > 605 // | ACE_CALLBACK_ERROR_EXTRACTSPACE > 606 // | ACE_CALLBACK_ERROR_CREATION > 607 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > 608 // RequestCallbackProc | ACE_CALLBACK_REQUEST_OVERWRITE > 609 // | ACE_CALLBACK_REQUEST_DELETEARCHIVEDSYSF > 610 // | ACE_CALLBACK_REQUEST_ADDBROKENFILE > 611 // | ACE_CALLBACK_REQUEST_PASSWORD > 612 // | ACE_CALLBACK_REQUEST_OVERWRITESYSFILE > 613 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > 614 // StateCallbackProc | ACE_CALLBACK_STATE_STARTFILE > 615 // | ACE_CALLBACK_STATE_ENDNOCRCCHECK > 616 // > 617 > 618 > 619 #define ACE_CALLBACK_TYPE_REALFILE 0x3 > 620 > 621 // type of structure is > 622 // tACECallbackRealFileStruc > 623 //------------------------------------------------------------- > 624 // callback function | codes using this structure > 625 // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- > 626 // InfoCallbackProc | ACE_CALLBACK_INFO_FILELISTADD > 627 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > 628 // ErrorCallbackProc | ACE_CALLBACK_ERROR_MOVEDELETE > 629 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > 630 // RequestCallbackProc | ACE_CALLBACK_REQUEST_MOVEDELETEREALSYSF > 631 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > 632 // StateCallbackProc | ACE_CALLBACK_STATE_STARTFILE > 633 // > 634 > 635 > 636 #define ACE_CALLBACK_TYPE_SPACE 0x4 > 637 > 638 // type of structure is > 639 // tACECallbackSpaceStruc > 640 //------------------------------------------------------------- > 641 // callback function | codes using this structure > 642 // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- > 643 // ErrorCallbackProc | ACE_CALLBACK_ERROR_TEMPDIRSPACE > 644 // | ACE_CALLBACK_ERROR_ARCHIVESPACE > 645 // > 646 > 647 > 648 #define ACE_CALLBACK_TYPE_SFXFILE 0x5 > 649 > 650 // type of structure is > 651 // tACECallbackSFXFileStruc > 652 //------------------------------------------------------------- > 653 // callback function | codes using this structure > 654 // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- > 655 // ErrorCallbackProc | ACE_CALLBACK_ERROR_READINGSFXFILE > 656 // > 657 > 658 > 659 #define ACE_CALLBACK_TYPE_COPY 0x6 > 660 > 661 // type of structure is > 662 // tACECallbackCopyStruc > 663 //------------------------------------------------------------- > 664 // callback function | codes using this structure > 665 // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- > 666 // InfoCallbackProc | ACE_CALLBACK_INFO_COPY > 667 // > 668 > 669 > 670 #define ACE_CALLBACK_TYPE_PROGRESS 0x7 > 671 > 672 // type of structure is > 673 // tACECallbackProgressStruc > 674 //------------------------------------------------------------- > 675 // callback function | codes using this structure > 676 // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- > 677 // StateCallbackProc | ACE_CALLBACK_STATE_PROGRESS > 678 // > 679 > 680 > 681 #define ACE_CALLBACK_TYPE_CRCCHECK 0x8 > 682 > 683 // type of structure is > 684 // tACECallbackCRCCheckStruc > 685 //------------------------------------------------------------- > 686 // callback function | codes using this structure > 687 // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- > 688 // StateCallbackProc | ACE_CALLBACK_STATE_ENDCRCCHECK > 689 // > 690 > 691 > 692 //ヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘ > 693 //==============--- Part 2.4: different callback structures ---============ > 694 //ヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘ > 695 // These are the declarations of the different structures used in the > 696 // unions passed by the callback functions. > 697 //--------------------------------------------------------------------------- > 698 > 699 //----------------------------------------------------------------------- > 700 // Only the Dll GlobalData is passed to the application. > 701 //----------------------------------------------------------------------- > 702 > 703 typedef struct sACECallbackGlobalStruc > 704 { > 705 ULONG StructureType; // is ACE_CALLBACK_TYPE_GLOBAL > 706 ULONG Code; // see definition of > 707 // ACE_CALLBACK_TYPE_GLOBAL > 708 ULONG Operation; // ACE_CALLBACK_OPERATION constant > 709 > 710 pACEGlobalDataStruc GlobalData; // see tACEGlobalDataStruc > 711 } tACECallbackGlobalStruc, > 712 *pACECallbackGlobalStruc; > 713 > 714 > 715 //----------------------------------------------------------------------- > 716 // The Dll GlobalData and the ArchiveData are passed. > 717 //----------------------------------------------------------------------- > 718 > 719 typedef struct sACECallbackArchiveStruc > 720 { > 721 ULONG StructureType; // is ACE_CALLBACK_TYPE_ARCHIVE > 722 ULONG Code; // see definition of > 723 // ACE_CALLBACK_TYPE_ARCHIVE > 724 ULONG Operation; // ACE_CALLBACK_OPERATION constant > 725 > 726 pACEGlobalDataStruc GlobalData; // see tACEGlobalDataStruc > 727 pACEArchiveDataStruc ArchiveData; // see tACEArchiveDataStruc > 728 } tACECallbackArchiveStruc, > 729 *pACECallbackArchiveStruc; > 730 > 731 > 732 //----------------------------------------------------------------------- > 733 // GlobalData, ArchiveData and FileData are passed. > 734 //----------------------------------------------------------------------- > 735 > 736 typedef struct sACECallbackArchivedFileStruc > 737 { > 738 ULONG StructureType; // is ACE_CALLBACK_TYPE_ARCHIVEDFILE > 739 ULONG Code; // see definition of > 740 // ACE_CALLBACK_TYPE_ARCHIVEDFILE > 741 ULONG Operation; // ACE_CALLBACK_OPERATION constant > 742 > 743 pACEGlobalDataStruc GlobalData; // see tACEGlobalDataStruc > 744 pACEArchiveDataStruc ArchiveData; // see tACEArchiveDataStruc > 745 pACEFileDataStruc FileData; // see tACEFileDataStruc > 746 } tACECallbackArchivedFileStruc, > 747 *pACECallbackArchivedFileStruc; > 748 > 749 > 750 //----------------------------------------------------------------------- > 751 // GlobalData, ArchiveData and a FileName are passed. > 752 //----------------------------------------------------------------------- > 753 > 754 typedef struct sACECallbackRealFileStruc > 755 { > 756 ULONG StructureType; // is ACE_CALLBACK_TYPE_REALFILE > 757 ULONG Code; // see definition of > 758 // ACE_CALLBACK_TYPE_REALFILE > 759 ULONG Operation; // ACE_CALLBACK_OPERATION constant > 760 > 761 pACEGlobalDataStruc GlobalData; // see tACEGlobalDataStruc > 762 pACEArchiveDataStruc ArchiveData; // see tACEArchiveDataStruc > 763 LPSTR FileName; // name of file > 764 } tACECallbackRealFileStruc, > 765 *pACECallbackRealFileStruc; > 766 > 767 > 768 //----------------------------------------------------------------------- > 769 // GlobalData, ArchiveData, the path of temp directory and the > 770 // bytes required in temp directory (archive size) are passed. > 771 //----------------------------------------------------------------------- > 772 > 773 typedef struct sACECallbackSpaceStruc > 774 { > 775 ULONG StructureType; // is ACE_CALLBACK_TYPE_SPACE > 776 ULONG Code; // see definition of > 777 // ACE_CALLBACK_TYPE_SPACE > 778 ULONG Operation; > 779 > 780 pACEGlobalDataStruc GlobalData; // see tACEGlobalDataStruc > 781 pACEArchiveDataStruc ArchiveData; // see tACEArchiveDataStruc > 782 LPSTR Directory; // path of directory > 783 DWORDLONG ArchiveSize; // bytes required in temp dir > 784 } tACECallbackSpaceStruc, > 785 *pACECallbackSpaceStruc; > 786 > 787 > 788 //----------------------------------------------------------------------- > 789 // GlobalData, ArchiveData and SFXFileName are passed. > 790 //----------------------------------------------------------------------- > 791 > 792 typedef struct sACECallbackSFXFileStruc > 793 { > 794 ULONG StructureType; // is ACE_CALLBACK_TYPE_SFXFILE > 795 ULONG Code; // see definition of > 796 // ACE_CALLBACK_TYPE_SFXFILE > 797 ULONG Operation; // ACE_CALLBACK_OPERATION constant > 798 > 799 pACEGlobalDataStruc GlobalData; // see tACEGlobalDataStruc > 800 pACEArchiveDataStruc ArchiveData; // see tACEArchiveDataStruc > 801 LPSTR SFXFileName; // name of SFX > 802 } tACECallbackSFXFileStruc, > 803 *pACECallbackSFXFileStruc; > 804 > 805 > 806 //----------------------------------------------------------------------- > 807 // GlobalData, ArchiveData and CopyData are passed. > 808 //----------------------------------------------------------------------- > 809 > 810 typedef struct sACECallbackCopyStruc > 811 { > 812 ULONG StructureType; // is ACE_CALLBACK_TYPE_COPY > 813 ULONG Code; // see definition of > 814 // ACE_CALLBACK_TYPE_COPY > 815 ULONG Operation; // ACE_CALLBACK_OPERATION constant > 816 > 817 pACEGlobalDataStruc GlobalData; // see tACEGlobalDataStruc > 818 pACEArchiveDataStruc ArchiveData; // see tACEArchiveDataStruc > 819 pACECopyInfoStruc CopyData; // see tACECopyInfoStruc > 820 } tACECallbackCopyStruc, > 821 *pACECallbackCopyStruc; > 822 > 823 > 824 //----------------------------------------------------------------------- > 825 // GlobalData, ArchiveData, FileData and ProgressData are passed. > 826 //----------------------------------------------------------------------- > 827 > 828 typedef struct sACECallbackProgressStruc > 829 { > 830 ULONG StructureType; // is ACE_CALLBACK_TYPE_PROGRESS > 831 ULONG Code; // see definition of > 832 // ACE_CALLBACK_TYPE_PROGRESS > 833 ULONG Operation; // ACE_CALLBACK_OPERATION constant > 834 > 835 pACEGlobalDataStruc GlobalData; // see tACEGlobalDataStruc > 836 pACEArchiveDataStruc ArchiveData; // see tACEArchiveDataStruc > 837 pACEFileDataStruc FileData; // see tACEFileDataStruc > 838 pACEProgressDataStruc ProgressData; // see tACEProgressDataStruc > 839 } tACECallbackProgressStruc, > 840 *pACECallbackProgressStruc; > 841 > 842 > 843 //----------------------------------------------------------------------- > 844 // GlobalData, ArchiveData, FileData and CRC-check result are passed. > 845 //----------------------------------------------------------------------- > 846 > 847 typedef struct sACECallbackCRCCheckStruc > 848 { > 849 ULONG StructureType; // is ACE_CALLBACK_TYPE_CRCCHECK > 850 ULONG Code; // see definition of > 851 // ACE_CALLBACK_TYPE_CRCCHECK > 852 ULONG Operation; // ACE_CALLBACK_OPERATION constant > 853 > 854 pACEGlobalDataStruc GlobalData; // see tACEGlobalDataStruc > 855 pACEArchiveDataStruc ArchiveData; // see tACEArchiveDataStruc > 856 pACEFileDataStruc FileData; // see tACEFileDataStruc > 857 BOOL CRCOk; // CRC-check result > 858 } tACECallbackCRCCheckStruc, > 859 *pACECallbackCRCCheckStruc; > 860 > 861 > 862 //ヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘ > 863 //=================--- Part 2.5: info callback function ---================ > 864 //ヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘ > 865 // Declaration of ACEInfoCallbackProc() parameter and explanation of > 866 // callback info codes. > 867 //--------------------------------------------------------------------------- > 868 > 869 //----------------------------------------------------------------------- > 870 // Union parameter used at ACEInfoCallbackProc(). > 871 //----------------------------------------------------------------------- > 872 > 873 typedef union sACEInfoCallbackProcStruc > 874 { > 875 ULONG StructureType; // indicates which of the fol- > 876 // lowing structures is used > 877 tACECallbackGlobalStruc Global; > 878 tACECallbackArchiveStruc Archive; > 879 tACECallbackRealFileStruc RealFile; > 880 tACECallbackCopyStruc Copy; > 881 } tACEInfoCallbackProcStruc; > 882 > 883 > 884 //----------------------------------------------------------------------- > 885 // These values are passed to the ACEInfoCallbackProc callback function > 886 // to inform the application about actions (smaller parts of operations) > 887 // which may take some time or other things that might be of interest. > 888 //----------------------------------------------------------------------- > 889 > 890 #define ACE_CALLBACK_INFO_GENERALKEY 0x100 > 891 > 892 // key is a general one (no own AV; own key > 893 // is obtainable for a special price!?) > 894 // not used in ACL > 895 //--------------------------------------------- > 896 // structure type: > 897 // ACE_CALLBACK_TYPE_GLOBAL > 898 // operations: > 899 // ACERegister > 900 > 901 #define ACE_CALLBACK_INFO_TMPARCCREATE 0x110 > 902 > 903 // creating temporary archive for changes > 904 //--------------------------------------------- > 905 // structure type: > 906 // ACE_CALLBACK_TYPE_ARCHIVE > 907 // operations: > 908 // ACEAdd > 909 // ACESetComments > 910 // ACEEncryptFiles > 911 // ACEAddSFX > 912 // ACELock > 913 // ACEAddAV > 914 // ACERepair > 915 > 916 > 917 #define ACE_CALLBACK_INFO_TMPARCCREATEEND 0x111 > 918 > 919 // finished creating temporary archive > 920 //--------------------------------------------- > 921 // structure type: > 922 // ACE_CALLBACK_TYPE_ARCHIVE > 923 // operations: > 924 // ACEAdd > 925 // ACESetComments > 926 // ACEEncryptFiles > 927 // ACEAddSFX > 928 // ACELock > 929 // ACEAddAV > 930 // ACERepair > 931 > 932 > 933 #define ACE_CALLBACK_INFO_ADDRECREC 0x112 > 934 > 935 // adding recovery record > 936 //--------------------------------------------- > 937 // structure type: > 938 // ACE_CALLBACK_TYPE_ARCHIVE > 939 // operations: > 940 // ACEAdd > 941 // ACESetComments > 942 // ACEEncryptFiles > 943 // ACEAddSFX > 944 // ACELock > 945 // ACEAddAV > 946 // ACEAddRecoveryRecord > 947 // ACERepair > 948 > 949 > 950 #define ACE_CALLBACK_INFO_ADDRECRECEND 0x113 > 951 > 952 // finished adding recovery record > 953 //--------------------------------------------- > 954 // structure type: > 955 // ACE_CALLBACK_TYPE_ARCHIVE > 956 // operations: > 957 // ACEAdd > 958 // ACESetComments > 959 // ACEEncryptFiles > 960 // ACEAddSFX > 961 // ACELock > 962 // ACEAddAV > 963 // ACEAddRecoveryRecord > 964 // ACERepair > 965 > 966 > 967 #define ACE_CALLBACK_INFO_RECREC 0x114 > 968 > 969 // trying to recover files by recovery > 970 // record; end indicated by > 971 // ACE_CALLBACK_INFO_RECOVERED or > 972 // ACE_CALLBACK_INFO_NODAMAGE > 973 //--------------------------------------------- > 974 // structure type: > 975 // ACE_CALLBACK_TYPE_ARCHIVE > 976 // operations: > 977 // ACERepair > 978 > 979 > 980 #define ACE_CALLBACK_INFO_NORECREC 0x115 > 981 > 982 // found no recovery record > 983 //--------------------------------------------- > 984 // structure type: > 985 // ACE_CALLBACK_TYPE_ARCHIVE > 986 // operations: > 987 // ACERepair > 988 > 989 > 990 #define ACE_CALLBACK_INFO_RECOVERED 0x116 > 991 > 992 // archive has been fully recovered > 993 //--------------------------------------------- > 994 // structure type: > 995 // ACE_CALLBACK_TYPE_ARCHIVE > 996 // operations: > 997 // ACERepair > 998 > 999 > 1000 #define ACE_CALLBACK_INFO_NODAMAGE 0x117 > 1001 > 1002 // ACERepair detected by recovery record that > 1003 // the archive is not damaged > 1004 //--------------------------------------------- > 1005 // structure type: > 1006 // ACE_CALLBACK_TYPE_ARCHIVE > 1007 // operations: > 1008 // ACERepair > 1009 > 1010 > 1011 #define ACE_CALLBACK_INFO_FNDMAINHEAD 0x118 > 1012 > 1013 // found archive header > 1014 //--------------------------------------------- > 1015 // structure type: > 1016 // ACE_CALLBACK_TYPE_ARCHIVE > 1017 // operations: > 1018 // ACERepair > 1019 > 1020 > 1021 #define ACE_CALLBACK_INFO_FILELISTCREATE 0x119 > 1022 > 1023 // creating a file list of specified files > 1024 //--------------------------------------------- > 1025 // structure type: > 1026 // ACE_CALLBACK_TYPE_ARCHIVE > 1027 // operations: > 1028 // ACEList > 1029 // ACEDelete > 1030 // ACETest > 1031 // ACEExtract > 1032 // ACEAdd > 1033 // ACESetComments > 1034 // ACEEncryptFiles > 1035 > 1036 > 1037 #define ACE_CALLBACK_INFO_FILELISTCREATEEND 0x11a > 1038 > 1039 // sent when creating the list of files > 1040 // is finished > 1041 //--------------------------------------------- > 1042 // structure type: > 1043 // ACE_CALLBACK_TYPE_ARCHIVE > 1044 // operations: > 1045 // ACEList > 1046 // ACEDelete > 1047 // ACETest > 1048 // ACEExtract > 1049 // ACEAdd > 1050 // ACESetComments > 1051 // ACEEncryptFiles > 1052 > 1053 > 1054 #define ACE_CALLBACK_INFO_FILESORT 0x11b > 1055 > 1056 // sorting files (for solid compression) > 1057 //--------------------------------------------- > 1058 // structure type: > 1059 // ACE_CALLBACK_TYPE_ARCHIVE > 1060 // operations: > 1061 // ACEAdd > 1062 > 1063 > 1064 #define ACE_CALLBACK_INFO_FILESORTEND 0x11c > 1065 > 1066 // sorting files (for solid compression) > 1067 //--------------------------------------------- > 1068 // structure type: > 1069 // ACE_CALLBACK_TYPE_ARCHIVE > 1070 // operations: > 1071 // ACEAdd > 1072 > 1073 > 1074 #define ACE_CALLBACK_INFO_COPYEND 0x11d > 1075 > 1076 // copying a file finished > 1077 //--------------------------------------------- > 1078 // structure type: > 1079 // ACE_CALLBACK_TYPE_ARCHIVE > 1080 // operations: > 1081 // ACEAdd > 1082 // ACESetComments > 1083 // ACEEncryptFiles > 1084 // ACEAddSFX > 1085 // ACELock > 1086 // ACEAddAV > 1087 // ACERepair > 1088 > 1089 > 1090 #define ACE_CALLBACK_INFO_FILELISTADD 0x140 > 1091 > 1092 // called at creation of file list; the name > 1093 // of the file just added to file list is > 1094 // passed in tACECallbackRealFileStruc > 1095 //--------------------------------------------- > 1096 // structure type: > 1097 // ACE_CALLBACK_TYPE_REALFILE > 1098 // operations: > 1099 // ACEList > 1100 // ACEDelete > 1101 // ACETest > 1102 // ACEExtract > 1103 // ACEAdd > 1104 // ACESetComments > 1105 // ACEEncryptFiles > 1106 > 1107 > 1108 #define ACE_CALLBACK_INFO_COPY 0x150 > 1109 > 1110 // copying a file; file name, file size and > 1111 // copied bytes are passed via > 1112 // tACECallbackCopyStruc > 1113 //--------------------------------------------- > 1114 // structure type: > 1115 // ACE_CALLBACK_TYPE_COPY > 1116 // operations: > 1117 // ACEAdd > 1118 // ACESetComments > 1119 // ACEEncryptFiles > 1120 // ACEAddSFX > 1121 // ACELock > 1122 // ACEAddAV > 1123 // ACERepair > 1124 > 1125 > 1126 //ヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘ > 1127 //=================--- Part 2.6: error callback function ---=============== > 1128 //ヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘ > 1129 // Declaration of ACEErrorCallbackProc() parameter and explanation of > 1130 // callback error codes. > 1131 //--------------------------------------------------------------------------- > 1132 > 1133 //----------------------------------------------------------------------- > 1134 // Union parameter used at ACEErrorCallbackProc(). > 1135 //----------------------------------------------------------------------- > 1136 > 1137 typedef union sACEErrorCallbackProcStruc > 1138 { > 1139 ULONG StructureType; // indicates which of the fol- > 1140 // lowing structures is used > 1141 tACECallbackGlobalStruc Global; > 1142 tACECallbackArchiveStruc Archive; > 1143 tACECallbackArchivedFileStruc ArchivedFile; > 1144 tACECallbackRealFileStruc RealFile; > 1145 tACECallbackSpaceStruc Space; > 1146 tACECallbackSFXFileStruc SFXFile; > 1147 } tACEErrorCallbackProcStruc; > 1148 > 1149 > 1150 //----------------------------------------------------------------------- > 1151 // This structure is used by the ACEErrorCallback function to inform > 1152 // the application about errors. The Code field of the used structure > 1153 // contains an ACE_CALLBACK_ERROR value. At most problems modifications > 1154 // to the passed structure can be made to fix it. Other problems can not > 1155 // be solved and cause an operation abort immediately. > 1156 // ErrorCallbackProc() has to return either ACE_CALLBACK_RETURN_OK or > 1157 // ACE_CALLBACK_RETURN_CANCEL. > 1158 //----------------------------------------------------------------------- > 1159 > 1160 #define ACE_CALLBACK_ERROR_MEMORY 0x200 > 1161 > 1162 // not enough memory to perform operation > 1163 // (dictionary too large?) > 1164 //--------------------------------------------- > 1165 // structure type: > 1166 // ACE_CALLBACK_TYPE_GLOBAL > 1167 // operations: > 1168 // all > 1169 > 1170 > 1171 #define ACE_CALLBACK_ERROR_REGISTER 0x201 > 1172 > 1173 // registration key is invalid (or wrong > 1174 // format?); not used in ACL > 1175 //--------------------------------------------- > 1176 // structure type: > 1177 // ACE_CALLBACK_TYPE_GLOBAL > 1178 // operations: > 1179 // ACERegister > 1180 > 1181 > 1182 #define ACE_CALLBACK_ERROR_READKEY 0x202 > 1183 > 1184 // key could not be read (does not exist or > 1185 // is invalid); not used in ACL > 1186 //--------------------------------------------- > 1187 // structure type: > 1188 // ACE_CALLBACK_TYPE_GLOBAL > 1189 // operations: > 1190 // ACEInitDll > 1191 > 1192 > 1193 #define ACE_CALLBACK_ERROR_WRITEKEY 0x203 > 1194 > 1195 // could not write key; not used in ACL > 1196 //--------------------------------------------- > 1197 // structure type: > 1198 // ACE_CALLBACK_TYPE_GLOBAL > 1199 // operations: > 1200 // ACERegister > 1201 > 1202 > 1203 #define ACE_CALLBACK_ERROR_NOWINACEKEY 0x204 > 1204 > 1205 // key not valid for WinACE; not used in ACL > 1206 //--------------------------------------------- > 1207 // structure type: > 1208 // ACE_CALLBACK_TYPE_GLOBAL > 1209 // operations: > 1210 // ACERegister > 1211 > 1212 > 1213 #define ACE_CALLBACK_ERROR_NOACTIVEACEKEY 0x205 > 1214 > 1215 // key not valid for ActiveACE; not used in ACL > 1216 //--------------------------------------------- > 1217 // structure type: > 1218 // ACE_CALLBACK_TYPE_GLOBAL > 1219 // operations: > 1220 // ACERegister > 1221 > 1222 > 1223 #define ACE_CALLBACK_ERROR_UNCSPACE 0x206 > 1224 > 1225 // Win95_OSR1-bug: it is impossible to > 1226 // get available space of network drives by > 1227 // an UNC name; ACE will not stop but > 1228 // assumes there are 4Gb free > 1229 // --> the operation might fail if free > 1230 // disk space is low > 1231 //--------------------------------------------- > 1232 // structure type: > 1233 // ACE_CALLBACK_TYPE_GLOBAL > 1234 // operations: > 1235 // all > 1236 > 1237 > 1238 #define ACE_CALLBACK_ERROR_MODIFYVOLUME 0x220 > 1239 > 1240 // modification of volumes not possible > 1241 //--------------------------------------------- > 1242 // structure type: > 1243 // ACE_CALLBACK_TYPE_ARCHIVE > 1244 // operations: > 1245 // ACEAdd > 1246 // ACESetComments > 1247 // ACEEncryptFiles > 1248 // ACEAddSFX > 1249 // ACELock > 1250 // ACEAddAV > 1251 // ACEAddRecoveryRecord > 1252 > 1253 > 1254 #define ACE_CALLBACK_ERROR_MODIFYLOCKEDARCHIVE 0x221 > 1255 > 1256 // modification of locked archive not possible > 1257 //--------------------------------------------- > 1258 // structure type: > 1259 // ACE_CALLBACK_TYPE_ARCHIVE > 1260 // operations: > 1261 // ACEAdd > 1262 // ACESetComments > 1263 // ACEEncryptFiles > 1264 // ACEAddSFX > 1265 // ACELock > 1266 // ACEAddAV > 1267 // ACEAddRecoveryRecord > 1268 > 1269 > 1270 #define ACE_CALLBACK_ERROR_AV 0x222 > 1271 > 1272 // AV of archive is NOT ok or does not match > 1273 // to the users AV (not used in ACL) > 1274 //--------------------------------------------- > 1275 // structure type: > 1276 // ACE_CALLBACK_TYPE_ARCHIVE > 1277 // operations: > 1278 // ACEReadArchiveData > 1279 // ACEList > 1280 // ACEDelete > 1281 // ACETest > 1282 // ACEExtract > 1283 // ACEAdd > 1284 // ACERepair > 1285 // ACESetComments > 1286 // ACEEncryptFiles > 1287 // ACEAddSFX > 1288 // ACEAddAV > 1289 // ACELock > 1290 // ACEAddRecoveryRecord > 1291 > 1292 > 1293 #define ACE_CALLBACK_ERROR_TOODAMAGED 0x223 > 1294 > 1295 // can not repair by recovery record but > 1296 // can continue with normal repair > 1297 //--------------------------------------------- > 1298 // structure type: > 1299 // ACE_CALLBACK_TYPE_ARCHIVE > 1300 // operations: > 1301 // ACERepair > 1302 > 1303 > 1304 #define ACE_CALLBACK_ERROR_ARCHIVEEXISTS 0x224 > 1305 > 1306 // destination file name already used; > 1307 // may occur if at > 1308 // ACE_CALLBACK_ERROR_ARCHIVESPACE a > 1309 // direcory is specified where a file > 1310 // with the same name as the current archive > 1311 // already exists > 1312 //--------------------------------------------- > 1313 // structure type: > 1314 // ACE_CALLBACK_TYPE_ARCHIVE > 1315 // operations: > 1316 // ACEAdd > 1317 > 1318 > 1319 #define ACE_CALLBACK_ERROR_OPENREPAIRARCHIVE 0x225 > 1320 > 1321 // could not create archive for repairing > 1322 //--------------------------------------------- > 1323 // structure type: > 1324 // ACE_CALLBACK_TYPE_ARCHIVE > 1325 // operations: > 1326 // ACERepair > 1327 > 1328 > 1329 #define ACE_CALLBACK_ERROR_OPENARCHIVEREAD 0x226 > 1330 > 1331 // could not open archive/volume for reading > 1332 //--------------------------------------------- > 1333 // structure type: > 1334 // ACE_CALLBACK_TYPE_ARCHIVE > 1335 // operations: > 1336 // ACEReadArchiveData > 1337 // ACEList > 1338 // ACETest > 1339 // ACEExtract > 1340 // ACERepair > 1341 > 1342 > 1343 #define ACE_CALLBACK_ERROR_OPENARCHIVEWRITE 0x227 > 1344 > 1345 // could not open archive/volume for writing > 1346 //--------------------------------------------- > 1347 // structure type: > 1348 // ACE_CALLBACK_TYPE_ARCHIVE > 1349 // operations: > 1350 // ACEDelete > 1351 // ACEAdd > 1352 // ACESetComments > 1353 // ACEEncryptFiles > 1354 // ACEAddSFX > 1355 // ACELock > 1356 // ACEAddAV > 1357 // ACEAddRecoveryRecord > 1358 // ACERepair > 1359 > 1360 > 1361 #define ACE_CALLBACK_ERROR_READARCHIVE 0x228 > 1362 > 1363 // error reading from archive > 1364 // (source disk removed?) > 1365 //--------------------------------------------- > 1366 // structure type: > 1367 // ACE_CALLBACK_TYPE_ARCHIVE > 1368 // operations: > 1369 // ACEReadArchiveData > 1370 // ACEList > 1371 // ACEDelete > 1372 // ACETest > 1373 // ACEExtract > 1374 // ACEAdd > 1375 // ACERepair > 1376 // ACESetComments > 1377 // ACEEncryptFiles > 1378 // ACEAddSFX > 1379 // ACEAddAV > 1380 // ACELock > 1381 // ACEAddRecoveryRecord > 1382 > 1383 > 1384 #define ACE_CALLBACK_ERROR_WRITEARCHIVE 0x229 > 1385 > 1386 // error writing to archive > 1387 // (destination disk removed?) > 1388 //--------------------------------------------- > 1389 // structure type: > 1390 // ACE_CALLBACK_TYPE_ARCHIVE > 1391 // operations: > 1392 // ACEDelete > 1393 // ACEAdd > 1394 // ACESetComments > 1395 // ACEEncryptFiles > 1396 // ACEAddSFX > 1397 // ACELock > 1398 // ACEAddAV > 1399 // ACEAddRecoveryRecord > 1400 // ACERepair > 1401 > 1402 > 1403 #define ACE_CALLBACK_ERROR_ALREADYSFX 0x22a > 1404 > 1405 // ca not make to SFX: is already SFX > 1406 //--------------------------------------------- > 1407 // structure type: > 1408 // ACE_CALLBACK_TYPE_ARCHIVE > 1409 // operations: > 1410 // ACEAddSFX > 1411 > 1412 > 1413 #define ACE_CALLBACK_ERROR_ADDSFXTOVOLUME 0x22b > 1414 > 1415 // adding SFX to volumes not possible > 1416 //--------------------------------------------- > 1417 // structure type: > 1418 // ACE_CALLBACK_TYPE_ARCHIVE > 1419 // operations: > 1420 // ACEAddSFX > 1421 > 1422 > 1423 #define ACE_CALLBACK_ERROR_ARCHIVEBROKEN 0x22c > 1424 > 1425 // archive is broken (damaged) > 1426 //--------------------------------------------- > 1427 // structure type: > 1428 // ACE_CALLBACK_TYPE_ARCHIVE > 1429 // operations: > 1430 // ACEReadArchiveData > 1431 // ACEList > 1432 // ACEDelete > 1433 // ACETest > 1434 // ACEExtract > 1435 // ACEAdd > 1436 // ACERepair > 1437 // ACESetComments > 1438 // ACEEncryptFiles > 1439 // ACEAddSFX > 1440 // ACEAddAV > 1441 // ACELock > 1442 // ACEAddRecoveryRecord > 1443 > 1444 #define ACE_CALLBACK_ERROR_ARCHIVESAVE 0x22d > 1445 > 1446 // not enough space to save archive; > 1447 // but normally > 1448 // ACE_CALLBACK_ERROR_ARCHIVESPACE > 1449 // should allow to change destination > 1450 //--------------------------------------------- > 1451 // structure type: > 1452 // ACE_CALLBACK_TYPE_ARCHIVE > 1453 // operations: > 1454 // ACEAdd > 1455 // ACESetComments > 1456 // ACEEncryptFiles > 1457 // ACEAddSFX > 1458 // ACELock > 1459 // ACEAddAV > 1460 // ACEAddRecoveryRecord > 1461 // ACERepair > 1462 > 1463 > 1464 #define ACE_CALLBACK_ERROR_NOFILES 0x22e > 1465 > 1466 // no files specified/could not find files > 1467 //--------------------------------------------- > 1468 // structure type: > 1469 // ACE_CALLBACK_TYPE_ARCHIVE > 1470 // operations: > 1471 // ACEList > 1472 // ACEDelete > 1473 // ACETest > 1474 // ACEExtract > 1475 // ACEAdd > 1476 // ACESetComments > 1477 // ACEEncryptFiles > 1478 > 1479 > 1480 #define ACE_CALLBACK_ERROR_ISNOTANARCHIVE 0x22f > 1481 > 1482 // specified archive file is not an > 1483 // ACE archive > 1484 //--------------------------------------------- > 1485 // structure type: > 1486 // ACE_CALLBACK_TYPE_ARCHIVE > 1487 // operations: > 1488 // ACEReadArchiveData > 1489 // ACEList > 1490 // ACEDelete > 1491 // ACETest > 1492 // ACEExtract > 1493 // ACEAdd > 1494 // ACERepair > 1495 // ACESetComments > 1496 // ACEEncryptFiles > 1497 // ACEAddSFX > 1498 // ACEAddAV > 1499 // ACELock > 1500 // ACEAddRecoveryRecord > 1501 > 1502 > 1503 #define ACE_CALLBACK_ERROR_TEMPDIRCREATE 0x230 > 1504 > 1505 // could not create file in temp directory > 1506 // (write protected or directory does > 1507 // not exist) > 1508 //--------------------------------------------- > 1509 // structure type: > 1510 // ACE_CALLBACK_TYPE_ARCHIVE > 1511 // operations: > 1512 // ACEAdd > 1513 // ACESetComments > 1514 // ACEEncryptFiles > 1515 // ACEAddSFX > 1516 // ACELock > 1517 // ACEAddAV > 1518 // ACEAddRecoveryRecord > 1519 // ACERepair > 1520 > 1521 > 1522 #define ACE_CALLBACK_ERROR_HIGHERVERSION 0x231 > 1523 > 1524 // this Dll version is not able to handle > 1525 // the archive > 1526 //--------------------------------------------- > 1527 // structure type: > 1528 // ACE_CALLBACK_TYPE_ARCHIVE > 1529 // operations: > 1530 // ACEAdd > 1531 // ACESetComments > 1532 // ACEEncryptFiles > 1533 // ACEAddSFX > 1534 // ACELock > 1535 // ACEAddAV > 1536 // ACEAddRecoveryRecord > 1537 > 1538 > 1539 #define ACE_CALLBACK_ERROR_CREATIONNAMEINUSE 0x240 > 1540 > 1541 // name used by directory > 1542 //--------------------------------------------- > 1543 // structure type: > 1544 // ACE_CALLBACK_TYPE_ARCHIVEDFILE > 1545 // operations: > 1546 // ACEExtract > 1547 > 1548 > 1549 #define ACE_CALLBACK_ERROR_ENCRYPTIONCRC 0x242 > 1550 > 1551 // encryption failed because of CRC-Error at > 1552 // decompression > 1553 //--------------------------------------------- > 1554 // structure type: > 1555 // ACE_CALLBACK_TYPE_ARCHIVEDFILE > 1556 // operations: > 1557 // ACEEncryptFiles > 1558 > 1559 > 1560 #define ACE_CALLBACK_ERROR_READ 0x243 > 1561 > 1562 // error reading file to be added > 1563 // (source disk removed?) > 1564 //--------------------------------------------- > 1565 // structure type: > 1566 // ACE_CALLBACK_TYPE_ARCHIVEDFILE > 1567 // operations: > 1568 // ACEAdd > 1569 > 1570 > 1571 #define ACE_CALLBACK_ERROR_WRITE 0x244 > 1572 > 1573 // error at extraction > 1574 // (destination disk removed?) > 1575 //--------------------------------------------- > 1576 // structure type: > 1577 // ACE_CALLBACK_TYPE_ARCHIVEDFILE > 1578 // operations: > 1579 // ACEExtract > 1580 > 1581 > 1582 #define ACE_CALLBACK_ERROR_OPENREAD 0x245 > 1583 > 1584 // error opening file for reading > 1585 //--------------------------------------------- > 1586 // structure type: > 1587 // ACE_CALLBACK_TYPE_ARCHIVEDFILE > 1588 // operations: > 1589 // ACEAdd > 1590 > 1591 > 1592 #define ACE_CALLBACK_ERROR_OPENWRITE 0x246 > 1593 > 1594 // error opening file for writing > 1595 //--------------------------------------------- > 1596 // structure type: > 1597 // ACE_CALLBACK_TYPE_ARCHIVEDFILE > 1598 // operations: > 1599 // ACEExtract > 1600 > 1601 > 1602 #define ACE_CALLBACK_ERROR_FILENAMETOOLONG 0x247 > 1603 > 1604 // resulting file name too long > 1605 //--------------------------------------------- > 1606 // structure type: > 1607 // ACE_CALLBACK_TYPE_ARCHIVEDFILE > 1608 // operations: > 1609 // ACEAdd > 1610 > 1611 > 1612 #define ACE_CALLBACK_ERROR_REPACKCRC 0x248 > 1613 > 1614 // CRC-check error at recompression > 1615 // (archive broken or wrong password) > 1616 //--------------------------------------------- > 1617 // structure type: > 1618 // ACE_CALLBACK_TYPE_ARCHIVEDFILE > 1619 // operations: > 1620 // ACEDelete > 1621 // ACEAdd > 1622 > 1623 > 1624 #define ACE_CALLBACK_ERROR_EXCLUDEPATH 0x249 > 1625 > 1626 // could not exclude path of file names; two > 1627 // or more files would have the same name > 1628 //--------------------------------------------- > 1629 // structure type: > 1630 // ACE_CALLBACK_TYPE_ARCHIVEDFILE > 1631 // operations: > 1632 // ACEAdd > 1633 > 1634 > 1635 #define ACE_CALLBACK_ERROR_METHOD 0x24a > 1636 > 1637 // compression method not known to this > 1638 // Dll version > 1639 //--------------------------------------------- > 1640 // structure type: > 1641 // ACE_CALLBACK_TYPE_ARCHIVEDFILE > 1642 // operations: > 1643 // ACEDelete > 1644 // ACETest > 1645 // ACEExtract > 1646 // ACEAdd > 1647 // ACEEncryptFiles > 1648 > 1649 > 1650 #define ACE_CALLBACK_ERROR_EXTRACTSPACE 0x24b > 1651 > 1652 // not enough space to extract file > 1653 //--------------------------------------------- > 1654 // structure type: > 1655 // ACE_CALLBACK_TYPE_ARCHIVEDFILE > 1656 // operations: > 1657 // ACEExtract > 1658 > 1659 > 1660 #define ACE_CALLBACK_ERROR_CREATION 0x24c > 1661 > 1662 // creation failed (write-protection?) > 1663 //--------------------------------------------- > 1664 // structure type: > 1665 // ACE_CALLBACK_TYPE_ARCHIVEDFILE > 1666 // operations: > 1667 // ACEExtract > 1668 > 1669 > 1670 #define ACE_CALLBACK_ERROR_OVERWRITEDELETE 0x24d > 1671 > 1672 // could not overwrite because deletion of > 1673 // file failed > 1674 //--------------------------------------------- > 1675 // structure type: > 1676 // ACE_CALLBACK_TYPE_ARCHIVEDFILE > 1677 // operations: > 1678 // ACEExtract > 1679 > 1680 > 1681 #define ACE_CALLBACK_ERROR_MOVEDELETE 0x260 > 1682 > 1683 // deletion of file or directory failed > 1684 // (move operation) > 1685 //--------------------------------------------- > 1686 // structure type: > 1687 // ACE_CALLBACK_TYPE_REALFILE > 1688 // operations: > 1689 // ACEAdd > 1690 > 1691 #define ACE_CALLBACK_ERROR_TEMPDIRSPACE 0x270 > 1692 > 1693 // not enough space at current temp directory > 1694 //--------------------------------------------- > 1695 // structure type: > 1696 // ACE_CALLBACK_TYPE_SPACE > 1697 // operations: > 1698 // ACEAdd > 1699 // ACESetComments > 1700 // ACEEncryptFiles > 1701 // ACEAddSFX > 1702 // ACEAddAV > 1703 > 1704 > 1705 #define ACE_CALLBACK_ERROR_ARCHIVESPACE 0x271 > 1706 > 1707 // not enough space to save archive > 1708 //--------------------------------------------- > 1709 // structure type: > 1710 // ACE_CALLBACK_TYPE_SPACE > 1711 // operations: > 1712 // ACEDelete > 1713 // ACEAdd > 1714 // ACESetComments > 1715 // ACEEncryptFiles > 1716 // ACEAddSFX > 1717 // ACELock > 1718 // ACEAddAV > 1719 // ACEAddRecoveryRecord > 1720 // ACERepair > 1721 > 1722 > 1723 #define ACE_CALLBACK_ERROR_READINGSFXFILE 0x280 > 1724 > 1725 // error reading SFX file: > 1726 // is no SFX file, > 1727 // file does not exist or could not be opened > 1728 // for reading > 1729 //--------------------------------------------- > 1730 // structure type: > 1731 // ACE_CALLBACK_TYPE_SFXFILE > 1732 // operations: > 1733 // ACEAdd > 1734 // ACEAddSFX > 1735 > 1736 > 1737 //ヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘ > 1738 //================--- Part 2.7: request callback function ---============== > 1739 //ヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘ > 1740 // Declaration of ACERequestCallbackProc() parameter and explanation of > 1741 // callback request codes. > 1742 //--------------------------------------------------------------------------- > 1743 > 1744 //----------------------------------------------------------------------- > 1745 // Union parameter used at ACERequestCallbackProc(). > 1746 //----------------------------------------------------------------------- > 1747 > 1748 typedef union sACERequestCallbackProcStruc > 1749 { > 1750 ULONG StructureType; // indicates which of the fol- > 1751 // lowing structures is used > 1752 tACECallbackGlobalStruc Global; > 1753 tACECallbackArchiveStruc Archive; > 1754 tACECallbackArchivedFileStruc ArchivedFile; > 1755 tACECallbackRealFileStruc RealFile; > 1756 } tACERequestCallbackProcStruc; > 1757 > 1758 > 1759 //----------------------------------------------------------------------- > 1760 // Question constants are passed to the RequestCallbackProc callback > 1761 // function to request further data. > 1762 // RequestCallbackProc may return ACE_CALLBACK_RETURN_OK, > 1763 // ACE_CALLBACK_RETURN_NO or ACE_CALLBACK_RETURN_CANCEL. > 1764 //----------------------------------------------------------------------- > 1765 > 1766 #define ACE_CALLBACK_REQUEST_REGISTER 0x300 > 1767 > 1768 // Global.UserAV has to be set > 1769 // to continue registration process; > 1770 // not used in ACL > 1771 //--------------------------------------------- > 1772 // structure type: > 1773 // ACE_CALLBACK_TYPE_GLOBAL > 1774 // operations: > 1775 // ACERegister > 1776 > 1777 > 1778 #define ACE_CALLBACK_REQUEST_MARKASSOLID 0x320 > 1779 > 1780 // ArchiveHeader damaged, > 1781 // set solid flag for the new archive? > 1782 // (in case of doubt return yes!) > 1783 //--------------------------------------------- > 1784 // structure type: > 1785 // ACE_CALLBACK_TYPE_ARCHIVE > 1786 // operations: > 1787 // ACERepair > 1788 > 1789 > 1790 #define ACE_CALLBACK_REQUEST_CHANGEVOLUME 0x321 > 1791 // Asks for permission to process next volume. > 1792 // If operation is ACE_CALLBACK_OPERATION_ADD > 1793 // then a new volume will be created. > 1794 // The application may change the name > 1795 // of the archive by modifying > 1796 // ArchiveData->ArchiveName > 1797 //--------------------------------------------- > 1798 // structure type: > 1799 // ACE_CALLBACK_TYPE_ARCHIVE > 1800 // operations: > 1801 // ACEDelete > 1802 // ACEAdd > 1803 // ACESetComments > 1804 // ACEEncryptFiles > 1805 // ACEList > 1806 // ACETest > 1807 // ACEExtract > 1808 > 1809 > 1810 #define ACE_CALLBACK_REQUEST_ARCHIVEEXISTS 0x322 > 1811 // Asks whether to overwrite a file with > 1812 // the same name as the archive. > 1813 //--------------------------------------------- > 1814 // structure type: > 1815 // ACE_CALLBACK_TYPE_ARCHIVE > 1816 // operations: > 1817 // ACEDelete > 1818 // ACEAdd > 1819 // ACESetComments > 1820 // ACEEncryptFiles > 1821 > 1822 > 1823 #define ACE_CALLBACK_REQUEST_OVERWRITE 0x340 > 1824 > 1825 // Overwrite existing file? > 1826 //--------------------------------------------- > 1827 // structure type: > 1828 // ACE_CALLBACK_TYPE_ARCHIVEDFILE > 1829 // operations: > 1830 // ACEAdd > 1831 // ACEExtract > 1832 > 1833 > 1834 #define ACE_CALLBACK_REQUEST_DELARCHIVEDSYSFILE 0x341 > 1835 > 1836 // Delete rdonly/hidden/system file > 1837 //--------------------------------------------- > 1838 // structure type: > 1839 // ACE_CALLBACK_TYPE_ARCHIVEDFILE > 1840 // operations: > 1841 // ACEDelete > 1842 > 1843 > 1844 #define ACE_CALLBACK_REQUEST_ADDBROKENFILE 0x342 > 1845 > 1846 // repair function found file with > 1847 // broken header, add file? > 1848 //--------------------------------------------- > 1849 // structure type: > 1850 // ACE_CALLBACK_TYPE_ARCHIVEDFILE > 1851 // operations: > 1852 // ACERepair > 1853 > 1854 > 1855 #define ACE_CALLBACK_REQUEST_PASSWORD 0x343 > 1856 > 1857 // password required; attention: may be > 1858 // decryption _and_ encryption; but passwords > 1859 // can be different --> better changing > 1860 // passwords at StateCallbackProc > 1861 //--------------------------------------------- > 1862 // structure type: > 1863 // ACE_CALLBACK_TYPE_ARCHIVEDFILE > 1864 // operations: > 1865 // ACEDelete > 1866 // ACETest > 1867 // ACEExtract > 1868 // ACEAdd > 1869 // ACEEncryptFiles > 1870 > 1871 > 1872 #define ACE_CALLBACK_REQUEST_OVERWRITESYSFILE 0x344 > 1873 > 1874 // Overwrite rdonly/hidden/system file > 1875 //--------------------------------------------- > 1876 // structure type: > 1877 // ACE_CALLBACK_TYPE_ARCHIVEDFILE > 1878 // operations: > 1879 // ACEAdd > 1880 // ACEExtract > 1881 > 1882 > 1883 #define ACE_CALLBACK_REQUEST_MOVEDELREALSYSFILE 0x360 > 1884 > 1885 // Delete rdonly/hidden/system file > 1886 // (move to archive operation) > 1887 //--------------------------------------------- > 1888 // structure type: > 1889 // ACE_CALLBACK_TYPE_REALFILE > 1890 // operations: > 1891 // ACEAdd > 1892 > 1893 > 1894 //ヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘ > 1895 //=================--- Part 2.8: state callback function ---=============== > 1896 //ヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘ > 1897 // Declaration of ACEStateCallbackProc() parameter and explanation of > 1898 // callback state codes. > 1899 //--------------------------------------------------------------------------- > 1900 > 1901 //----------------------------------------------------------------------- > 1902 // Union parameter used at ACEStateCallbackProc(). > 1903 //----------------------------------------------------------------------- > 1904 > 1905 typedef union sACEStateCallbackProcStruc > 1906 { > 1907 ULONG StructureType; // indicates which of the fol- > 1908 // lowing structures is used > 1909 tACECallbackArchiveStruc Archive; > 1910 tACECallbackArchivedFileStruc ArchivedFile; > 1911 tACECallbackArchivedFileStruc RealFile; > 1912 tACECallbackProgressStruc Progress; > 1913 tACECallbackCRCCheckStruc CRCCheck; > 1914 } tACEStateCallbackProcStruc; > 1915 > 1916 > 1917 //----------------------------------------------------------------------- > 1918 // Calls to (*StateCallbackProc)() with ACE_CALLBACK_STATE values in the > 1919 // Code field are made to enable the application to show the progress of > 1920 // an operation. > 1921 //----------------------------------------------------------------------- > 1922 > 1923 #define ACE_CALLBACK_STATE_STARTARCHIVE 0x400 > 1924 > 1925 // procession of archive is about to begin > 1926 //--------------------------------------------- > 1927 // structure type: > 1928 // ACE_CALLBACK_TYPE_ARCHIVE > 1929 // operations: > 1930 // ACEList > 1931 // ACEDelete > 1932 // ACETest > 1933 // ACEExtract > 1934 // ACEAdd > 1935 // ACERepair > 1936 // ACESetComments > 1937 // ACEEncryptFiles > 1938 // ACEAddSFX > 1939 // ACEAddAV > 1940 // ACELock > 1941 // ACEAddRecoveryRecord > 1942 > 1943 > 1944 #define ACE_CALLBACK_STATE_STARTFILE 0x410 > 1945 > 1946 // procession of file is about to begin > 1947 //--------------------------------------------- > 1948 // structure type: > 1949 // ACE_CALLBACK_TYPE_ARCHIVEDFILE > 1950 // operations: > 1951 // ACEList > 1952 // ACEDelete > 1953 // ACETest > 1954 // ACEExtract > 1955 // ACEAdd > 1956 // ACERepair > 1957 // ACESetComments > 1958 // ACEEncryptFiles > 1959 > 1960 > 1961 #define ACE_CALLBACK_STATE_ENDNOCRCCHECK 0x411 > 1962 > 1963 // end of file procession > 1964 // (no CRC chceck for this operation) > 1965 //--------------------------------------------- > 1966 // structure type: > 1967 // ACE_CALLBACK_TYPE_ARCHIVEDFILE > 1968 // operations: > 1969 // ACEList > 1970 // ACEDelete > 1971 // ACEAdd > 1972 // ACERepair > 1973 // ACESetComments > 1974 // ACEEncryptFiles > 1975 > 1976 > 1977 #define ACE_CALLBACK_STATE_PROGRESS 0x420 > 1978 > 1979 // informs about the progress of a file > 1980 // operation > 1981 //--------------------------------------------- > 1982 // structure type: > 1983 // ACE_CALLBACK_TYPE_PROGRESS > 1984 // operations: > 1985 // ACEDelete > 1986 // ACETest > 1987 // ACEExtract > 1988 // ACEAdd > 1989 // ACERepair > 1990 // ACEEncryptFiles > 1991 > 1992 > 1993 #define ACE_CALLBACK_STATE_ENDCRCCHECK 0x430 > 1994 > 1995 // end of file procession, CRC-check > 1996 // result is passed > 1997 //--------------------------------------------- > 1998 // structure type: > 1999 // ACE_CALLBACK_TYPE_CRCCHECK > 2000 // operations: > 2001 // ACETest > 2002 // ACEExtract > 2003 // ACEDelete > 2004 // ACEAdd > 2005 > 2006 > 2007 > 2008 > 2009 //ヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘ > 2010 //ヘヘヘヘヘヘヘヘ=====--- Part 3: Functions supported by UNAceV2.Dll ---====ヘヘヘヘヘヘヘヘヘヘ > 2011 //ヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘ > 2012 > 2013 //--------------------------------------------------------------------------- > 2014 // > 2015 // UnAceV2.Dll supports the following functions: > 2016 // > 2017 // ACEInitDll > 2018 // ACEReadArchiveData > 2019 // ACEList > 2020 // ACETest > 2021 // ACEExtract > 2022 // > 2023 // First of all - before any other function is called - the Dll has to be > 2024 // initialized by ACEInitDll(). Using this function the application has > 2025 // to set temporary directory, key file path, comment buffer and > 2026 // callback function pointers. > 2027 // (callback function pointers can be set to NULL for first-try-runs) > 2028 // > 2029 // See description of each function for details about their task, input and > 2030 // output. Return codes of those functions are listed in part 3.1. > 2031 // > 2032 //--------------------------------------------------------------------------- > 2033 // > 2034 // Contents: > 2035 // Part 3.1: ACE.DLL function return codes > 2036 // Part 3.2: functions and parameter structures > 2037 // > 2038 //--------------------------------------------------------------------------- > 2039 > 2040 > 2041 //ヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘ > 2042 //=============--- Part 3.1: ACE.DLL function return codes ---============= > 2043 //ヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘ > 2044 > 2045 //----------------------------------------------------------------------- > 2046 // These error codes are returned by the ACE.DLL-functions. The meanings > 2047 // of the codes are the same, as they are for the exit codes of ACE.EXE. > 2048 //----------------------------------------------------------------------- > 2049 > 2050 #define ACE_ERROR_NOERROR 0 // no error; operation succesful > 2051 #define ACE_ERROR_MEM 1 // insufficient memory > 2052 #define ACE_ERROR_FILES 2 // no files specified > 2053 #define ACE_ERROR_FOUND 3 // specified archive not found > 2054 #define ACE_ERROR_FULL 4 // disk full > 2055 #define ACE_ERROR_OPEN 5 // could not open file > 2056 #define ACE_ERROR_READ 6 // read error > 2057 #define ACE_ERROR_WRITE 7 // write error > 2058 #define ACE_ERROR_CLINE 8 // invalid command line > 2059 #define ACE_ERROR_CRC 9 // CRC error > 2060 #define ACE_ERROR_OTHER 10 // other error > 2061 #define ACE_ERROR_EXISTS 11 // file already exists > 2062 #define ACE_ERROR_USER 255 // user break (application > 2063 // returned cancel code at > 2064 // callback function) > 2065 > 2066 > 2067 //----------------------------------------------------------------------- > 2068 // These error codes are returned by the ACE.DLL-functions. They are not > 2069 // used by ACE.EXE yet. > 2070 //----------------------------------------------------------------------- > 2071 > 2072 #define ACE_ERROR_PARAM 128 // might be used later > 2073 > 2074 > 2075 //ヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘ > 2076 //============--- Part 3.2: functions and parameter structures ---========== > 2077 //ヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘヘ > 2078 > 2079 //トトトトトトトトトトトトトトトトトトトトトトトトトトト ACEInitDll トトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトト > 2080 // Initializes ACE dynamic link library. Has to be called before any > 2081 // other function call. May be called more than one time. > 2082 //------------------------------------------------------------------------- > 2083 // Input : > 2084 // Output: > 2085 //------------------------------------------------------------------------- > 2086 > 2087 //----------------------------------------------------------------------- > 2088 // ACEInitDll() parameter structure. > 2089 //----------------------------------------------------------------------- > 2090 > 2091 typedef struct sACEInitDllStruc > 2092 { > 2093 tACEGlobalDataStruc > 2094 GlobalData; > 2095 CHAR Reserved[64]; // has to be filled with zeroes > 2096 } tACEInitDllStruc, > 2097 *pACEInitDllStruc; > 2098 > 2099 > 2100 //----------------------------------------------------------------------- > 2101 // ACEInitDll() function declaration. > 2102 //----------------------------------------------------------------------- > 2103 > 2104 INT __stdcall ACEInitDll(pACEInitDllStruc DllData); > 2105 > 2106 > 2107 //トトトトトトトトトトトトトトトトトトトトトトト ACEReadArchiveData トトトトトトトトトトトトトトトトトトトトトトトトトトトト > 2108 // Tests a file whether it is an archive or not and reads out the archive > 2109 // data. > 2110 //------------------------------------------------------------------------- > 2111 > 2112 //----------------------------------------------------------------------- > 2113 // ACEReadArchiveData() parameter structure. > 2114 //----------------------------------------------------------------------- > 2115 > 2116 typedef struct sACEReadArchiveDataStruc > 2117 { > 2118 pACEArchiveDataStruc // if this pointer is NULL, the > 2119 ArchiveData; // file passed to ACEReadArchiveData > 2120 // is no archive; otherwise it points > 2121 // to a tACEArchiveDataStruc structure > 2122 // that contains information about the > 2123 // archive > 2124 CHAR Reserved[64]; // has to be filled with zeroes > 2125 } tACEReadArchiveDataStruc, > 2126 *pACEReadArchiveDataStruc; > 2127 > 2128 > 2129 //----------------------------------------------------------------------- > 2130 // ACEReadArchiveData() function declaration. > 2131 //----------------------------------------------------------------------- > 2132 > 2133 INT __stdcall ACEReadArchiveData(LPSTR ArchiveName, > 2134 pACEReadArchiveDataStruc ArchiveData); > 2135 > 2136 > 2137 //トトトトトトトトトトトトトトトトトトトトトトトトトトトト ACEList トトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトト > 2138 // Passes the specified files in the archive to StateCallbackProc(). > 2139 //------------------------------------------------------------------------- > 2140 > 2141 //----------------------------------------------------------------------- > 2142 // ACEList() parameter structure. > 2143 //----------------------------------------------------------------------- > 2144 > 2145 typedef struct sACEListStruc > 2146 { > 2147 tACEFilesStruc // specifies files to be listed; > 2148 Files; // see tACEFilesStruc structure > 2149 CHAR Reserved[64]; // has to be filled with zeroes > 2150 } tACEListStruc, > 2151 *pACEListStruc; > 2152 > 2153 > 2154 //----------------------------------------------------------------------- > 2155 // ACEList() function declaration. > 2156 //----------------------------------------------------------------------- > 2157 > 2158 INT __stdcall ACEList(LPSTR ArchiveName, pACEListStruc List); > 2159 > 2160 > 2161 //トトトトトトトトトトトトトトトトトトトトトトトトトトトト ACETest トトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトト > 2162 // Tests specified files in archive. > 2163 //------------------------------------------------------------------------- > 2164 > 2165 //----------------------------------------------------------------------- > 2166 // ACETest() parameter structure. > 2167 //----------------------------------------------------------------------- > 2168 > 2169 typedef struct sACETestStruc > 2170 { > 2171 tACEFilesStruc // specifies files to test; > 2172 Files; // see tACEFilesStruc structure > 2173 LPSTR DecryptPassword; // zero-terminated string, > 2174 // case-sensitive (maxlen=56) > 2175 CHAR Reserved[64]; // has to be filled with zeroes > 2176 } tACETestStruc, > 2177 *pACETestStruc; > 2178 > 2179 > 2180 //----------------------------------------------------------------------- > 2181 // ACETest() function declaration. > 2182 //----------------------------------------------------------------------- > 2183 > 2184 INT __stdcall ACETest(LPSTR ArchiveName, pACETestStruc Test); > 2185 > 2186 > 2187 //トトトトトトトトトトトトトトトトトトトトトトトトトトト ACEExtract トトトトトトトトトトトトトトトトトトトトトトトトトトトトトトトト > 2188 // Extracts specified files. > 2189 //------------------------------------------------------------------------- > 2190 > 2191 //----------------------------------------------------------------------- > 2192 // ACEExtract() parameter structure. > 2193 //----------------------------------------------------------------------- > 2194 > 2195 typedef struct sACEExtractStruc > 2196 { > 2197 tACEFilesStruc // specifies files to extract; > 2198 Files; // see tACEFilesStruc structure > 2199 LPSTR DestinationDir; // directory to extract files to > 2200 BOOL ExcludePath; // extract files without path > 2201 LPSTR DecryptPassword; // password for decryption (if files > 2202 // are encrypted); > 2203 // zero-terminated string, > 2204 // case-sensitive (maxlen=56) > 2205 CHAR Reserved[64]; // has to be filled with zeroes > 2206 } tACEExtractStruc, > 2207 *pACEExtractStruc; > 2208 > 2209 > 2210 //----------------------------------------------------------------------- > 2211 // ACEExtract() function declaration. > 2212 //----------------------------------------------------------------------- > 2213 > 2214 INT __stdcall ACEExtract(LPSTR ArchiveName, > 2215 pACEExtractStruc Extract); > 2216 > 2217 > 2218 #ifdef __cplusplus > 2219 } > 2220 #endif > 2221 #endif > 2222

Added uninst/StdAfx.cpp version [9e5388a0a29da425]

> 1 // stdafx.cpp : 標準インクルードファイルを含むソース ファイル > 2 // kinst.pch 生成されるプリコンパイル済ヘッダー > 3 // stdafx.obj 生成されるプリコンパイル済タイプ情報 > 4 > 5 #include "stdafx.h" > 6 > 7 // TODO: STDAFX.H に含まれていて、このファイルに記述されていない > 8 // ヘッダーファイルを追加してください。

Added uninst/StdAfx.h version [8794fb8b22c7b701]

> 1 // stdafx.h : frequently used headers > 2 > 3 #ifndef AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_ > 4 #define AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_ > 5 > 6 // windows general header > 7 #undef WINVER > 8 #define WINVER 0x0400 > 9 #include <windows.h> > 10 > 11 // shell header > 12 #undef _WIN32_IE > 13 #define _WIN32_IE 0x0200 > 14 #include <shlobj.h> > 15 > 16 #endif

Added uninst/del.ico version [a5746f6223d32e37]

cannot compute difference between binary files

Added uninst/kinst.cpp version [683230bf72bb28e0]

> 1 > 2 #include "stdafx.h" > 3 #include "../kilib/kilib.h" > 4 #include "resource.h" > 5 > 6 > 7 //-- 雑用Functions ---------------------------------------------------------- > 8 > 9 void getProgramFiles( kiPath* path ) > 10 { > 11 // 1.レジストリから > 12 kiRegKey key; > 13 if( key.open( HKEY_CLASSES_ROOT, "Software\\Microsoft\\Windows\\CurrentV > 14 if( key.get( "ProgramFilesDir", path ) > 15 || key.get( "ProgramFilesPath", path ) ) > 16 return; > 17 > 18 // 2.Windowsディレクトリからの類推 > 19 char buf[MAX_PATH]; > 20 if( ::GetWindowsDirectory( buf, MAX_PATH ) ) > 21 { > 22 for( char* p=buf; *p!='\\' && *p; p++ ); > 23 *p='\0'; > 24 > 25 *path= buf, *path += '\\', *path += "Program Files"; > 26 if( ::GetFileAttributes( *path ) != 0xffffffff ) > 27 return; > 28 } > 29 > 30 // 3.しゃーないので起動ディレクトリ > 31 path->beSpecialPath( kiPath::Exe ); > 32 } > 33 > 34 void createShortCut( const kiPath& original, const kiPath& at, const char* name > 35 { > 36 IShellLink* psl; > 37 if( SUCCEEDED(::CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SE > 38 { > 39 psl->SetPath( original ); > 40 > 41 IPersistFile* ppf; > 42 if( SUCCEEDED(psl->QueryInterface(IID_IPersistFile,(void**)&ppf) > 43 { > 44 WORD wsz[MAX_PATH]; > 45 kiPath lnkfile( at ); > 46 lnkfile += name, lnkfile += ".lnk"; > 47 ::MultiByteToWideChar(CP_ACP,0,lnkfile,-1,wsz,MAX_PATH); > 48 ppf->Save(wsz,TRUE); > 49 ppf->Release(); > 50 } > 51 psl->Release(); > 52 } > 53 } > 54 > 55 > 56 //-- メイン ------------------------------------------------------------------- > 57 > 58 class CKInstApp : public kiApp, kiDialog // kiAppのコンストラクタが先に呼ばれな「と死ぬ。よろしくない。 > 59 { > 60 CKInstApp() : kiDialog( IDD_MAIN ) {} > 61 friend void kilib_create_new_app(); > 62 > 63 //-- メインルーチン --------- > 64 > 65 void run( kiCmdParser& cmd ) > 66 { > 67 if( cmd.option().len() ) > 68 if( cmd.option()[0][1] == 'i' ) > 69 { > 70 install(); > 71 return; > 72 } > 73 else if( cmd.option()[0][1] == 'u' && cmd.param().len() > 74 { > 75 uninstall( cmd.param()[0] ); > 76 return; > 77 } > 78 boot_uninstaller(); > 79 } > 80 > 81 void install() > 82 { > 83 doModal(); > 84 if( IDCANCEL == getEndCode() ) > 85 return; > 86 > 87 if( !copy() ) > 88 { > 89 msgBox( kiStr().loadRsrc(IDS_COPYFAIL) ); > 90 return; > 91 } > 92 > 93 if( !regist() ) > 94 msgBox( kiStr().loadRsrc(IDS_REGISTFAIL) ); > 95 > 96 do_caldix(); > 97 > 98 msgBox( kiStr().loadRsrc(IDS_INSTALLFINISH),"Noah",MB_OK|MB_ICON > 99 } > 100 > 101 void uninstall( const char* dir ) > 102 { > 103 m_destdir = dir; > 104 for( int i=0; i!=sizeof(m_assoc)/sizeof(bool); i++ ) > 105 m_assoc[i]=false; > 106 Sleep(200); > 107 unregist(); > 108 remove(); > 109 kill_later( kiPath(kiPath::Exe_name) ); > 110 msgBox( kiStr().loadRsrc(IDS_UNINSTALLFINISH),"Noah",MB_OK|MB_IC > 111 } > 112 > 113 void boot_uninstaller() > 114 { > 115 if( IDNO==msgBox( kiStr(500).loadRsrc(IDS_UNINSTOK), "Noah", MB_ > 116 return; > 117 > 118 kiPath self(kiPath::Exe_name), to(kiPath::Tmp), pos(kiPath::Exe) > 119 to += "noaunins.exe"; > 120 ::CopyFile( self, to, FALSE ); > 121 to += " -u \"", to += pos, to+='"'; > 122 > 123 PROCESS_INFORMATION pi; > 124 STARTUPINFO si; ki_memzero( &si,sizeof(si) ); si.cb=sizeof(si); > 125 if( !::CreateProcess( NULL,const_cast<char*>((const char*)to), > 126 NULL,NULL,FALSE,CREATE_NEW_PROCESS_GROUP|NORMAL_PRIORITY > 127 return; // 起動できなかった…。 > 128 > 129 ::CloseHandle( pi.hThread ); > 130 ::CloseHandle( pi.hProcess ); > 131 > 132 // レジストリのアンインストール情報削除 > 133 kiRegKey key; > 134 if( key.open( HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\ > 135 key.delSubKey( "Noah" ); > 136 } > 137 > 138 //-- メインダイアログの処理 -- > 139 > 140 bool onOK() > 141 { > 142 char str[MAX_PATH]; > 143 sendMsgToItem( IDC_INSTALLTO, WM_GETTEXT, MAX_PATH, (LPARAM)str > 144 if( str[1]!=':' || str[2]!='\\' ) > 145 { > 146 msgBox( kiStr().loadRsrc(IDS_BADPATH) ); > 147 return false; > 148 } > 149 > 150 m_destdir = str; > 151 m_destdir.beBackSlash(true); > 152 for( UINT i=IDC_LZH; i<=IDC_DSK; i++ ) > 153 m_assoc[i-IDC_LZH] = (BST_CHECKED==sendMsgToItem( i, BM_ > 154 m_assoc[IDC_STT-IDC_LZH] = true; > 155 > 156 return true; > 157 } > 158 BOOL onInit() > 159 { > 160 for( int j=0; j<18; j++ ) > 161 m_assoc[j] = true; > 162 > 163 kiPath prg; > 164 getPrevPos( &prg ); > 165 if( prg.len()==0 ) // 新規インストール > 166 getProgramFiles( &prg ), prg.beBackSlash(true), prg += " > 167 else // 既に存在してる場合 > 168 { > 169 HINSTANCE hDLL = kiSUtil::loadLibrary( "NoahXt.dll" ); > 170 if( hDLL ) > 171 { > 172 typedef bool (WINAPI * XT_IA)(); > 173 XT_IA Init = (XT_IA)::GetProcAddress( hDLL, "Ini > 174 if( Init() ) > 175 { > 176 typedef void (WINAPI * XT_LS)(bool*,bool > 177 typedef void (WINAPI * XT_AS)(bool*); > 178 typedef void (WINAPI * XT_LSEX)(const ch > 179 XT_LS LoadSE = (XT_LS)::GetProcAddres > 180 XT_AS LoadAssoc = (XT_AS)::GetProcAddres > 181 XT_LSEX LoadASEx = (XT_LSEX)::GetProcAdd > 182 LoadSE( &m_assoc[13], &m_assoc[14] ); > 183 LoadASEx( "7z\0", &m_assoc[12] ); > 184 LoadAssoc( m_assoc ); > 185 } > 186 ::FreeLibrary( hDLL ); > 187 } > 188 m_assoc[15] = kiSUtil::exist( kiPath(kiPath::Snd)+="Noah > 189 m_assoc[16] = kiSUtil::exist( kiPath(kiPath::Dsk)+="Noah > 190 } > 191 > 192 sendMsgToItem( IDC_INSTALLTO, WM_SETTEXT, 0, (LPARAM)(const char > 193 for( UINT i=IDC_LZH; i<=IDC_DSK; i++ ) > 194 if( m_assoc[i-IDC_LZH] ) > 195 sendMsgToItem( i, BM_SETCHECK, BST_CHECKED ); > 196 return FALSE; > 197 } > 198 BOOL CALLBACK proc( UINT msg, WPARAM wp, LPARAM lp ) > 199 { > 200 if( msg != WM_COMMAND ) > 201 return FALSE; > 202 switch( LOWORD(wp) ) > 203 { > 204 case IDC_REF:{ > 205 char str[MAX_PATH]; > 206 sendMsgToItem( IDC_INSTALLTO, WM_GETTEXT, MAX_PATH, (LPA > 207 if( kiSUtil::getFolderDlg( str, hwnd(), kiStr().loadRsrc > 208 { > 209 kiPath x(str); x.beBackSlash(true); x+="Noah\\"; > 210 sendMsgToItem( IDC_INSTALLTO, WM_SETTEXT, 0, (LP > 211 } > 212 }break; > 213 case IDC_ALL:{ > 214 for( UINT i=IDC_LZH; i<=IDC_DSK; i++ ) > 215 sendMsgToItem( i, BM_SETCHECK, BST_UNCHECKED ); > 216 }break; > 217 default: > 218 return FALSE; > 219 } > 220 return TRUE; > 221 } > 222 > 223 //-- インストール --------- > 224 > 225 bool m_assoc[18]; // LZH-JAK, 7Z, CMP MLT, SND DSK STT > 226 kiPath m_destdir; > 227 > 228 bool copy() > 229 { > 230 kiPath exe(kiPath::Exe,false), inst(m_destdir); > 231 inst.beBackSlash(false); > 232 > 233 // とりあえず全コピ > 234 bool r = copy_dir2dir(exe,inst); > 235 > 236 // manualの言語をてけとーに調整 > 237 kiPath manE(m_destdir), manJ(m_destdir); > 238 manE.beBackSlash(true), manJ.beBackSlash(true); > 239 manE += "manual-e.htm", manJ += "manual.htm"; > 240 if( ::GetACP() != 932 ) > 241 ::CopyFile( manE, manJ, FALSE ); > 242 ::DeleteFile( manE ); > 243 > 244 return r; > 245 } > 246 > 247 bool regist() > 248 { > 249 // NoahXt.dllによる処理 > 250 kiPath xtdll( m_destdir ); > 251 xtdll += "NoahXt.dll"; > 252 HINSTANCE hDLL = kiSUtil::loadLibrary( xtdll ); > 253 if( hDLL ) > 254 { > 255 typedef bool (WINAPI * XT_IA)(); > 256 typedef void (WINAPI * XT_LS)(bool*,bool*); > 257 typedef void (WINAPI * XT_SS)(bool,bool); > 258 typedef void (WINAPI * XT_AS)(bool*); > 259 typedef void (WINAPI * XT_SSEX)(const char*,bool); > 260 XT_IA Init = (XT_IA)::GetProcAddress( hDLL, "Init" ); > 261 if( Init() ) > 262 { > 263 XT_SS SaveSE = (XT_SS)::GetProcAddress( hDLL, "S > 264 XT_AS SaveAssoc = (XT_AS)::GetProcAddress( hDLL, > 265 XT_SSEX SaveASEx = (XT_SSEX)::GetProcAddress( hD > 266 SaveSE( m_assoc[13], m_assoc[14] ); > 267 SaveASEx( "7z\0", m_assoc[12] ); > 268 SaveAssoc( m_assoc ); > 269 } > 270 ::FreeLibrary( hDLL ); > 271 } > 272 > 273 // ショートカット > 274 ::CoInitialize( NULL ); > 275 kiPath tmp(m_destdir); tmp += "Noah.exe"; > 276 if( m_assoc[15] ) > 277 createShortCut( tmp, kiPath(kiPath::Snd), "Noah" > 278 if( m_assoc[16] ) > 279 createShortCut( tmp, kiPath(kiPath::Dsk), "Noah" > 280 if( m_assoc[17] ) > 281 { > 282 kiPath StartMenu( CSIDL_PROGRAMS ),rsrc; > 283 StartMenu += "Noah\\"; > 284 StartMenu.mkdir(); > 285 > 286 createShortCut( tmp, StartMenu, "Noah" ); > 287 tmp = m_destdir, tmp += "caldix.exe"; > 288 createShortCut( tmp, StartMenu, rsrc.loadRsrc(ID > 289 tmp = m_destdir, tmp += "manual.htm"; > 290 createShortCut( tmp, StartMenu, rsrc.loadRsrc(ID > 291 tmp = m_destdir, tmp += "uninst.exe"; > 292 createShortCut( tmp, StartMenu, rsrc.loadRsrc(ID > 293 } > 294 ::CoUninitialize(); > 295 > 296 // アンインストール情報をレジストリへ > 297 kiPath uninst( m_destdir ); > 298 uninst += "uninst.exe"; > 299 > 300 kiRegKey key; > 301 if( !key.create( HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windo > 302 return false; > 303 key.set( "DisplayName", kiStr().loadRsrc(IDS_NOAH) ); > 304 key.set( "UninstallString", uninst ); > 305 return true; > 306 } > 307 > 308 void do_caldix() > 309 { > 310 if( IDYES==msgBox( kiStr(1000).loadRsrc(IDS_DLLINST),"Noah",MB_Y > 311 { > 312 kiStr cld; > 313 cld += '"'; > 314 cld += m_destdir; > 315 cld += "caldix.exe"; > 316 cld += '"'; > 317 > 318 // プロセス開始 > 319 PROCESS_INFORMATION pi; > 320 STARTUPINFO si; ki_memzero( &si,sizeof(si) ); si.cb=size > 321 if( !::CreateProcess( NULL,const_cast<char*>((const char > 322 NULL,NULL,FALSE,CREATE_NEW_PROCESS_GROUP|NORMAL_ > 323 return; > 324 > 325 // 終了待機 > 326 ::CloseHandle( pi.hThread ); > 327 ::WaitForSingleObject( pi.hProcess, INFINITE ); > 328 ::CloseHandle( pi.hProcess ); > 329 } > 330 } > 331 > 332 bool copy_dir2dir( kiPath& from, kiPath& to ) > 333 { > 334 if( !kiSUtil::isdir(from) ) > 335 { > 336 if( ::CopyFile( from, to, FALSE ) ) > 337 return true; > 338 if( 0==ki_strcmpi( from.ext(), "dll" ) ) > 339 return copy_later(from, to); > 340 return false; > 341 } > 342 > 343 from += '\\', to += '\\', to.mkdir(); > 344 if( !kiSUtil::isdir(to) ) > 345 return false; > 346 > 347 kiFindFile find; > 348 WIN32_FIND_DATA fd; > 349 kiPath src, dst, wild(from); wild+="\\*"; > 350 for( find.begin( wild ); find.next(&fd); ) > 351 { > 352 src = from, src+='\\', src += fd.cFileName; > 353 dst = to , dst+='\\', dst += fd.cFileName; > 354 if( !copy_dir2dir( src, dst ) ) > 355 return false; > 356 } > 357 return true; > 358 } > 359 > 360 void getPrevPos( kiPath* path ) > 361 { > 362 *path = ""; > 363 > 364 kiRegKey key; > 365 if( !key.open( HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows > 366 return; > 367 key.get( "UninstallString", path ); > 368 path->beDirOnly(); > 369 } > 370 > 371 //-- アンインストール --------- > 372 > 373 typedef bool (WINAPI * XT_IA)(); > 374 typedef void (WINAPI * XT_LS)(bool*,bool*); > 375 typedef void (WINAPI * XT_SS)(bool,bool); > 376 typedef void (WINAPI * XT_AS)(bool*); > 377 typedef void (WINAPI * XT_SAX)(const char*,bool); > 378 typedef void (WINAPI * XT_LAX)(const char*,bool*); > 379 bool unregist() > 380 { > 381 // NoahXt.dllによる処理 > 382 kiPath xtdll( m_destdir ); > 383 xtdll += "NoahXt.dll"; > 384 HINSTANCE hDLL = kiSUtil::loadLibrary( xtdll ); > 385 if( hDLL ) > 386 { > 387 XT_IA Init = (XT_IA)::GetProcAddress( hDLL, "Init" ); > 388 if( Init() ) > 389 { > 390 XT_SAX SaveASEx = (XT_SAX)::GetProcAddress( hDLL > 391 XT_LAX LoadASEx = (XT_LAX)::GetProcAddress( hDLL > 392 unregist_b2e( SaveASEx, LoadASEx ); > 393 > 394 XT_SS SaveSE = (XT_SS)::GetProcAddress( hDLL, "S > 395 XT_AS SaveAssoc = (XT_AS)::GetProcAddress( hDLL, > 396 SaveSE( m_assoc[13], m_assoc[14] ); > 397 SaveAssoc( m_assoc ); > 398 } > 399 ::FreeLibrary( hDLL ); > 400 } > 401 > 402 // ショートカット > 403 ::CoInitialize( NULL ); > 404 kiPath snd(kiPath::Snd); snd += "Noah.lnk"; > 405 kiPath dsk(kiPath::Dsk); dsk += "Noah.lnk"; > 406 kiPath stt(CSIDL_PROGRAMS); stt += "Noah"; > 407 ::DeleteFile(snd), ::DeleteFile(dsk), stt.remove(); > 408 > 409 return true; > 410 } > 411 > 412 static void crack_str( char* p ) > 413 { > 414 for( ; *p; p=kiStr::next(p) ) > 415 if( *p=='.' ) > 416 *p++ = '\0'; > 417 *++p = '\0'; > 418 } > 419 > 420 void unregist_b2e( XT_SAX SaveASEx, XT_LAX LoadASEx ) > 421 { > 422 char* first_dot; > 423 kiFindFile f; > 424 WIN32_FIND_DATA fd; > 425 kiPath b2ewild(m_destdir); > 426 b2ewild.beBackSlash(true); > 427 > 428 f.begin( b2ewild+="b2e\\*.b2e" ); > 429 while( f.next(&fd) ) > 430 if( fd.cFileName[0] != '#' ) // # 付きは圧縮専用 > 431 { > 432 // 拡張子を切り出し > 433 ::CharLower( fd.cFileName ); > 434 first_dot = const_cast<char*>(kiPath::ext_all(fd > 435 *first_dot = '\0'; > 436 crack_str( fd.cFileName ); > 437 // 関連づけ削除 > 438 SaveASEx( fd.cFileName, false ); > 439 } > 440 SaveASEx( "7z\0", false ); > 441 } > 442 > 443 bool remove() > 444 { > 445 ::SetCurrentDirectory( kiPath(kiPath::Exe) ); > 446 > 447 kiPath tmp; > 448 m_destdir.beBackSlash(true); > 449 // インストールしたモノだけ全削除 > 450 tmp=m_destdir, tmp+="Noah.exe", ::DeleteFile(tmp); > 451 tmp=m_destdir, tmp+="Noah.ini", ::DeleteFile(tmp); > 452 tmp=m_destdir, tmp+="uninst.exe", ::DeleteFile(tmp); > 453 tmp=m_destdir, tmp+="caldix.exe", ::DeleteFile(tmp); > 454 tmp=m_destdir, tmp+="caldix.ini", ::DeleteFile(tmp); > 455 tmp=m_destdir, tmp+="ReadMe.txt", ::DeleteFile(tmp); > 456 tmp=m_destdir, tmp+="manual.htm", ::DeleteFile(tmp); > 457 tmp=m_destdir, tmp+="html", tmp.remove(); > 458 tmp=m_destdir, tmp+="b2e\\jak.b2e", ::DeleteFile(tmp); > 459 tmp=m_destdir, tmp+="b2e\\aboutb2e.txt",::DeleteFile(tmp); > 460 tmp=m_destdir, tmp+="b2e", ::RemoveDirectory(tmp); > 461 tmp=m_destdir, tmp+="NoahXt.dll", ::DeleteFile(tmp); > 462 ::RemoveDirectory(m_destdir); > 463 // NoahXt.dllは再起動後に回すかも知れない > 464 if( kiSUtil::exist(tmp) ) > 465 { > 466 kill_later(tmp); > 467 tmp.beDirOnly(); > 468 tmp.beBackSlash(false); > 469 kill_later(tmp); > 470 } > 471 > 472 return true; > 473 } > 474 > 475 void kill_later( const char* pszFile ) > 476 { > 477 // "MoveFileEx Not Supported in Windows 95 But Functionality Is" > 478 if( ::MoveFileEx( pszFile, NULL, MOVEFILE_DELAY_UNTIL_REBOOT ) ) > 479 return; > 480 char shortPath[MAX_PATH]; > 481 ::GetShortPathName( pszFile, shortPath, sizeof(shortPath) ); > 482 > 483 kiPath inifile( kiPath::Win ); inifile+="wininit.ini"; > 484 > 485 char buf[30000]; > 486 ::GetPrivateProfileSection( "Rename", buf, 30000, inifile ); > 487 char* p = buf; > 488 while(*p)while(*p++); > 489 > 490 ::lstrcpy( p, "NUL=" ); > 491 ::lstrcat( p, shortPath ); > 492 while(*p++); > 493 *p='\0'; > 494 > 495 ::WritePrivateProfileSection( "Rename", buf, inifile ); > 496 > 497 // 確実に書き込む > 498 ::WritePrivateProfileString( NULL, NULL, NULL, inifile ); > 499 } > 500 > 501 bool copy_later( const char* from, const char* to ) > 502 { > 503 char from_temp[MAX_PATH]; > 504 ::lstrcpy( from_temp, to ); > 505 ::lstrcat( from_temp, ".new" ); > 506 if( !::CopyFile( from, from_temp, FALSE ) ) > 507 return false; > 508 > 509 char shortFrom[MAX_PATH]; > 510 ::GetShortPathName( from_temp, shortFrom, sizeof(shortFrom) ); > 511 char shortTo[MAX_PATH]; > 512 ::GetShortPathName( to, shortTo, sizeof(shortTo) ); > 513 kiPath inifile( kiPath::Win ); inifile+="wininit.ini"; > 514 > 515 char buf[30000]; > 516 ::GetPrivateProfileSection( "Rename", buf, 30000, inifile ); > 517 char* p = buf; > 518 while(*p)while(*p++); > 519 > 520 ::lstrcpy( p, "NUL=" ); > 521 ::lstrcat( p, shortTo ); > 522 while(*p++); > 523 *p++='\r',*p++='\n'; > 524 ::lstrcpy( p, shortTo ); > 525 ::lstrcat( p, "=" ); > 526 ::lstrcat( p, shortFrom ); > 527 while(*p++); > 528 *p='\0'; > 529 > 530 ::WritePrivateProfileSection( "Rename", buf, inifile ); > 531 > 532 // 確実に書き込む > 533 ::WritePrivateProfileString( NULL, NULL, NULL, inifile ); > 534 return true; > 535 } > 536 }; > 537 > 538 void kilib_create_new_app() > 539 { > 540 new CKInstApp; > 541 }

Added uninst/kinst.dsp version [bbc78b6a1b23b544]

> 1 # Microsoft Developer Studio Project File - Name="kinst" - Package Owner=<4> > 2 # Microsoft Developer Studio Generated Build File, Format Version 6.00 > 3 # ** 編集しないでください ** > 4 > 5 # TARGTYPE "Win32 (x86) Application" 0x0101 > 6 > 7 CFG=kinst - Win32 Debug > 8 !MESSAGE これは有効なメイクファイルではありません。 このプロジェクトをビルドするためには NMAKE を使用してください。 > 9 !MESSAGE [メイクファイルのエクスポート] コマンドを使用して実行してください > 10 !MESSAGE > 11 !MESSAGE NMAKE /f "kinst.mak". > 12 !MESSAGE > 13 !MESSAGE NMAKE の実行時に構成を指定できます > 14 !MESSAGE コマンド ライン上でマクロの設定を定義します。例: > 15 !MESSAGE > 16 !MESSAGE NMAKE /f "kinst.mak" CFG="kinst - Win32 Debug" > 17 !MESSAGE > 18 !MESSAGE 選択可能なビルド モード: > 19 !MESSAGE > 20 !MESSAGE "kinst - Win32 Release" ("Win32 (x86) Application" 用) > 21 !MESSAGE "kinst - Win32 Debug" ("Win32 (x86) Application" 用) > 22 !MESSAGE > 23 > 24 # Begin Project > 25 # PROP AllowPerConfigDependencies 0 > 26 # PROP Scc_ProjName "kinst" > 27 # PROP Scc_LocalPath ".." > 28 CPP=cl.exe > 29 MTL=midl.exe > 30 RSC=rc.exe > 31 > 32 !IF "$(CFG)" == "kinst - Win32 Release" > 33 > 34 # PROP BASE Use_MFC 0 > 35 # PROP BASE Use_Debug_Libraries 0 > 36 # PROP BASE Output_Dir "Release" > 37 # PROP BASE Intermediate_Dir "Release" > 38 # PROP BASE Target_Dir "" > 39 # PROP Use_MFC 0 > 40 # PROP Use_Debug_Libraries 0 > 41 # PROP Output_Dir "../tmp/relui" > 42 # PROP Intermediate_Dir "../tmp/relui" > 43 # PROP Ignore_Export_Lib 0 > 44 # PROP Target_Dir "" > 45 # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBC > 46 # ADD CPP /nologo /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /Yu"st > 47 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 > 48 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 > 49 # ADD BASE RSC /l 0x411 /d "NDEBUG" > 50 # ADD RSC /l 0x411 /d "NDEBUG" > 51 BSC32=bscmake.exe > 52 # ADD BASE BSC32 /nologo > 53 # ADD BSC32 /nologo > 54 LINK32=link.exe > 55 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib ad > 56 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi3 > 57 # SUBTRACT LINK32 /pdb:none > 58 > 59 !ELSEIF "$(CFG)" == "kinst - Win32 Debug" > 60 > 61 # PROP BASE Use_MFC 0 > 62 # PROP BASE Use_Debug_Libraries 1 > 63 # PROP BASE Output_Dir "Debug" > 64 # PROP BASE Intermediate_Dir "Debug" > 65 # PROP BASE Target_Dir "" > 66 # PROP Use_MFC 0 > 67 # PROP Use_Debug_Libraries 1 > 68 # PROP Output_Dir "../tmp/dbgui" > 69 # PROP Intermediate_Dir "../tmp/dbgui" > 70 # PROP Ignore_Export_Lib 0 > 71 # PROP Target_Dir "" > 72 # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" > 73 # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_ > 74 # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 > 75 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 > 76 # ADD BASE RSC /l 0x411 /d "_DEBUG" > 77 # ADD RSC /l 0x411 /d "_DEBUG" > 78 BSC32=bscmake.exe > 79 # ADD BASE BSC32 /nologo > 80 # ADD BSC32 /nologo > 81 LINK32=link.exe > 82 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib ad > 83 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi3 > 84 > 85 !ENDIF > 86 > 87 # Begin Target > 88 > 89 # Name "kinst - Win32 Release" > 90 # Name "kinst - Win32 Debug" > 91 # Begin Group "Source Files" > 92 > 93 # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" > 94 # Begin Source File > 95 > 96 SOURCE=.\kinst.cpp > 97 # End Source File > 98 # Begin Source File > 99 > 100 SOURCE=.\kinst.rc > 101 # End Source File > 102 # Begin Source File > 103 > 104 SOURCE=.\StdAfx.cpp > 105 # ADD CPP /Yc"stdafx.h" > 106 # End Source File > 107 # End Group > 108 # Begin Group "Header Files" > 109 > 110 # PROP Default_Filter "h;hpp;hxx;hm;inl" > 111 # Begin Source File > 112 > 113 SOURCE=.\resource.h > 114 # End Source File > 115 # Begin Source File > 116 > 117 SOURCE=.\StdAfx.h > 118 # End Source File > 119 # End Group > 120 # Begin Group "Resource Files" > 121 > 122 # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" > 123 # Begin Source File > 124 > 125 SOURCE=.\del.ico > 126 # End Source File > 127 # Begin Source File > 128 > 129 SOURCE=..\noah.ico > 130 # End Source File > 131 # Begin Source File > 132 > 133 SOURCE=.\noah.ico > 134 # End Source File > 135 # Begin Source File > 136 > 137 SOURCE=.\real.ico > 138 # End Source File > 139 # End Group > 140 # Begin Group "kilib" > 141 > 142 # PROP Default_Filter "" > 143 # Begin Source File > 144 > 145 SOURCE=..\kilib\kilib.h > 146 # End Source File > 147 # Begin Source File > 148 > 149 SOURCE=..\kilib\kilibext.h > 150 # End Source File > 151 # Begin Source File > 152 > 153 SOURCE=..\kilib\kl_app.cpp > 154 # End Source File > 155 # Begin Source File > 156 > 157 SOURCE=..\kilib\kl_app.h > 158 # End Source File > 159 # Begin Source File > 160 > 161 SOURCE=..\kilib\kl_carc.cpp > 162 # End Source File > 163 # Begin Source File > 164 > 165 SOURCE=..\kilib\kl_carc.h > 166 # End Source File > 167 # Begin Source File > 168 > 169 SOURCE=..\kilib\kl_cmd.cpp > 170 # End Source File > 171 # Begin Source File > 172 > 173 SOURCE=..\kilib\kl_cmd.h > 174 # End Source File > 175 # Begin Source File > 176 > 177 SOURCE=..\kilib\kl_dnd.cpp > 178 # End Source File > 179 # Begin Source File > 180 > 181 SOURCE=..\kilib\kl_dnd.h > 182 # End Source File > 183 # Begin Source File > 184 > 185 SOURCE=..\kilib\kl_file.cpp > 186 # End Source File > 187 # Begin Source File > 188 > 189 SOURCE=..\kilib\kl_file.h > 190 # End Source File > 191 # Begin Source File > 192 > 193 SOURCE=..\kilib\kl_find.cpp > 194 # End Source File > 195 # Begin Source File > 196 > 197 SOURCE=..\kilib\kl_find.h > 198 # End Source File > 199 # Begin Source File > 200 > 201 SOURCE=..\kilib\kl_misc.h > 202 # End Source File > 203 # Begin Source File > 204 > 205 SOURCE=..\kilib\kl_reg.cpp > 206 # End Source File > 207 # Begin Source File > 208 > 209 SOURCE=..\kilib\kl_reg.h > 210 # End Source File > 211 # Begin Source File > 212 > 213 SOURCE=..\kilib\kl_rythp.cpp > 214 # End Source File > 215 # Begin Source File > 216 > 217 SOURCE=..\kilib\kl_rythp.h > 218 # End Source File > 219 # Begin Source File > 220 > 221 SOURCE=..\kilib\kl_str.cpp > 222 # End Source File > 223 # Begin Source File > 224 > 225 SOURCE=..\kilib\kl_str.h > 226 # End Source File > 227 # Begin Source File > 228 > 229 SOURCE=..\kilib\kl_wcmn.cpp > 230 # End Source File > 231 # Begin Source File > 232 > 233 SOURCE=..\kilib\kl_wcmn.h > 234 # End Source File > 235 # Begin Source File > 236 > 237 SOURCE=..\kilib\kl_wnd.cpp > 238 # End Source File > 239 # Begin Source File > 240 > 241 SOURCE=..\kilib\kl_wnd.h > 242 # End Source File > 243 # End Group > 244 # End Target > 245 # End Project

Added uninst/kinst.plg version [53de5328b4b3ff47]

> 1 <html> > 2 <body> > 3 <pre> > 4 <h1>ビルドのログ</h1> > 5 <h3> > 6 --------------------構成: kinst - Win32 Release-------------------- > 7 </h3> > 8 <h3>コマンド ライン</h3> > 9 Creating command line "rc.exe /l 0x411 /fo"../tmp/relui/kinst.res" /d "NDEBUG" " > 10 一時ファイル "C:\Users\kinaba\AppData\Local\Temp\RSP8E45.tmp" を作成し、次の内容を記録します > 11 [ > 12 /nologo /ML /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /Fp"../tmp/r > 13 "C:\Develop\Projects\Noah\uninst\kinst.cpp" > 14 "C:\Develop\Projects\Noah\kilib\kl_app.cpp" > 15 "C:\Develop\Projects\Noah\kilib\kl_carc.cpp" > 16 "C:\Develop\Projects\Noah\kilib\kl_cmd.cpp" > 17 "C:\Develop\Projects\Noah\kilib\kl_dnd.cpp" > 18 "C:\Develop\Projects\Noah\kilib\kl_file.cpp" > 19 "C:\Develop\Projects\Noah\kilib\kl_find.cpp" > 20 "C:\Develop\Projects\Noah\kilib\kl_reg.cpp" > 21 "C:\Develop\Projects\Noah\kilib\kl_rythp.cpp" > 22 "C:\Develop\Projects\Noah\kilib\kl_str.cpp" > 23 "C:\Develop\Projects\Noah\kilib\kl_wcmn.cpp" > 24 "C:\Develop\Projects\Noah\kilib\kl_wnd.cpp" > 25 ] > 26 Creating command line "cl.exe @C:\Users\kinaba\AppData\Local\Temp\RSP8E45.tmp" > 27 一時ファイル "C:\Users\kinaba\AppData\Local\Temp\RSP8E46.tmp" を作成し、次の内容を記録します > 28 [ > 29 /nologo /ML /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /Fp"../tmp/r > 30 "C:\Develop\Projects\Noah\uninst\StdAfx.cpp" > 31 ] > 32 Creating command line "cl.exe @C:\Users\kinaba\AppData\Local\Temp\RSP8E46.tmp" > 33 一時ファイル "C:\Users\kinaba\AppData\Local\Temp\RSP8E57.tmp" を作成し、次の内容を記録します > 34 [ > 35 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32 > 36 \Develop\Projects\Noah\tmp\relui\kinst.obj > 37 \Develop\Projects\Noah\tmp\relui\StdAfx.obj > 38 \Develop\Projects\Noah\tmp\relui\kl_app.obj > 39 \Develop\Projects\Noah\tmp\relui\kl_carc.obj > 40 \Develop\Projects\Noah\tmp\relui\kl_cmd.obj > 41 \Develop\Projects\Noah\tmp\relui\kl_dnd.obj > 42 \Develop\Projects\Noah\tmp\relui\kl_file.obj > 43 \Develop\Projects\Noah\tmp\relui\kl_find.obj > 44 \Develop\Projects\Noah\tmp\relui\kl_reg.obj > 45 \Develop\Projects\Noah\tmp\relui\kl_rythp.obj > 46 \Develop\Projects\Noah\tmp\relui\kl_str.obj > 47 \Develop\Projects\Noah\tmp\relui\kl_wcmn.obj > 48 \Develop\Projects\Noah\tmp\relui\kl_wnd.obj > 49 \Develop\Projects\Noah\tmp\relui\kinst.res > 50 ] > 51 コマンド ライン "link.exe @C:\Users\kinaba\AppData\Local\Temp\RSP8E57.tmp" の作成中 > 52 <h3>アウトプット ウィンドウ</h3> > 53 リソースをコンパイル中... > 54 コンパイル中... > 55 StdAfx.cpp > 56 コンパイル中... > 57 kinst.cpp > 58 kl_app.cpp > 59 kl_carc.cpp > 60 kl_cmd.cpp > 61 kl_dnd.cpp > 62 kl_file.cpp > 63 kl_find.cpp > 64 kl_reg.cpp > 65 kl_rythp.cpp > 66 kl_str.cpp > 67 kl_wcmn.cpp > 68 kl_wnd.cpp > 69 コードを生成中... > 70 リンク中... > 71 > 72 > 73 > 74 <h3>結果</h3> > 75 uninst.exe - エラー 0、警告 0 > 76 </pre> > 77 </body> > 78 </html>

Added uninst/kinst.rc version [e476e025a2369adb]

> 1 //Microsoft Developer Studio generated resource script. > 2 // > 3 #include "resource.h" > 4 > 5 #define APSTUDIO_READONLY_SYMBOLS > 6 ///////////////////////////////////////////////////////////////////////////// > 7 // > 8 // Generated from the TEXTINCLUDE 2 resource. > 9 // > 10 #include "afxres.h" > 11 > 12 ///////////////////////////////////////////////////////////////////////////// > 13 #undef APSTUDIO_READONLY_SYMBOLS > 14 > 15 ///////////////////////////////////////////////////////////////////////////// > 16 // 日本語 resources > 17 > 18 #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_JPN) > 19 #ifdef _WIN32 > 20 LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT > 21 #pragma code_page(932) > 22 #endif //_WIN32 > 23 > 24 ///////////////////////////////////////////////////////////////////////////// > 25 // > 26 // Dialog > 27 // > 28 > 29 IDD_MAIN DIALOG DISCARDABLE 0, 0, 283, 195 > 30 STYLE DS_ABSALIGN | DS_MODALFRAME | DS_SETFOREGROUND | DS_CENTER | WS_POPUP | > 31 WS_CAPTION | WS_SYSMENU > 32 CAPTION "圧縮解凍ソフト「Noah」のインストール" > 33 FONT 9, "MS Pゴシック" > 34 BEGIN > 35 ICON IDI_NOAH,IDC_STATIC,7,9,20,20,SS_REALSIZEIMAGE > 36 LTEXT " Noahのご利用ありがとうございます。\n「開始」ボタンを押すニ、Noahをこのコンピュータへインストールします。\n「中止」ボタンを押すと作業は行われません。", > 37 IDC_STATIC,32,7,238,28,SS_SUNKEN | WS_TABSTOP > 38 DEFPUSHBUTTON "開始",IDOK,130,42,67,22 > 39 PUSHBUTTON "中止",IDCANCEL,201,42,67,21 > 40 GROUPBOX "詳細設定(上級者向け)",IDC_STATIC,7,80,269,108 > 41 CTEXT "既にお勧めの設定になっておりますので、詳細設定は変更せずと燒竭閧ヘありません。", > 42 IDC_STATIC,16,91,253,19,SS_CENTERIMAGE | SS_SUNKEN > 43 LTEXT "関連付け:",IDC_STATIC,29,117,31,8 > 44 CONTROL "LZH",IDC_LZH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,63, > 45 116,22,10 > 46 CONTROL "ZIP",IDC_ZIP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,63, > 47 128,20,10 > 48 CONTROL "CAB",IDC_CAB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,88, > 49 116,25,10 > 50 CONTROL "RAR",IDC_RAR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,88, > 51 128,24,10 > 52 CONTROL "TAR",IDC_TAR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,116, > 53 116,24,10 > 54 CONTROL "YZ1",IDC_YZ1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,116, > 55 128,21,10 > 56 CONTROL "GCA",IDC_GCA,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,143, > 57 116,25,10 > 58 CONTROL "ARJ",IDC_ARJ,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,143, > 59 128,24,10 > 60 CONTROL "BGA",IDC_BGA,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,171, > 61 116,25,10 > 62 CONTROL "ACE",IDC_ACE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,171, > 63 128,24,10 > 64 CONTROL "CPT",IDC_CPT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,199, > 65 116,24,10 > 66 CONTROL "JAK",IDC_JAK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,199, > 67 128,23,10 > 68 CONTROL "7Z",IDC_7Z,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,228, > 69 116,23,10 > 70 LTEXT "シェル拡張:",IDC_STATIC,24,143,36,8 > 71 CONTROL "ここに圧縮",IDC_CMP,"Button",BS_AUTOCHECKBOX | > 72 WS_TABSTOP,63,142,47,10 > 73 CONTROL "ここに解凍",IDC_MLT,"Button",BS_AUTOCHECKBOX | > 74 WS_TABSTOP,116,142,47,10 > 75 LTEXT "ショートカット:",IDC_STATIC,18,157,42,8 > 76 CONTROL "送る",IDC_SND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,63, > 77 156,23,10 > 78 CONTROL "デスクトップ",IDC_DSK,"Button",BS_AUTOCHECKBOX | > 79 WS_TABSTOP,116,156,46,10 > 80 PUSHBUTTON "全OFF",IDC_ALL,239,151,24,14 > 81 LTEXT "インストール先:",IDC_STATIC,13,172,47,8 > 82 EDITTEXT IDC_INSTALLTO,62,171,176,12,ES_AUTOHSCROLL > 83 PUSHBUTTON "指定...",IDC_REF,241,170,22,14 > 84 END > 85 > 86 > 87 ///////////////////////////////////////////////////////////////////////////// > 88 // > 89 // DESIGNINFO > 90 // > 91 > 92 #ifdef APSTUDIO_INVOKED > 93 GUIDELINES DESIGNINFO DISCARDABLE > 94 BEGIN > 95 IDD_MAIN, DIALOG > 96 BEGIN > 97 LEFTMARGIN, 7 > 98 RIGHTMARGIN, 276 > 99 TOPMARGIN, 7 > 100 BOTTOMMARGIN, 188 > 101 END > 102 END > 103 #endif // APSTUDIO_INVOKED > 104 > 105 > 106 #ifdef APSTUDIO_INVOKED > 107 ///////////////////////////////////////////////////////////////////////////// > 108 // > 109 // TEXTINCLUDE > 110 // > 111 > 112 1 TEXTINCLUDE DISCARDABLE > 113 BEGIN > 114 "resource.h\0" > 115 END > 116 > 117 2 TEXTINCLUDE DISCARDABLE > 118 BEGIN > 119 "#include ""afxres.h""\r\n" > 120 "\0" > 121 END > 122 > 123 3 TEXTINCLUDE DISCARDABLE > 124 BEGIN > 125 "\r\n" > 126 "\0" > 127 END > 128 > 129 #endif // APSTUDIO_INVOKED > 130 > 131 > 132 ///////////////////////////////////////////////////////////////////////////// > 133 // > 134 // Icon > 135 // > 136 > 137 // Icon with lowest ID value placed first to ensure application icon > 138 // remains consistent on all systems. > 139 IDI_MAIN ICON DISCARDABLE "del.ico" > 140 IDI_NOAH ICON DISCARDABLE "..\\noah.ico" > 141 > 142 ///////////////////////////////////////////////////////////////////////////// > 143 // > 144 // String Table > 145 // > 146 > 147 STRINGTABLE DISCARDABLE > 148 BEGIN > 149 IDS_DIR "ここで選んだフォルダの下に""Noah""フォルダを作って凍します。" > 150 IDS_BADPATH "インストール先は「C:\\Noah」のように、ドライブ名まナ含めて指定してください。" > 151 IDS_COPYFAIL "ファイルのコピーに失敗しました。インストールできまケんでした。" > 152 IDS_REGISTFAIL "登録に失敗しました。アンインストールは手動で行ってュださい。" > 153 IDS_NOAH "圧縮解凍ソフト Noah" > 154 IDS_HELP "Noah 利用手引書" > 155 IDS_UNINSTALLER "Noah アンインストール" > 156 IDS_CALDIX "DLL自動ダウンロード" > 157 IDS_UNINSTOK "Noahのアンインストールを開始してよろしいですか?" > 158 IDS_INSTALLFINISH "インストール完了しました。" > 159 IDS_DLLINST "Noah本体のインストールを完了しました。次に、Noahのタ行に必要な「DLL」を自動ダウンロードしますか?(この作業は後でもできます。) > 160 IDS_UNINSTALLFINISH "アンインストール完了しました。" > 161 END > 162 > 163 #endif // 日本語 resources > 164 ///////////////////////////////////////////////////////////////////////////// > 165 > 166 > 167 ///////////////////////////////////////////////////////////////////////////// > 168 // 英語 (アメリカ) resources > 169 > 170 #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) > 171 #ifdef _WIN32 > 172 LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US > 173 #pragma code_page(1252) > 174 #endif //_WIN32 > 175 > 176 ///////////////////////////////////////////////////////////////////////////// > 177 // > 178 // Dialog > 179 // > 180 > 181 IDD_MAIN DIALOG DISCARDABLE 0, 0, 283, 177 > 182 STYLE DS_ABSALIGN | DS_MODALFRAME | DS_SETFOREGROUND | DS_CENTER | WS_POPUP | > 183 WS_CAPTION | WS_SYSMENU > 184 CAPTION "Install Noah" > 185 FONT 9, "MS Sans Serif" > 186 BEGIN > 187 ICON IDI_NOAH,-1,7,9,20,20,SS_REALSIZEIMAGE > 188 LTEXT " Thank you for downloading Noah!\nClick the button 'Begin' > 189 -1,32,7,238,28,SS_SUNKEN | WS_TABSTOP > 190 DEFPUSHBUTTON "&Begin",IDOK,130,42,67,22 > 191 PUSHBUTTON "&Cancel",IDCANCEL,201,42,67,21 > 192 GROUPBOX "Advanced",-1,7,79,269,91 > 193 LTEXT "Association:",-1,23,94,41,8 > 194 CONTROL "LZH",IDC_LZH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,67, > 195 94,28,10 > 196 CONTROL "ZIP",IDC_ZIP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,67, > 197 106,26,10 > 198 CONTROL "CAB",IDC_CAB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,95, > 199 94,30,10 > 200 CONTROL "RAR",IDC_RAR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,95, > 201 106,30,10 > 202 CONTROL "TAR",IDC_TAR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,125, > 203 94,29,10 > 204 CONTROL "YZ1",IDC_YZ1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,125, > 205 106,27,10 > 206 CONTROL "GCA",IDC_GCA,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,154, > 207 94,30,10 > 208 CONTROL "ARJ",IDC_ARJ,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,154, > 209 106,29,10 > 210 CONTROL "BGA",IDC_BGA,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,185, > 211 94,30,10 > 212 CONTROL "ACE",IDC_ACE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,185, > 213 106,29,10 > 214 CONTROL "CPT",IDC_CPT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,216, > 215 94,29,10 > 216 CONTROL "JAK",IDC_JAK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,216, > 217 106,29,10 > 218 LTEXT "Shell Extension:",-1,13,120,51,8 > 219 CONTROL "Compress Here",IDC_CMP,"Button",BS_AUTOCHECKBOX | > 220 WS_TABSTOP,67,120,71,10 > 221 CONTROL "Extract Here",IDC_MLT,"Button",BS_AUTOCHECKBOX | > 222 WS_TABSTOP,147,120,66,10 > 223 LTEXT "ShortCut:",-1,32,135,32,8 > 224 CONTROL "SendTo",IDC_SND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, > 225 67,134,44,10 > 226 CONTROL "Desktop",IDC_DSK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, > 227 122,134,51,10 > 228 PUSHBUTTON "all &off",IDC_ALL,244,129,22,14 > 229 LTEXT "Install to:",-1,32,150,29,8 > 230 EDITTEXT IDC_INSTALLTO,67,149,176,12,ES_AUTOHSCROLL > 231 PUSHBUTTON "&ref...",IDC_REF,247,148,20,14 > 232 END > 233 > 234 > 235 ///////////////////////////////////////////////////////////////////////////// > 236 // > 237 // DESIGNINFO > 238 // > 239 > 240 #ifdef APSTUDIO_INVOKED > 241 GUIDELINES DESIGNINFO DISCARDABLE > 242 BEGIN > 243 IDD_MAIN, DIALOG > 244 BEGIN > 245 LEFTMARGIN, 7 > 246 RIGHTMARGIN, 276 > 247 TOPMARGIN, 7 > 248 BOTTOMMARGIN, 170 > 249 END > 250 END > 251 #endif // APSTUDIO_INVOKED > 252 > 253 > 254 ///////////////////////////////////////////////////////////////////////////// > 255 // > 256 // String Table > 257 // > 258 > 259 STRINGTABLE DISCARDABLE > 260 BEGIN > 261 IDS_DIR "Select Target Directory." > 262 IDS_BADPATH "Target Directory must be specified in full path." > 263 IDS_COPYFAIL "Failed To Copy Files. Installation Aborted." > 264 IDS_REGISTFAIL "Failed." > 265 IDS_NOAH "Noah Archiver" > 266 IDS_HELP "Noah Manual" > 267 IDS_UNINSTALLER "Noah Uninstall" > 268 IDS_CALDIX "DLL Download" > 269 IDS_UNINSTOK "Do you want to uninstall Noah?" > 270 IDS_INSTALLFINISH "Finished installing Noah." > 271 IDS_DLLINST "Download DLLs from Internet ? ( You can do this als > 272 IDS_UNINSTALLFINISH "Uninstallation finished." > 273 END > 274 > 275 #endif // 英語 (アメリカ) resources > 276 ///////////////////////////////////////////////////////////////////////////// > 277 > 278 > 279 > 280 #ifndef APSTUDIO_INVOKED > 281 ///////////////////////////////////////////////////////////////////////////// > 282 // > 283 // Generated from the TEXTINCLUDE 3 resource. > 284 // > 285 > 286 > 287 ///////////////////////////////////////////////////////////////////////////// > 288 #endif // not APSTUDIO_INVOKED > 289

Added uninst/resource.h version [ef72d68202c16529]

> 1 //{{NO_DEPENDENCIES}} > 2 // Microsoft Developer Studio generated include file. > 3 // Used by kinst.rc > 4 // > 5 #define IDS_DIR 1 > 6 #define IDS_BADPATH 2 > 7 #define IDS_COPYFAIL 3 > 8 #define IDS_REGISTFAIL 4 > 9 #define IDS_NOAH 5 > 10 #define IDS_HELP 6 > 11 #define IDS_UNINSTALLER 7 > 12 #define IDS_CALDIX 8 > 13 #define IDS_UNINSTOK 9 > 14 #define IDS_INSTALLFINISH 10 > 15 #define IDS_DLLINST 11 > 16 #define IDS_UNINSTALLFINISH 12 > 17 #define IDD_DIALOG1 101 > 18 #define IDD_MAIN 101 > 19 #define IDI_MAIN 102 > 20 #define IDI_NOAH 103 > 21 #define IDC_LZH 1001 > 22 #define IDC_ZIP 1002 > 23 #define IDC_CAB 1003 > 24 #define IDC_RAR 1004 > 25 #define IDC_TAR 1005 > 26 #define IDC_YZ1 1006 > 27 #define IDC_GCA 1007 > 28 #define IDC_ARJ 1008 > 29 #define IDC_BGA 1009 > 30 #define IDC_ACE 1010 > 31 #define IDC_CPT 1011 > 32 #define IDC_JAK 1012 > 33 #define IDC_7Z 1013 > 34 #define IDC_CMP 1014 > 35 #define IDC_MLT 1015 > 36 #define IDC_SND 1016 > 37 #define IDC_DSK 1017 > 38 #define IDC_STT 1018 > 39 #define IDC_INSTALLTO 1019 > 40 #define IDC_REF 1020 > 41 #define IDC_ALL 1022 > 42 > 43 // Next default values for new objects > 44 // > 45 #ifdef APSTUDIO_INVOKED > 46 #ifndef APSTUDIO_READONLY_SYMBOLS > 47 #define _APS_NEXT_RESOURCE_VALUE 104 > 48 #define _APS_NEXT_COMMAND_VALUE 40001 > 49 #define _APS_NEXT_CONTROL_VALUE 1024 > 50 #define _APS_NEXT_SYMED_VALUE 101 > 51 #endif > 52 #endif