VB ²éÕÒÓÎÏ·´°¿Ú¾ä±úµÄ·½·¨
VB ²éÕÒÓÎÏ·´°¿Ú¾ä±úµÄ·½·¨
ÐÅÏ¢À´Ô´£ººÚ¿Í´úÂë ±à¼£ºroot ä¯ÀÀ´ÎÊý£º191 ¼ÓÈëʱ¼ä£º2010-3-20 1:40:47 ÆÀÂÛ(0)
[ÎÊÌâÒ»,²»ÄÜ»ñµÃ´°¿Ú¾ä±ú]
Ò»°ãѰÕÒ´°¿Ú¾ä±ú¶¼ÊÇÖ±½ÓFindWindow°É,ÕâÑùÊDz»ÐеÄ,QQÈý¹úÔÚÕâЩº¯ÊýÉÏ×öÁËһЩ´¦Àí.ÎÒÀ´¸ø´ó¼Ò˵¸öÍòÄܵķ½·¨°É,
¶ÔÓÚGetWindowText·½·¨ÓÎÏ·¾Í¹Ü²»µ½ÁË,¿ÉÒÔÅäºÏʹÓÃGetWindowÀ´Ã¶¾ÙËùÓеĴ°¿Ú,ÔÙÅжÏö¾ÙµÄ´°¿ÚÀïÃæÊÇ·ñº¬ÓÐÓÎÏ·´°¿Ú±êÌâÎÄ×Ö,
×îºóÈ¡Æä¾ä±ú¾ÍÐÐÁË,ÏÂÃæÎÒ¸ø¶Î´úÂë,Ò²¸ø»¹ÓÐÒÉÎʵÄÅóÓÑһЩ°ïÖú,ÎûÎû!
Option Explicit
Private Declare Function GetDesktopWindow Lib "USER32" () As Long
Private Declare Function GetWindow Lib "USER32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long
Public Declare Function GetWindowText Lib "USER32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Private Const GW_CHILD = 5
Private Const GW_HWNDNEXT = 2
Public Function GetHandle(Title As String) As Long
Dim tmp As String
Dim hwnd As Long
Dim lngProcID As Long
Dim strTitle As String * 255 '//ÓÃÀ´´æ´¢´°¿ÚµÄ±êÌâ
'//È¡µÃ×ÀÃæ´°¿Ú
hwnd = GetDesktopWindow()
'//È¡µÃ×ÀÃæ´°¿ÚµÄµÚÒ»¸ö×Ó´°¿Ú
hwnd = GetWindow(hwnd, GW_CHILD)
'//ͨ¹ýÑ»·À´Ã¶¾ÙËùÓеĴ°¿Ú
Do While hwnd <> 0
'//È¡µÃÏÂÒ»¸ö´°¿ÚµÄ±êÌ⣬²¢Ð´Èëµ½Áбí¿òÖÐ
GetWindowText hwnd, strTitle, Len(strTitle)
If left$(strTitle, 1) <> vbNullChar Then
tmp = left$(strTitle, InStr(1, strTitle, vbNullChar))
If left(tmp, Len(Title)) = Title Then
GetHandle=hwnd
&
Ïà¹ØÎĵµ£º
VBÎÞËù²»ÄÜÖ®Æß£ºVBµÄ¶àỊ̈߳¨1£©
×÷ÕߣºÖÓÉù
ÌâÍâ»°£º
×î½ü£¬Ð´Á˼¸Æª¡¶VBÎÞËù²»ÄÜ¡·ÏµÁУ¬±¾ÏµÁÐÎÄÕµĴ´×÷³õÖÔ¾ÍÊÇҪȥµß¸²ÖÚ¶à³ÌÐòÔ±¶ÔÓÚ“·ÇÃæÏò¶ÔÏó”ÓïÑÔ“VB”µÄ³É¼û£¡
µ±È»£¬ÎÒÒ²ÔçÓÐÔ¤ÆÚ£¬´ËÑÔÒ»³ö±ØÈ»ÕÐÖ²»Ã÷ÕæÏàµÄȺÖڵēΧ¹¥”£¬È»¶ø£¬ÎÒ»¹ÊÇÒª¼ ......
×ö¸ömp3²¥·ÅÆ÷£¬ÓÃrealplayºÍWMP×ö³öÀ´µÄ³ÌÐòÄÚ´æÕ¼ÓÃÌ«´ó¡£
Èç¹ûÄã½ö½öÊDz¥·ÅMP3£¬½¨ÒéʹÓÃAPIº¯ÊýmciSendString¡£
Option Explicit
Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal
lpstrReturnString As String, ByVal uReturnLength As Lo ......
Sub CheckTextCodingType(Textfile)
Set fl = aqFile.OpenBinaryFile(Textfile, aqFile.faRead)
Binary1 = fl.ReadByte()
Binary2 = fl.ReadByte()
fl.Close
select case CStr(Binary1)& CStr(Binary2)
case 255254: '*Unicode (UTF-16) ǰÁ½¸ö×Ö½ÚΪFFFE
Log.Message("fi ......
±¾ÎÄÒý×Ô¡£¸ÐлԴ´£¡http://useway.blog.51cto.com/736087/176913
VBÎÞËù²»ÄÜÖ®Èý£ºVB½Ø»ñWindowsÏûÏ¢µÄ¹³×Ó
——×÷ÕߣºÖÓÉù
²©¿ÍµØÖ·£ºhttp://useway.blog.51cto.com
VBÒ»Ö±±»ÈÏΪÊÇÒ»¸ö¿ÉÒÔͨ¹ý¼òµ¥µÄ·½·¨£¬Íê³ÉWindows½çÃæÓ¦ÓóÌÐòµÄÒ»¸öÓïÑÔ¡£¶ÔWindowsϵͳ·½ÃæµÄ±à³ÌËÆºõÊ× ......