´ 新建一个 activex dll 工程,名称 smartsubclasslib
´ ---------------------------------------------------- 【相关文章:经典人生故事 2】
´ 以下代码放在标准模块里,模块名 msmartsubclass 【扩展阅读:必须认清楚BLOG的两个方向?】
´ module msmartsubclass 【扩展信息:在 Linux 下编译 lame-3.9】 ´ ´ version... 1.0 ´ date...... 24 april 2001 ´ ´ copyright (c) 2001 andr閟 pons (andres@vbsmart.com) ´ ----------------------------------------------------´api declarations:
option explicitpublic const ssc_oldproc = "ssc_oldproc"
public const ssc_objaddr = "ssc_objaddr"private declare function getprop lib "user32" alias "getpropa" ( _
byval hwnd as long, _ byval lpstring as string) as longprivate declare sub copymemory lib "kernel32" alias "rtlmovememory" ( _
destination as any, _ source as any, _ byval length as long)´
´ function startsubclasswindowproc() ´ ´ this is the first windowproc that receives messages ´ for all subclassed windows. ´ the aim of this function is to just collect the message ´ and deliver it to the right smartsubclass instance. ´ public function smartsubclasswindowproc( _ byval hwnd as long, _ byval umsg as long, _ byval wparam as long, _ byval lparam as long) as longdim lret as long
dim osmartsubclass as smartsubclass´get the memory address of the class instance...
lret = getprop(hwnd, ssc_objaddr) if lret <> 0 then ´osmartsubclass will point to the class instance ´without incrementing the class reference counter... copymemory osmartsubclass, lret, 4 ... 下一页