HSP¥Ý¡¼¥¿¥ë
¥µ¥¤¥È¥Þ¥Ã¥× ¤ªÌ䤤¹ç¤ï¤»


HSPTV!·Ç¼¨ÈÄ


̤²ò·è ²ò·è Ää»ß ºï½üÍ×ÀÁ

2008
0208
sin¥ê¥¹¥È¥Ó¥å¡¼¤Î¥½¡¼¥È(LVM_SORTITEMS)¥á¥Ã¥»¡¼¥¸2²ò·è


sin

¥ê¥ó¥¯

2008/2/8(Fri) 01:41:28|NO.13457


winobj "SysListView32","ListView",0,0x10000000|0x40000000|0x0001,x,y,0,0
¤ÇºîÀ®¤·¤¿¾ÜºÙɽ¼¨¤Î¥ê¥¹¥È¥Ó¥å¡¼(¥Ï¥ó¥É¥ë¤Ïhlist)¤Ësendmsg¤Ç
LVM_SORTITEMS¡Ê0x1030)¥á¥Ã¥»¡¼¥¸¤òÁ÷¿®¤·¤Æ¥¢¥¤¥Æ¥à¤Î¥½¡¼¥È¤ò»î¤ß¤¿¤Î¤Ç¤¹¤¬¡¢


sendmsg hlist,0x1030,0,0
¤Ç¤Ï°ìÈÖº¸¤ÎÎó¤ò´ð½à¤Ë¾º½ç¥½¡¼¥È¤È¤Ê¤ê¤Þ¤·¤¿¡£

¤³¤³¤«¤é¹ß½ç¥½¡¼¥È¤Ê¤É¤ò¹Ô¤¦¤¿¤á¡¢wParam¤älParam¤ÎÃͤòÏ®¤Ã¤Æ¤ß¤¿¤Î¤Ç¤¹¤¬¡¢
wParam¤ÎÃͤòÊѲ½¤µ¤»¤Æ¤â·ë²Ì¤ËÆäËÊѲ½¤¬¤Ê¤¯¡¢lParam¤Ï0°Ê³°¤Ç¤Ï¥·¥¹¥Æ¥à¥¨¥é¡¼¤È
¤Ê¤Ã¤Æ¤·¤Þ¤¤¤Þ¤·¤¿¡£

»ñÎÁ¤òÄ´¤Ù¤¿¤È¤³¤í¡¢HSP¤Î»ñÎÁ¤Ç¤Ï¤Ê¤¤¤â¤Î¤Î¡¢
http://www.kumei.ne.jp/c_lang/sdk2/sdk_110.htm
¤Ë¥ê¥¹¥È¥Ó¥å¡¼¤Î¥½¡¼¥È¤Ë¤Ä¤¤¤Æ½ñ¤«¤ì¤Æ¤ª¤ê¡¢
¤Þ¤¿¡¢Ê̤λñÎÁ
http://www.interq.or.jp/chubu/r6/masm32/tute/tute031_Jp.html
¤è¤ê
wParam = lParamSort
lParam = pCompareFunction
¤È¤¤¤¦¤³¤È¤â½ñ¤«¤ì¤Æ¤¢¤ê¤Þ¤·¤¿¡£

»ñÎÁ¤òÆɤ߿ʤá¤Æ¤¤¤¯¤È¤É¤¦¤ä¤épCompareFunction¤È¤¤¤¦¤Î¤ÏÈæ³Ó´Ø¿ô¤Î¥Ý¥¤¥ó¥¿
¤é¤·¤¤¤Î¤Ç¤¹¤¬¡¢#defcfunc¤Ë¤è¤êÈæ³Ó´Ø¿ô¤òºî¤Ã¤Ælibptr¤ò¤Ä¤¯¤Ã¤ÆlParam¤Ë¤¤¤ì¤Æ¤â
¤ä¤Ï¤ê¥·¥¹¥Æ¥à¥¨¥é¡¼¤Î¤Þ¤Þ¤Ç¤¹¡£

