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”µÄ³É¼û£¡
µ±È»£¬ÎÒÒ²ÔçÓÐÔ¤ÆÚ£¬´ËÑÔÒ»³ö±ØÈ»ÕÐÖ²»Ã÷ÕæÏàµÄȺÖڵēΧ¹¥”£¬È»¶ø£¬ÎÒ»¹ÊÇÒª¼ ......
Try
Dim Path As String = Server.MapPath("~/Download/") 'Îļþ·¾¶
Path = Path & "file.txt" 'ÎļþµÄÃû³Æ
......
'¹¤³Ì-->ÒýÓà Ìí¼Ó Microsoft activex data objects 2.5 library
'¹¤³Ì-->²¿¼þ Ìí¼Ó Microsoft flexgrid control 6.0
Dim Cnn As New ADODB.Connection
Cnn.ConnectionString = "Provider=microsoft.jet.oledb.4.0;data source=E:\Access ......
Private Function NMoneyToSMoney ( NMoney As Variant ) As String
If IsNumeric ( NMoney ) = False Then
NMoneyToSMoney = "²»ÊÇÊý×ÖÀ ......
VB Winsock StateÊôÐÔÖµ
'winsock ״̬³£Êý
'sckClosed 0 ¹Ø±Õ״̬
'sckOpen 1 ´ò¿ª×´Ì¬
'sckListening 2 ÕìÌý״̬
'sckConnectionPending 3 Á¬½Ó¹ÒÆð
'sckResolvingHost 4 ½âÎöÓòÃû
'sckHostResolved 5 ÒÑʶ±ðÖ÷»ú
'sckConnecting 6 ÕýÔÚÁ¬½Ó
'sckConnected 7 ÒÑÁ¬½Ó
'sckClosing 8 ͬ¼¶ÈË ......