下你所需,载你所想!
汇集开发技术源码资料

鼠标进入离开事件源代码

:48.808KB :1 :2019-12-28 06:15:30

部分简介

核心代码参考来源于易语言源码网,可惜现在不能下载任何代码了,调用了大神的哈希表模块。

hHeap = _PtrGet (hHashTable, #ht_hHeap)
oldCapacity = _PtrGet (hHashTable, #ht_tableLenth) ' ht.tableLenth
oldTable = _PtrGet (hHashTable, #ht_table) ' ht.table
newCapacity = oldCapacity × 2 + 1
newTable = HeapAlloc (hHeap, #HEAP_ZERO_MEMORY, newCapacity × 4)
_inc (hHashTable + #ht_modCount) ' ht.modCount = ht.modCount + 1 更新修改统计数
_PtrSet (hHashTable, #ht_threshold, newCapacity × _指针到小数 (hHashTable + 20)) ' ht.threshold = newCapacity × ht.loadFactor
_PtrSet (hHashTable, #ht_table, newTable) ' ht.table = newTable
_PtrSet (hHashTable, #ht_tableLenth, newCapacity) ' ht.tableLenth = newCapacity
.计次循环首 (oldCapacity, i)
oldpe = _指针到整数 (oldTable + (i - 1) × 4)
.判断循环首 (oldpe ≠ 0)
newpe = HeapAlloc (hHeap, #HEAP_ZERO_MEMORY, #e_size)
RtlMoveMemory (newpe, oldpe, #e_size)
oldpe = _PtrGet (newpe, #e_next) ' e.next
index = 位与 (_PtrGet (newpe, #e_hashCode), 2147483647) % newCapacity ' 计算新的索引
' 插入到新的链表中
_PtrSet (newpe, #e_next, _指针到整数 (newTable + index × 4)) ' e.next = newtable[index]
_PtrSet (newTable, index × 4, newpe) ' newtable[index] = e
.判断循环尾 ()
.计次循环尾 ()
HeapFree (hHeap, 0, oldTable)

鼠标进入离开事件源代码

热门推荐

相关文章