Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

VBΪ×Ô¼ºµÄ³ÌÐòÉ趨ÏûÏ¢(¿É½ÓÊÕ´¦Àí)


VBΪ×Ô¼ºµÄ³ÌÐòÉ趨ÏûÏ¢(¿É½ÓÊÕ´¦Àí)
Posted by JiaJia 5 March,2009 (0)Comment
¡¡¡¡ÓÃAPIº¯Êý SetWindowLong Ö¸¶¨´¦ÀíÏûÏ¢µÄ´°¿Ú¹ý³ÌΪ×Ô¶¨ÒåµÄº¯Êý WindowProc£¬²¶»ñÏûÏ¢IDΪ WM_USER+1 µÄ×Ô¶¨ÒåÏûÏ¢»òϵͳÏûÏ¢¡£²¢ÇÒ£¬ÎªÁ˱£Ö¤´°¿ÚÄÜÕýÈ·µÄÏìÓ¦ÏûÏ¢£¬ÐèÒª±£´æÔ­À´Ä¬ÈϵĴ°¿Ú¹ý³Ì²¢ÔÚ×Ô¶¨Ò庯ÊýWindowProcÖе÷Óá£ÈçÏÂÀý£¬ÔÚ°´Å¥Ê¼þÖз¢ËÍ×Ô¶¨ÒåÏûÏ¢£¬WindowProc ²¶»ñÁË´°¿Ú´óС±ä»¯µÄϵͳ¶¨ÒåÏûÏ¢ºÍÓû§×Ô¶¨ÒåµÄÏûÏ¢²¢ÏÔʾÓû§×Ô¶¨ÒåµÄÏûÏ¢²ÎÊý wParam¡£
Form ²¿·Ö´úÂë
Private Sub Command1_Click()
Dim wParam As Long
Dim lParam As Long
Dim lResult As Long
¡¡wParam = 12345
¡¡lResult = SendMessage(Me.hwnd, WM_USER + 1, wParam, lParam)
End Sub
Private Sub Form_Load()
¡¡Me.Tag = Hook(Me.hwnd)
End Sub
Private Sub Form_Unload(Cancel As Integer)
¡¡Unhook Me.hwnd, Me.Tag
End Sub
Mod ²¿·Ö´úÂë
Option Explicit
Private Declare Function CallWindowProc Lib "user32" Alias _
"CallWindowProcA" (ByVal lpPrevWndFunc As Long, _
ByVal hwnd As Long, ByVal Msg As Long, _
ByVal wParam As Long, ByVal lParam As Long) As Long
Public Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" _
(ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias _
"SetWindowLongA" (ByVal hwnd As Long, _
ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Public Declare Function SendMessage Lib "user32" Alias _
"SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, _
ByVal wParam As Long, lParam As Any) As Long
Private Const GWL_WNDPROC = -4
Public Const GWL_USERDATA = (-21)
Public Const WM_SIZE = &H5
Public Const WM_USER = &H400
Public Function Hook(ByVal hwnd As Long) As Long
¡¡Dim pOld As Long
'Ö¸¶¨×Ô¶¨ÒåµÄ´°¿Ú¹ý³Ì
¡¡pOld = SetWindowLong(hwnd, GWL_WNDPROC, AddressOf WindowProc)
'±£´æÔ­À´Ä¬ÈϵĴ°¿Ú¹ý³ÌÖ¸Õë
¡¡SetWindowLong hwnd, GWL_USERDATA, pOld
¡¡Hook = pOld
End Function
Public Sub Unhook(ByVal hwnd As Long, ByVal lpWndProc As Long)
¡¡Dim temp As Long
¡¡'×¢ÊÍ£ºCease subclassing.
¡¡temp = SetWindowLong(hwnd, GWL_WNDP


Ïà¹ØÎĵµ£º

µÁ°æ±äÕý°æʽµÄÒ»¶ÎVB³ÌÐò!!~

°ÑÏÂÃæµÄ´úÂë Õ³Ìùµ½Îı¾
ON ERROR RESUME NEXT
Dim VOL_PROD_KEY
if Wscript.arguments.count<1 then
VOL_PROD_KEY=InputBox("Powered By www.cnbeta.com"&vbCr&vbCr&" ±¾³ÌÐò½«×Ô¶¯Ìæ»»Ä㵱ǰ Windows µÄÐòÁкÅ,ͨ¹ý΢ÈíÑéÖ¤ÍêÈ«Õý°æ¡£"&vbCr&vbCr&"ÐòÁкÅ(OEM°æÎÞЧ,ĬÈϰ汾Ϊ XP VLK)£ ......

VB StrConvº¯Êý

StrConvº¯Êý
·µ»Ø°´Ö¸¶¨ÀàÐÍת»»µÄ Variant (String)¡£
Óï·¨
StrConv(string, conversion, LCID)
StrConv º¯ÊýµÄÓï·¨ÓÐÏÂÃæµÄÃüÃû²ÎÊý£º
²¿·Ö
˵Ã÷
string
±ØÒª²ÎÊý¡£Òª×ª»»µÄ×Ö·û´®±í´ïʽ¡£
conversion
±ØÒª²ÎÊý¡£Integer¡£ÆäÖµµÄºÍ¾ö¶¨×ª»»µÄÀàÐÍ¡£
LCID
¿ÉÑ¡µÄ¡£Èç¹ûÓëϵͳLocaleID²»Í¬£¬ÔòΪLocaleID£¨ÏµÍ³ ......

ÌÖÂÛVBÖеĽṹÌå

ÌÖÂÛVBÖеĽṹÌå[תÔØ]
2009Äê10ÔÂ20ÈÕ ÐÇÆÚ¶þ 11:30
VBÀïÃæµÄ½á¹¹ÌåÊÇÒ»ÖÖWORD/DWORD¶ÔÆëµÄ½á¹¹Ì壬ÕâÒ»µãÔÚ±à³ÌÖÐÓÈÆäҪעÒ⣬Èç¹ûÊÇ´¿VB±à³Ì£¬Ôò½á¹¹ÌåµÄ¸÷¸öÓòÈçºÎÅÅÁпÉÒÔ»ù±¾²»ÓùØÐÄ£¬
¶øÈç¹ûÊǵ÷ÓÃAPI»òÕßÊǵ÷ÓÃÆäËûµÄ¶¯Ì¬Á´½Ó¿â£¬ÔòºÜÈÝÒ׳öÎÊÌ⣬ԭÒò¾ÍÔÚÓÚ£ºÕâЩ¶¯Ì¬Á´½Ó¿âÊÇÓÃC/C++дµÄ£¬¶ø´ó²¿·ÖC/C++»·¾³ ......

ÈçºÎÓÃVBд°²È«¿Ø¼þ

×ÜÊö
±¾ÎÄÐðÊöÁËÈçºÎÔÚVBÖÐʵÏֿؼþµÄIobjectSafety½Ó¿Ú£¬ÒÔ±êÖ¾¸Ã¿Ø¼þÊǽű¾°²È«ºÍ³õʼ»¯°²È«µÄ¡£VB¿Ø¼þĬÈϵĴ¦Àí·½Ê½ÊÇÔÚ×¢²á±íÖÐ×¢²á×é¼þÀàÀ´±êʶÆ䰲ȫÐÔ£¬µ«ÊµÏÖIobjectSafety½Ó¿ÚÊǸüºÃµÄ·½·¨¡£±¾ÑÔÓï°üÀ¨ÁËʵÏÖ¹ý³ÌÖÐËùÐèµÄËùÓдúÂë¡£
Çë×¢Ò⣬¿Ø¼þÖ»ÓÐȷȷʵʵÊÇ°²È«µÄ£¬²ÅÄܱ»±êʶΪ“°²È«µÄ”¡£±¾ ......

VB¶ÁдINIÎļþ

  '******************************************************************************************
'* ÐèҪעÒâµÄÎÊÌâ *
'******************************************************************************************
'1.INIÎļþµÄ· ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