|
 | ̤²ò·è |
 | ²ò·è |
 | Ää»ß |
 | ºï½üÍ×ÀÁ |
|
2014/9/22(Mon) 23:53:20|NO.65140
¥×¥é¥°¥¤¥ó¤Ï¤¢¤Þ¤ê»È¤¤¤¿¤¯¤Ê¤¤¡Ê¤È¤¤¤¦¤«»ö¾ð¤Ë¤è¤ê»È¤¨¤Ê¤¤¡Ë
¤Î¤Ç¡¢winɸ½à£Ä£Ì£Ì¤Ç°µ½Ì²òÅॸ£ð¤«£·£ú¤«¡¢£ì£ú£í¤Ê¤É¡£
¤Ç¤¤Ê¤¤¤Ç¤·¤ç¤¦¤«¡©
¤¤¤í¤¤¤íÄ´¤Ù¤Þ¤·¤¿¤¬¤ï¤«¤ê¤Þ¤»¤ó¡£
¥½¡¼¥¹¤ÎÇËÊҤߤ¿¤¤¤Ê¤Î¤Ç¤â¤¤¤¤¤Î¤Ç¡¢¶µ¤¨¤Æ¤¯¤À¤µ¤¤
|
|
2014/9/23(Tue) 08:36:59|NO.65145
>¥×¥é¥°¥¤¥ó¤Ï¤¢¤Þ¤ê»È¤¤¤¿¤¯¤Ê¤¤
HSP¤Ï°µ½Ì¥Õ¥¡¥¤¥ë¤ò²òÅà¡ÊŸ³«¡Ë¤¹¤ëǽÎϤϻý¤Ã¤Æ¤Þ¤»¤ó¡£
¤½¤³¤Ç¡¢²òÅà½èÍý¤òÀìÌç¤Ë¹Ô¤¦³°ÉôÈÆÍѥ饤¥Ö¥é¥ê¡ÊDLL·Á¼°¡Ë¤ÎÎϤò¼Ú¤ê¤ë¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡£
>ÇÛÉÛ»þ¤ÎÃí°Õ
¤Á¤Ê¤ß¤Ë¡¢³°Éô¥×¥é¥°¥¤¥ó¤ÏÁǤΥѥ½¥³¥ó¤Ë¤ÏÅöÁ³Æþ¤Ã¤Æ¤¤¤Ê¤¤¤Î¤Ç¡¢
³Æ¥æ¡¼¥¶¡¼¤ËÊÌÅÓÆþ¼ê¤·¤Æ¤â¤é¤Ã¤Æ¡¢Windows¤Î¥·¥¹¥Æ¥à¥Õ¥©¥ë¥À¤Ê¤ê¼Â¹Ô¥Õ¥¡¥¤¥ë¤ÈƱ¤¸¥Õ¥©¥ë¥À¤Ê¤ê¤Ë
ÃÖ¤¤¤Æ¤â¤é¤¦·Á¤Ë¤Ê¤ê¤Þ¤¹¡£¡Ê¤³¤Î¥Ú¡¼¥¸¤Ç¾Ò²ð¤·¤Æ¤ëZIP¤ÈLZH¤Î£²¥é¥¤¥Ö¥é¥ê¤Ï¡¢DLL¥Õ¥¡¥¤¥ëñÂΤǤÎÇÛÉÛ¤¬¶Ø»ß¤µ¤ì¤Æ¤ë¤Î¤ÇÃí°Õ¡Ë
>»È¤¦DLL
Windows XP¡Á´Ä¶¤Ç¤Ïɸ½à¤Ç°µ½Ì¤È²òÅà¤Îµ¡Ç½¤¬ÍÑ°Õ¤µ¤ì¤Æ¤Þ¤¹¤¬¡¢
Windows¤ÎÀ¤³¦¤Ç¤â¤Ã¤È¤âÉáµÚ¤·¤Æ¤¤¤ëĶÄêÈ֤ΰµ½Ì·Á¼°¤Ç¤¹¡£
shoda T.¤µ¤ó¤é¤Ë¤è¤ëZIP¥Õ¥¡¥¤¥ë²òÅà¥é¥¤¥Ö¥é¥ê¡Öunzip32.dll¡×¤òÍøÍѤ·¤Þ¤¹¡£
>¥½¡¼¥¹
// ZIP¥Õ¥¡¥¤¥ë¤Î²òÅॵ¥ó¥×¥ë (by Kpan)
#uselib "unzip32"
#func UnZip "UnZip" nullptr, str, int, int
#func UnZipGetFileCount "UnZipGetFileCount" str
#func UnZipGetVersion "UnZipGetVersion"
; unzip32.dll¤¬Â¸ºß¤¹¤ë¤«´Ê°×¥Á¥§¥Ã¥¯
if varptr(UnZipGetVersion) = 0 {
dialog "unzip32.dll ¤¬¸«¤Ä¤«¤é¤ó"
end
}
sdim filepath, 256
sdim outpath, 256
sdim szOutput,1024
; ZIP¥Õ¥¡¥¤¥ë¤Î¥Ñ¥¹ (Îã¡¢C¥É¥é¥¤¥Ö¤Îľ²¼¤Ë¤¢¤ë¾ì¹ç)
filepath = "C:\\sample.zip"
mes "ZIP¥Õ¥¡¥¤¥ë : "+filepath+""
; ²òÅष¤¿¥Õ¥¡¥¤¥ë¤Î½ÐÎÏ¥Õ¥©¥ë¥À
outpath = "C:\\"
mes "½ÐÎÏ¥Õ¥©¥ë¥À : "+outpath+""
button "²òÅà", *unpack
button "¾ðÊó", *info
button "¥Õ¥¡¥¤¥ë¿ô", *count
button "¥Ð¡¼¥¸¥ç¥ó", *version
stop
; ZIP¥Õ¥¡¥¤¥ë¤Î²òÅà
; Àµ¾ï¤Ë½ªÎ»¤¹¤ì¤Ðstat¤Ë0¤¬¡¢¥¨¥é¡¼¤Ê¤é0°Ê³°¤¬ÊÖ¤ê¤Þ¤¹¡£
; ¥ª¥×¥·¥ç¥ó¤È¤·¤Æ¡¢--i¡¢-n¡¢-o¡¢-P*****¡¢¤È¤¤¤¦¤è¤¦¤Ê¤â¤Î¤¬¤¢¤ê¡¢¾ÜºÙ¤Ï
; DLLƱÉõ¤ÎŽ¢UNZIP32D.TXTŽ£¤ò»²¾È¤Î¤³¤È¡£¤¿¤È¤¨¤Ð²òÅà¾õ¶·¥À¥¤¥¢¥í¥°Èóɽ¼¨¤Ê¤é¡¢
; (Ex) UnZip "--i \""+filepath+"\" ¡Á
*unpack
UnZip "\""+filepath+"\" \""+outpath+"\""
mes "²òÅà : "+stat
stop
; ZIP¥Õ¥¡¥¤¥ëÆâ¤Î¾ðÊó¤òszOutput¤Ë½ÐÎÏ (²òÅà½èÍý¤Ê¤·)
; ¥Õ¥¡¥¤¥ë¤ÎÆâÍƤΰìÍ÷ɽ¼¨(-l¡¢-lv¡¢-v)¤äCRC¥Á¥§¥Ã¥¯(-t)¤Ê¤É¤¢¤ë¡£
*info
UnZip "-lv \""+filepath+"\"", varptr(szOutput), 1024
dialog ""+szOutput
stop
; ZIP¥Õ¥¡¥¤¥ëÆâ¤Ë³ÊǼ¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¿ô¤ò¼èÆÀ
; ¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Ê¤¤¡¢ZIP¥Õ¥¡¥¤¥ë¤Ç¤Ê¤¤¡¢½ñ¸Ë¤¬²õ¤ì¤Æ¤¤¤ë¡¢¤è¤¦¤Ê¾ì¹ç¤Ï
; -1¤¬ÊÖ¤ë¤Î¤Ç¡¢½ñ¸Ë¥Á¥§¥Ã¥¯Åª¤Ê¤³¤È¤È¤·¤ÆÍøÍѲġ£
*count
UnZipGetFileCount filepath
mes "¥Õ¥¡¥¤¥ë¿ô : "+stat+" ¥³"
stop
; unzip32.dll¤Î¥Ð¡¼¥¸¥ç¥ó¼èÆÀ
; Ìá¤êÃͤϲ¼¤Î¤è¤¦¤Ê´¶¤¸¤ÇÊ֤롣
; 75 -> Version 0.75 ¡¢100 -> Version 1.00 ¡¢540 -> Version 5.4
*version
UnZipGetVersion
value = stat
value = wpeek(value) ; ¤³¤ì¤¬¤Ê¤¤¤È2²óÌܰʹߤËÀµ¤·¤¯¼èÆÀ¤Ç¤¤Ê¤¤
mes "¥Ð¡¼¥¸¥ç¥ó : "+value+" -> "+(value / 100)+"."+(value \ 100)+""
stop
Á´¤Æ¤ÎÀâÌÀ¤È¥½¡¼¥¹¤Ï http://lhsp.s206.xrea.com/hsp_file.html#5¤«¤é¤ÎÈ´¿è