¥½¡¼¥¹¾å¤Ëstop¤Ê¤É¤òÆþ¤ì¤Æ¥¨¥é¡¼¾ì½ê¤òÄ´¤Ù¤Æ¤ß¤¿¤È¤³¤í¡¢¤É¤¦¤ä¤élParam¤ÎÃͤË
ÌäÂ꤬¤¢¤ë¤è¤¦¤Ç¤¹¡£(Èæ³Ó´Ø¿ô°ÊÁ°¤ÎÌäÂê¤é¤·¤¤)

¤½¤Î¸å¤â¥Í¥Ã¥È¤Ç¿§¡¹¤ÈÄ´¤Ù¤Æ¤ß¤¿¤Î¤Ç¤¹¤¬¡¢¤¤¤Þ¤À¤Ë²ò·è¤Ç¤­¤Æ¤¤¤Þ¤»¤ó¡£
¤É¤¦¤¹¤ì¤Ð¹ß½ç¤Ê¤É¤ò¹Ô¤¨¤ë¤è¤¦¤Ë¤Ê¤ë¤Î¤Ç¤·¤ç¤¦¤«¡©
°Ê²¼¡¢¼Â¸½¤·¤è¤¦¤È¤·¤Æ¤¤¤¿¥½¡¼¥Èµ¡Ç½
­¡¾º½ç¡¦¹ß½ç¤Î¥½¡¼¥È
­¢Ç¤°Õ¥µ¥Ö¥¢¥¤¥Æ¥à¤Ç¥½¡¼¥È



¤³¤Îµ­»ö¤ËÊÖ¿®¤¹¤ë


eller

¥ê¥ó¥¯

2008/2/8(Fri) 10:22:59|NO.13461

sin¤µ¤ó¡¢¤³¤ó¤Ë¤Á¤Ï¡£¤ª¤â¤·¤í¤½¤¦¤ÊÂêºà¤À¤Ã¤¿¤Î¤ÇÄ´¤Ù¤Æ¤ß¤Þ¤·¤¿¡£

´Ø¿ô¤Î¥¢¥É¥ì¥¹¤òÅϤ¹ÊýË¡¤Ç¤¹¤¬¡Ê»ä¼«¿È¾Ü¤·¤¯¤Ï¤Ê¤¤¤Î¤Ç¼«¿®¤Ï¤¢¤ê¤Þ¤»¤ó¡Ë¡¢¥Ø¥ë¥×¤Ë¤è¤ì¤Ðlibptr()¤ÇÆÀ¤é¤ì¤ëÃͤϡÖSTRUCTDAT¹½Â¤ÂΤΥ¢¥É¥ì¥¹¡×¤Ç¤¢¤Ã¤Æ¡¢´Ø¿ô¼«ÂΤΥ¢¥É¥ì¥¹¤Ç¤Ï¤Ê¤¤¤½¤¦¤Ç¤¹¡£
¤â¤Á¤í¤ó¥æ¡¼¥¶¡¼ÄêµÁÌ¿Îá¤Ëvarptr()¤ÏÍøÍѤǤ­¤Ê¤¤¤Î¤Ç¡¢¤Á¤ç¤¯¤È¤µ¤ó¤Îhscallbk.dll¤òÍøÍѤ¹¤ë¤Î¤¬°ìÈÖ´Êñ¤Ç¤Ï¤Ê¤¤¤«¤È»×¤¤¤Þ¤¹¡£
http://yokohama.cool.ne.jp/chokuto/download/index.html#hscallbk
DLL¤ÎÍøÍÑÊýË¡¤ÏÉÕ°¥Æ¥­¥¹¥È¤ò¤´Í÷¤¯¤À¤µ¤¤¡£

ÌäÂê¤Î¹ß½ç¥½¡¼¥È¤Ç¤¹¤¬¡¢LVM_SORTITEMS¤è¤ê¤âLVM_SORTITEMSEX¤òÍøÍѤ·¤¿Êý¤¬ÌÜŪ¤Î¥×¥í¥°¥é¥à¤ò¼Â¸½¤·¤ä¤¹¤¤¤è¤¦¤Ç¤¹¡£
LVM_GETITEMTEXTA¥á¥Ã¥»¡¼¥¸¤òÍøÍѤ·¤ÆǤ°Õ¤Î¥¢¥¤¥Æ¥à¡¦¥µ¥Ö¥¢¥¤¥Æ¥à¤Î¥Æ¥­¥¹¥È¤ò¼èÆÀ¤·¡¢¤½¤Î2¤Ä¤òÈæ³Ó¤¹¤ë´Ø¿ô¡Ê¾åµ­DLL¤òÍøÍѤ¹¤ë¾ì¹ç¤Ï¥µ¥Ö¥ë¡¼¥Á¥ó¡Ë¤òÍÑ°Õ¤¹¤ë¤À¤±¤Ç¼Â¸½¤Ç¤­¤Þ¤·¤¿¡£

µÞ¤®¤Çºî¤Ã¤¿Êª¤Ç¥â¥¸¥å¡¼¥ë²½¤Ê¤É¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¤¬¡¢°ì±þÆ°ºî¤¹¤ë¥¹¥¯¥ê¥×¥È¤òºÜ¤»¤Æ¤ª¤­¤Þ¤¹¡£
DLL¤ÎÍøÍÑË¡¤ä³Æ¥á¥Ã¥»¡¼¥¸¤ÎÍøÍÑÎã¤È¤·¤ÆÌòΩ¤Æ¤Æ¤¯¤À¤µ¤¤¡£

// »²¹Í»ñÎÁ¡§ // ¥ê¥¹¥È¥Ó¥å¡¼¤òºîÀ®¤·¤Æ¤ß¤ë // http://yokohama.cool.ne.jp/chokuto/urawaza/listview1.html // Windows32 API Constance ¸¡º÷ // http://hspnext.com/tool/hsptool04.htm // MSDN - LVM_SORTITEMSEX // http://msdn2.microsoft.com/ja-jp/library/bb761055(en-us).aspx #include "hscallbk.as" #uselib "" #func sort_items "" int, int, int #define LVM_SETITEM $00001006 #define LVM_INSERTITEM $00001007 #define LVM_INSERTCOLUMN $0000101B #define LVM_SORTITEMSEX $00001051 #define LVM_GETITEMTEXTA $0000102D #define LVS_REPORT $00000001 #define WS_EX_NOPARENTNOTIFY $00000004 #define WS_VISIBLE $10000000 #define WS_CHILD $40000000 // µ¿»÷Ū¤Ê¡Ö¥Õ¥¡¥¤¥ë¡×¤Î¿ô #define NUM_FILES 10 randomize gosub *createGuiObjects setcallbk proc, sort_items, *sort stop // ¥µ¥Ö¥¢¥¤¥Æ¥à¡Ê¥Õ¥¡¥¤¥ë¥µ¥¤¥º¡Ë¤Ç¥½¡¼¥È // Âè2°ú¿ô¤¬0¤Ê¤é¾º½ç¡¢1¤Ê¤é¹ß½ç *sort lvitem.2 = 1 // ¥µ¥Ö¥¢¥¤¥Æ¥à¤òÂоݤȤ¹¤ë sortmode = callbkarg(2) & 1 repeat 2 lvitem.5 = varptr(item_name(cnt)) sendmsg objinfo_hwnd(id_list), LVM_GETITEMTEXTA, callbkarg(cnt^sortmode), varptr(lvitem) loop return int(item_name(0)) - int(item_name(1)) // ¥Ü¥¿¥ó¥¯¥ê¥Ã¥¯¤Ë¤è¤Ã¤Æ¸Æ¤Ó½Ð¤µ¤ì¤ë¥µ¥Ö¥ë¡¼¥Á¥ó *sort_asc sendmsg objinfo_hwnd(id_list), LVM_SORTITEMSEX, 0, varptr(proc) return *sort_desc sendmsg objinfo_hwnd(id_list), LVM_SORTITEMSEX, 1, varptr(proc) return // ¥Ü¥¿¥ó¤È¥ê¥¹¥È¥Ó¥å¡¼¤ÎºîÀ® *createGuiObjects // ¥Ü¥¿¥ó¤òºîÀ® objsize ginfo_winx / 2, 32 button gosub "¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤Ç¾º½ç¤Ë¥½¡¼¥È", *sort_asc pos ginfo_winx / 2, 0 : button gosub "¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤Ç¹ß½ç¤Ë¥½¡¼¥È", *sort_desc // ¥ê¥¹¥È¥Ó¥å¡¼¥³¥ó¥È¥í¡¼¥ëºîÀ® w = ginfo_winx : h = ginfo_winy - 32 style = WS_VISIBLE | WS_CHILD | LVS_REPORT pos 0, 32 winobj "SysListView32", "ListView", WS_EX_NOPARENTNOTIFY, style, w, h, 0, 0 id_list = stat // ¥«¥é¥à¤òÄɲà dim lvcolumn, 8 lvcolumn.0 = 0x000F lvcolumn.2 = 100 column_name = "¥Õ¥¡¥¤¥ë̾", "¥Õ¥¡¥¤¥ë¥µ¥¤¥º" repeat 2 lvcolumn(3) = varptr(column_name(cnt)) sendmsg objinfo_hwnd(id_list), LVM_INSERTCOLUMN, cnt, varptr(lvcolumn) if stat == -1 { dialog "¥«¥é¥à¤ÎÄɲä˼ºÇÔ", 1 end } loop // ¥¢¥¤¥Æ¥à¤ÎÄɲà dim lvitem, 13 sdim item_name, 64, 2 lvitem.0 = 0x0001 lvitem.6 = 64 repeat NUM_FILES item_name = "¥Õ¥¡¥¤¥ë" + cnt lvitem.1 = cnt lvitem.5 = varptr(item_name) sendmsg objinfo_hwnd(id_list), LVM_INSERTITEM, 0, varptr(lvitem) if stat == -1 { dialog "¥¢¥¤¥Æ¥à¤ÎÄɲä˼ºÇÔ", 1 end } loop // ¥µ¥Ö¥¢¥¤¥Æ¥à¤ÎÄɲà repeat NUM_FILES item_name = "" + rnd(1000) + " KB" lvitem.1 = cnt lvitem.2 = 1 lvitem.5 = varptr(item_name) sendmsg objinfo_hwnd(id_list), LVM_SETITEM, 0, varptr(lvitem) if stat == -1 { dialog "¥µ¥Ö¥¢¥¤¥Æ¥à¤ÎÄɲä˼ºÇÔ", 1 end } loop return