| |
|
2014/9/23(Tue) 11:43:57|NO.65153
ŽÌŽßŽ×Ž¸ŽÞŽ²ŽÝ¸¯¤¦¤·¤«¤Ê¤¤¤è¤¦¤Ç¤¹¡£
LZM ¥Õ¥¡¥¤¥ë¤Ç¤¤¤¤¤Î¤Ç¤·¤ç¤¦¤«
|
|
2014/9/23(Tue) 14:23:48|NO.65158
Microsoft ¤Ï¿ä¾©¤·¤Æ¤¤¤Þ¤»¤ó¤¬¡¢¤³¤ó¤ÊÊýË¡¤â¡£
zip = /* Zip ¥Õ¥¡¥¤¥ë¤Ø¤Î¥Õ¥ë¥Ñ¥¹ */
dest = /* Ÿ³«Àè¥Ç¥£¥ì¥¯¥È¥ê¤Ø¤Î¥Õ¥ë¥Ñ¥¹ (¤¢¤é¤«¤¸¤á mkdir ¤Ê¤É¤Ç¥Ç¥£¥ì¥¯¥È¥ê¤òºî¤Ã¤Æ¤ª¤¯¤³¤È) */
// 4 : ¥×¥í¥°¥ì¥¹É½¼¨¤Ê¤·
// 8 : Ʊ̾¤Î¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤¿¤é¥ê¥Í¡¼¥à
// 16 : ¥À¥¤¥¢¥í¥°¤Ç¾ï¤Ë¡Ö¤¹¤Ù¤Æ¤Ë¤Ï¤¤¡×¤òÁªÂò
// (°Ê²¼Î¬)
flag = 8 + 16
newcom app, "Shell.Application"
comres nsZip
app->"NameSpace" zip
comres nsDest
app->"NameSpace" dest
nsDest->"CopyHere" nsZip("Items"), flags
stop
|
|
2014/9/23(Tue) 14:54:19|NO.65160
¥¤¥ó¥¯¥ë¡¼¥ÉºÑ¤ß¤À¤È¤·¤Æ¡¢
lzdist "C:\\Users\\desktop"
lzcopy "BatchWOO!.zip"
¤Ë¤·¤¿¤Î¤Ç¤¹¤¬¡¢¥³¥Ô¡¼¤µ¤ì¤Þ¤»¤ó¡£
¤Ê¤¼¤Ç¤·¤ç¤¦¤«¡©
|
|
2014/9/23(Tue) 19:11:58|NO.65173
¡Ä
¡Ö¼«Ê¬¤Ï¥É¥¥å¥á¥ó¥È(HDL)¤Ê¤ó¤«¸«¤Ê¤¤¤Ç¼ÁÌ䤷¤Æ¤ë¤¼¡ª¡ª¡ª¡×¡¡¤Ã¤ÆÂçÀ¼¤Ç¸À¤Ã¤Æ¤ë¤è¤¦¤Ç¤¹¤è
HDL¤«¤é°úÍÑ
"name"¤Ë¤Ï¡¢³ÈÄ¥»Ò¤ò´Þ¤Þ¤Ê¤¤Ì¾Á°(8ʸ»ú¤Þ¤Ç)¤ò»ØÄꤷ¤Æ¤¯¤À¤µ¤¤¡£
|
|
2014/9/23(Tue) 19:52:13|NO.65177
¤¢¡¡¤½¤ì°ÊÁ°¤ÎÌäÂê¤Ç¤·¤¿¤Í
lzcopy¤Ç¤ÏÅöÁ³zip¤Ê¤ó¤«²òÅà¤Ç¤¤Þ¤»¤ó
Microsoft¤Î compress.exe·Á¼°¤Î°µ½Ì¥Õ¥¡¥¤¥ë¤ò²òÅà
»²¹Í¥µ¥¤¥È
Win32API Compress.exe¤Ç°µ½Ì¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤ò²òÅह¤ë LZCopy
http://d.hatena.ne.jp/s-kita/20110430/1304158084
°µ½Ì¡¦²òÅà·Á¼° - ¤½¤Î£±¡§¥Õ¥¡¥¤¥ë°µ½Ì
http://www.geocities.jp/matsuhp/pc/arc1.html
¤Á¤Ê¤ß¤Ë"compress.exe"¤ÏLZ77¤È¤¤¤¦¥¢¥ë¥´¥ê¥º¥à¤Ç°µ½Ì¤·¤Æ¤¤¤Þ¤¹
LZ77¤ÏµìÀ¤Âå¤Î°µ½Ì¥¢¥ë¥´¥ê¥º¥à¤Ç¡¢LZ77¤ò²þÎɤ·¤¿LZSS¤Ë¡¢¤µ¤é¤ËÊ̤ε»½Ñ(¥Ï¥Õ¥Þ¥óÉä¹æ²½)¤òÁȤ߹ç¤ï¤»¤¿¤â¤Î¤òDeflate¤È¤¤¤¤¡¢ÂçÂΤÎzip¤Î°µ½Ì¥¢¥ë¥´¥ê¥º¥à¤È¤·¤Æ»È¤ï¤ì¤Æ¤¤¤Þ¤¹
¤·¤«¤âcompress.exe¤Ã¤Æº£¤Îwindows¤Ë¤ÏƱº¤µ¤ì¤Æ¤Ê¤¤¤â¤Î¤À¤È»×¤¤¤Þ¤¹
|
|
2014/9/23(Tue) 21:58:34|NO.65183
¤¨¡¼¤È¡£
Æɤó¤Ç̵¤¤¤ó¤¸¤ã¤Ê¤¯¤Æ¡¢¸«Íî¤È¤·¤Ç¤¹¡£
¤Ç¤Ï¡¢zip°Ê³°¤À¤È¡¢lzm¤±¤¤¤·¤¤À¤È¤¤¤¤¤Î¤Ç¤·¤ç¤¦¤«?
|
|
2014/9/23(Tue) 22:50:36|NO.65189
¸¡º÷¤·¤Æ¤ß¤¿¤élzm¤È¤¤¤¦°µ½Ì·Á¼°¤â°ì±þ¸ºß¤¹¤ë¤ß¤¿¤¤¤Ç¤¹¤Í¡£
¤³¤ì¤Ã¤Æ¤¹¤´¤¯¥Þ¥¤¥Ê¡¼¤Ê·Á¼°¤Ê¤Î¤Ç¤Ï¤Ê¤¤¤Ç¤¹¤«¡©
¤Ê¤ó¤«Slax module manager¤È¤«½Ð¤Þ¤¹¤¬¡¦¡¦¡¦
|
|
2014/9/23(Tue) 22:55:18|NO.65190
¤È¤¤¤¦¤«¡¢¤¤¤Ã¤¿¤¤¶ñÂÎŪ¤Ë¤Ï¤É¤¦¤¤¤¦¤³¤È¤¬¤·¤¿¤¤¤Î¤«¡¢
¤Ê¤Ë¤æ¤¨¥×¥é¥°¥¤¥ó¤¬»È¤¨¤Ê¤¤¤Î¤«¡¢
¤½¤Á¤é¤Î»ö¾ð¤ò½ñ¤±¤Ð¤Þ¤¿Ê̤βò·èÊýË¡¤¬Ä󼨤·¤Æ¤â¤é¤¨¤ë¤«¤â¡©
|
|
2014/9/23(Tue) 23:17:02|NO.65192
¼ºÎé lzm¤ÏÉáÄ̤ΰµ½Ì¥Õ¥¡¥¤¥ë¤Ç¤¹¤Í¡¡ÌµÃΤǤ·¤¿
¤Ç¡¢
¤Ç¤Ï¡¢zip°Ê³°¤À¤È¡¢lzm¤±¤¤¤·¤¤À¤È¤¤¤¤¤Î¤Ç¤·¤ç¤¦¤«?
¼«Ê¬¤¬Å½¤Ã¤¿URL¸«¤ì¤Ð¤ï¤«¤ë¤È»×¤¤¤Þ¤¹¤¬¡Ä
¸«Íî¤È¤·¤Ç¤¹¡£
¤Ã¤Æ¸À¤ï¤ì¤½¤¦
lzcopy¤Ç²òÅà¤Ç¤¤ë¤Î¤Ï¤¢¤¯¤Þ¤Ç¤â¡ÖCompress.exe¡×¤Ç°µ½Ì¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤Î¤ß¤Ç¤¹
¤°¤°¤Ã¤Æ¤¯¤À¤µ¤¤¤è
|
|
2014/9/26(Fri) 23:00:19|NO.65264
Compress.exe
¤Ã¤Æ¤Î¤¬¤è¤¯¤ï¤«¤ó¤Ê¤¤¤ó¤Ç¤¹¤è¤Í¡£
¥°¥°¤Ã¤¿¤é¡¢LZH¤¬¤É¤¦¤³¤¦½Ð¤Æ¤¤¿¤ó¤Ç¡¦¡¦¡¦
|
|
2014/9/28(Sun) 18:17:17|NO.65318
¥Õ¥¡¥¤¥ë·Á¼°¤òÌä¤ï¤Ê¤¤¤Ê¤é
¥Ð¥¤¥Ê¥ê¥Ç¡¼¥¿¤òVRAM¤Ë½ñ¤¹þ¤ó¤ÇPNG²èÁü¤È¤·¤ÆÊݸ¤¹¤ë»ö¤Ç
¿¾¯¤Ï°µ½Ì¤Ç¤¤ë¤«¤âÃΤì¤Þ¤»¤ó¡£(Í×:GDI+)
PNGÊݸ¤Ë¤Ï¥³¥Á¥é¤ÇÄ󼨤µ¤ì¤Æ¤¤¤ë¥â¥¸¥å¡¼¥ë¤òÍøÍѤµ¤»¤Æ夤¤Æ¤Þ¤¹¡£
>http://fs-cgi-basic01.freespace.jp/~hsp/ver3/hsp3.cgi?print+201201/12010002.txt
;http://fs-cgi-basic01.freespace.jp/~hsp/ver3/hsp3.cgi?print+201201/12010002.txt
#include "GDIplusImgSaveMod.hsp"
#module
;--¥Ç¡¼¥¿¤òVRAM¤Ë½ñ¤¹þ¤ó¤ÇÊݸ("FileName", <buf>, size, winID) <stat:FileSize>
#deffunc bPicSave str p0, var p1, int p2, int p3, local a, local b
If(p2<1){Return 0} :a.0=512, (p2+4)/(512*3)+1, gInfo.3, gInfo.25
If(p3>0){a.3=p3} :Buffer a.3, a.0, a.1 :mRef b, 66
lPoke b, 0, p2 :MemCpy b, p1, p2, 4
imgsave p0 :Buffer a.3, 1, 1 :gSel a.2 :Exist p0
Return strsize
;--VRAM¤«¤é¥Ç¡¼¥¿¼è¤ê½Ð¤·("FileName", <buf>, winID) <stat:size>
#deffunc bPicLoad str p0, array p1, int p2, local a, local b
Exist p0 :a=strsize, 0, gInfo.3, gInfo.25 :If(a<1){Return 0}
If(p2>0){a.3=p2} :Buffer a.3 :PicLoad p0 :mRef b, 66
a.1=lPeek(b) :sDim p1, a.1 :MemCpy p1, b, a.1, 0, 4
Buffer a.3, 1, 1 :gSel a.2
Return a.1
#global
*test
Screen 0, 320, 56, 2
SysColor 15 :BoxF :sDim s, $100 :sDim si, $100
Pos 4, 4 :Input si, 292, 20
Pos 296, 4 :ObjSize 20, 20 :Button gosub "...", *btn
Pos 236, 28 :ObjSize 80, 24 :Button gosub "TEST", *btn
gSel 0, 1 :Redraw 0
Stop
*btn
i=gInfo.2*100+stat
If(i==1){Dialog "", 16 :If(stat){ObjPrm 0, refstr}}
If(i==2){
Exist si :i.1=strsize :If(i.1<1){Title "File not found" :Return}
//Êݸ
sDim buf_0, i.1 :bLoad si, buf_0, i.1
bPicSave si+"_TEST.png", buf_0, i.1, 9 :i.2=stat
s=StrF("SAVE: %d => %d", i.1, i.2) :LogMes s :Title s
//Æɤ߹þ¤ß
Wait 4 :Dim buf_1
bPicLoad si+"_TEST.png", buf_1 :i.3=stat
s=StrF("LOAD: %d => %d", i.2, i.3) :LogMes s :Title s
//Éü¸µ¥Á¥§¥Ã¥¯
Wait 4 :If(i.1^i.3){Goto *@f} :i.0=0 :i.2=0, 0
Color :BoxF 4, 28, 203, 51 :Redraw 1 :Redraw 0
Repeat ;size\4¤Î¥Á¥§¥Ã¥¯
If(((i^i.1)&3)==0){Break}
If(Peek(buf_0, i)^Peek(buf_1, i)){i=-1 :Break} :i++
Loop :If(i<0){Goto *@f}
Repeat :If(i>=i.1){Break}
If(lPeek(buf_0, i)^lPeek(buf_1, i)){Break}
i+=4 :i.3=(i*200)/i.1 :If(i.2==i.3){Continue} :i.2=i.3
GradF 4, 28, i.2, 24, 0, $ff0000, $ffff00 :Redraw 1 :Redraw 0 :aWait 1
Loop
*@ :If(i^i.1){s=" failed..."}else{s=" OK"} :LogMes s
Pos 8, 32 :Color , 255 :Mes s :Redraw 1 :Redraw 0 :Dim buf_0 :Dim buf_1
}
Return
¥â¥Î¤Ë¤è¤Ã¤Æ¤ÏµÕ¤ËÁý¤¨¤Þ¤¹¡Äorz