sin

¥ê¥ó¥¯

2008/2/8(Fri) 23:50:48|NO.13467

eller¤µ¤ó¡¢²óÅú¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£

¤³¤ì¤Þ¤Ç¤Ë¤â¥³¡¼¥ë¥Ð¥Ã¥¯´Ø¿ô¤Ë¤Ä¤¤¤Æ¤Ï¡¢°ÊÁ°¤Î»ñÎÁÆâ¤Ç¤â½Ð¤Æ¤­¤¿¤¿¤á¡¢°ìÅ٤ϼê¤ò½Ð¤·¤Æ¤Ï
¤¤¤¿¤Î¤Ç¤¹¤¬¡¢Íý²ò¤¬Çö¤«¤Ã¤¿¤¿¤áľÀÜ¥¨¥é¡¼²ò¾Ã¤È¤Ï¤Ê¤Ã¤Æ¤¤¤Þ¤»¤ó¤Ç¤·¤¿¡£
¤É¤¦¤ä¤é¡¢¸µ¡¹¥â¥¸¥å¡¼¥ë²½¤·¤Æ¤¤¤¿¤â¤Î¤Ë¥½¡¼¥Èµ¡Ç½¤òÉղ乤ëºÝ¡¢setcallbk¤ÎÀë¸À¾ì½ê¤¬°­¤¯
¤³¤ì¤¬¼Â¹Ô¤µ¤ì¤ëÁ°¤Ësendmsg¤ò¹Ô¤Ã¤Æ¤¤¤¿¤Î¤¬¥¨¥é¡¼¸¶°ø¤À¤Ã¤¿¤è¤¦¤Ç¤¹Ž¥Ž¥Ž¥

eller¤µ¤ó¤Î¥µ¥ó¥×¥ë¤ò»²¹Í¤Ë²þ¤á¤Æ¼«Ê¬¤Î¥×¥í¥°¥é¥à¤ò²þÎɤ·¤¿·ë²Ì¡¢²¿¤È¤«¥½¡¼¥È¤ò¹Ô¤¨¤ë
¤è¤¦¤Ë¤Ê¤ê¤Þ¤·¤¿¡£
ËÜÅö¤Ë¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£



ONION software Copyright 1997-2023(c) All rights reserved.