| |
|
2014/9/28(Sun) 20:08:51|NO.65319
774¤µ¤ó¡¢¤½¤¦¤¤¤¦È¯ÁÛÌÌÇò¤¯¤Æ¹¥¤¤À¤Ê¤¢
|
|
2014/10/3(Fri) 22:14:29|NO.65401
Windows 8 °Ê¹ß¤Ç¤¢¤ì¤Ð Compression API ¤ò»È¤Ã¤Æ¼ÂÁõ¤¹¤ë¤³¤È¤â¤Ç¤¤Þ¤¹¡£
¤¿¤À¤·¡¢.zip ¤ä .7z ¤È¤¤¤Ã¤¿¥¢¡¼¥«¥¤¥Ö¥Õ¥¡¥¤¥ë¤ò¼è¤ê°·¤¨¤ë¤è¤¦¤Ë¤Ê¤ë¤ï¤±¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£Ç°¤Î¤¿¤á¡£
// ¥Ç¡¼¥¿¤ò°µ½Ì¡¦Å¸³«¤¹¤ë¥µ¥ó¥×¥ë
#cmpopt varinit 1
#module
#uselib "kernel32.dll"
#cfunc GetLastError "GetLastError"
#const ERROR_INSUFFICIENT_BUFFER 122
#uselib "cabinet.dll"
#const COMPRESS_ALGORITHM_MSZIP 2
#const COMPRESSDATA_DEFAULT_ALGORITHM COMPRESS_ALGORITHM_MSZIP
#func CreateCompressor "CreateCompressor" int, int, int
#func Compress "Compress" int, int, int, int, int, int
#func CloseCompressor "CloseCompressor" int
#func CreateDecompressor "CreateDecompressor" int, int, int
#func Decompress "Decompress" int, int, int, int, int, int
#func CloseDecompressor "CloseDecompressor" int
// ¥Ç¡¼¥¿¤ò°µ½Ì¤¹¤ë¡£
// uncompressed_buffer: °µ½Ì¤·¤¿¤¤¥Ç¡¼¥¿¤òÊÝ»ý¤¹¤ëÊÑ¿ô
// uncompressed_size : °µ½Ì¤·¤¿¤¤¥Ç¡¼¥¿¤Î¥µ¥¤¥º (bytes)
// compressed_buffer : °µ½Ì·ë²Ì¤ò¼õ¤±¼è¤ëÊÑ¿ô
// compressed_size : °µ½Ì·ë²Ì¤Î¥Ç¡¼¥¿¥µ¥¤¥º¤ò¼õ¤±¼è¤ëÊÑ¿ô
// Ìá¤êÃÍ: À®¸ù»þ stat != 0¡¢¼ºÇÔ»þ stat == 0
#deffunc CompressData var uncompressed_buffer, int uncompressed_size, var compressed_buffer, var compressed_size, local handle, local result
// ´Ä¶¥Á¥§¥Ã¥¯
if varptr(CreateCompressor) == 0 : return 0
// °µ½Ì¥Ï¥ó¥É¥ëºîÀ®
handle = 0 : CreateCompressor COMPRESSDATA_DEFAULT_ALGORITHM, 0, varptr(handle)
if stat == 0 : return 0
// ¥µ¥¤¥º·×»»
result = 0 : compressed_size = 0
Compress handle, varptr(uncompressed_buffer), uncompressed_size, 0, 0, varptr(compressed_size)
if GetLastError() == ERROR_INSUFFICIENT_BUFFER {
// °µ½Ì¤¹¤ë
sdim compressed_buffer, compressed_size
Compress handle, varptr(uncompressed_buffer), uncompressed_size, varptr(compressed_buffer), compressed_size, varptr(compressed_size)
result = (stat != 0)
}
CloseCompressor handle
return result
// ¥Ç¡¼¥¿¤òŸ³«¤¹¤ë¡£
// compressed_buffer : Ÿ³«¤·¤¿¤¤¥Ç¡¼¥¿¤òÊÝ»ý¤¹¤ëÊÑ¿ô
// compressed_size : Ÿ³«¤·¤¿¤¤¥Ç¡¼¥¿¤Î¥µ¥¤¥º (bytes)
// uncompressed_buffer: Ÿ³«·ë²Ì¤ò¼õ¤±¼è¤ëÊÑ¿ô
// uncompressed_size : Ÿ³«·ë²Ì¤Î¥Ç¡¼¥¿¥µ¥¤¥º¤ò¼õ¤±¼è¤ëÊÑ¿ô
// Ìá¤êÃÍ: À®¸ù»þ stat != 0¡¢¼ºÇÔ»þ stat == 0
#deffunc DecompressData var compressed_buffer, int compressed_size, var uncompressed_buffer, var uncompressed_size, local handle, local result
// ´Ä¶¥Á¥§¥Ã¥¯
if varptr(CreateDecompressor) == 0 : return 0
// °µ½Ì¥Ï¥ó¥É¥ëºîÀ®
handle = 0 : CreateDecompressor COMPRESSDATA_DEFAULT_ALGORITHM, 0, varptr(handle)
if stat == 0 : return 0
// ¥µ¥¤¥º·×»»
result = 0 : uncompressed_size = 0
Decompress handle, varptr(compressed_buffer), compressed_size, 0, 0, varptr(uncompressed_size)
if GetLastError() == ERROR_INSUFFICIENT_BUFFER {
// Ÿ³«¤¹¤ë
sdim uncompressed_buffer, uncompressed_size
Decompress handle, varptr(compressed_buffer), compressed_size, varptr(uncompressed_buffer), uncompressed_size, varptr(uncompressed_size)
result = (stat != 0)
}
CloseDecompressor handle
return result
#global
// ------------
// °Ê²¼¥µ¥ó¥×¥ë
// ------------
// °µ½Ì¤·¤¿¤¤¥Ç¡¼¥¿¤òÍÑ°Õ¤¹¤ë
// ¥µ¥ó¥×¥ë: ¡Ö¸ãÇÚ¤ÏǤǤ¢¤ë¡×¤è¤ê http://www.aozora.gr.jp/cards/000148/card789.html
uncompressed_buffer = {"
¸ãÇڡԤ郎¤Ï¤¤¡Õ¤ÏǤǤ¢¤ë¡£Ì¾Á°¤Ï¤Þ¤À̵¤¤¡£
¤É¤³¤ÇÀ¸¤ì¤¿¤«¤È¤ó¤È¸«Åö¡Ô¤±¤ó¤È¤¦¡Õ¤¬¤Ä¤«¤Ì¡£
²¿¤Ç¤âÇö°Å¤¤¤¸¤á¤¸¤á¤·¤¿½ê¤Ç¥Ë¥ã¡¼¥Ë¥ã¡¼µã¤¤¤Æ¤¤¤¿»ö¤À¤±¤Ïµ²±¤·¤Æ¤¤¤ë¡£
¸ãÇڤϤ³¤³¤Ç»Ï¤á¤Æ¿Í´Ö¤È¤¤¤¦¤â¤Î¤ò¸«¤¿¡£
¤·¤«¤â¤¢¤È¤Çʹ¤¯¤È¤½¤ì¤Ï½ñÀ¸¤È¤¤¤¦¿Í´ÖÃæ¤Ç°ìÈÖ¡ÃàØ°¡Ô¤É¤¦¤¢¤¯¡Õ¤Ê¼ï²¤Ç¤¢¤Ã¤¿¤½¤¦¤À¡£
¤³¤Î½ñÀ¸¤È¤¤¤¦¤Î¤Ï»þ¡¹²æ¡¹¤òÊá¡Ô¤Ä¤«¤Þ¡Õ¤¨¤Æ¼Ñ¡Ô¤Ë¡Õ¤Æ¿©¤¦¤È¤¤¤¦ÏäǤ¢¤ë¡£
¤·¤«¤·¤½¤ÎÅö»þ¤Ï²¿¤È¤¤¤¦¹Í¤â¤Ê¤«¤Ã¤¿¤«¤éÊÌÃʶ²¤·¤¤¤È¤â»×¤ï¤Ê¤«¤Ã¤¿¡£
¤¿¤ÀÈà¤Î¾¸¡Ô¤Æ¤Î¤Ò¤é¡Õ¤ËºÜ¤»¤é¤ì¤Æ¥¹¡¼¤È»ý¤Á¾å¤²¤é¤ì¤¿»þ²¿¤À¤«¥Õ¥ï¥Õ¥ï¤·¤¿´¶¤¸¤¬¤¢¤Ã¤¿¤Ð¤«¤ê¤Ç¤¢¤ë¡£
"}
uncompressed_size = strlen(uncompressed_buffer) + 1 // °µ½Ì¤·¤¿¤¤¥Ç¡¼¥¿¤Î¥µ¥¤¥º
compressed_buffer = "" // °µ½Ì·ë²Ì¤¬³ÊǼ¤µ¤ì¤ëÊÑ¿ô
compressed_size = 0 // compressed ¤Î¥µ¥¤¥º¡£¤¢¤È¤Ç·×»»¤¹¤ë
title "¸µ¤Î¥Ç¡¼¥¿" : mes uncompressed_buffer
dialog "°µ½Ì¤·¤Þ¤¹"
CompressData uncompressed_buffer, uncompressed_size, compressed_buffer, compressed_size
if stat {
dialog strf("°µ½ÌÀ®¸ù\n°µ½ÌÁ°: %d byte(s)\n°µ½Ì¸å: %d byte(s)\n°µ½ÌΨ: %.1f %%", uncompressed_size, compressed_size, 100.0 * compressed_size / uncompressed_size)
} else {
dialog "°µ½Ì¼ºÇÔ", 1
stop
}
// ¥¯¥ê¥¢¤·¤Æ¸µ¤Î¥Ç¡¼¥¿¤¬Â¸ºß¤·¤Ê¤¤¾õÂ֤ˤ¹¤ë
memset uncompressed_buffer, 0, uncompressed_size : cls : title "Ÿ³«Ãæ"
dialog "Ÿ³«¤·¤Þ¤¹"
DecompressData compressed_buffer, compressed_size, uncompressed_buffer, uncompressed_size
if stat {
title "Ÿ³«¤·¤¿¥Ç¡¼¥¿" : mes uncompressed_buffer
dialog strf("Ÿ³«À®¸ù\nŸ³«Á°: %d byte(s)\nŸ³«¸å: %d byte(s)\n°µ½ÌΨ: %.1f %%", compressed_size, uncompressed_size, 100.0 * compressed_size / uncompressed_size)
} else {
dialog "Ÿ³«¼ºÇÔ", 1
stop
}
stop
Windows 7 °ÊÁ°¤Ë¤âÂбþ¤µ¤»¤¿¤¤¾ì¹ç¤Ï Cabinet API ¤È¤¤¤¦¤Î¤¬¤¢¤ê¤Þ¤¹¤¬¡ÊWin98¤¯¤é¤¤¤«¤é¤º¤Ã¤È¤¢¤ë¡Ë
HSP ¤«¤é»È¤¦¤Ë¤ÏÆñ°×ÅÙ¤¬¹â¤¯¡Ê¥Þ¥·¥ó¥³¡¼¥É¤òËä¤á¹þ¤à or DLLºîÀ®¡ËÆñ¤·¤¤¤È»×¤¤¤Þ¤¹¡£

| |
|
2014/10/3(Fri) 23:24:29|NO.65402
¤ß¤Ê¤µ¤ó¡£¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£
¤â¤È¤Ï¤È¤¤¤¨¤Ð¡¢¥¤¥ó¥¹¥È¡¼¥é¡¼¤¬ºî¤ê¤¿¤¯¤Æ¡¢°µ½Ì¥Õ¥¡¥¤¥ë¤ò¥Ñ¥Ã¥¯¥Õ¥¡¥¤¥ë¤ËÆþ¤ì¤Æ²òÅह¤ì¤Ð¤¤¤¤
¤À¤í¤¦¤È»Ï¤á¤¿¤ï¤±¤Ç¤¹¡£
¤½¤¦¤¤¤¨¤Ð¡¢¥Ð¥¤¥Ê¥ê²½¤·¤Æ¥Ç¡¼¥¿¥Õ¥¡¥¤¥ëÁ÷¤ì¤Ð¤¤¤¤¤ï¤±¤À¡¦¡¦¡¦¡Ê¥Ð¥¤¥Ê¥ê²½¤Ë¤·¤¯¤¸¤Ã¤¿¤¬¡Ë
|
|