易截截图软件、单文件、免安装、纯绿色、仅160KB

VB获取窗口地址栏内容

http://zhidao.baidu.com/question/84802747.html
VB如何获取窗口地址栏内容
就是比如我打开D盘的aaa文件夹,窗口地址栏就是显示D:\aaa,请问我要怎么用VB写程序来获取窗口地址栏的内容?(不是IE的地址栏)
若打开了两个窗口,比如D盘的aaa文件夹和E盘的bbb文件夹下的ccc文件夹都打开的话,点击command1,text1就显示:
D:\aaa
E:\bbb\ccc
请大家帮忙下,谢谢!
Private Const GW_HWNDNEXT = 2
Private Const GW_HWNDFIRST = 0
Private Const WM_GETTEXT = &HD
Private Declare Function GetNextWindow Lib "user32" Alias "GetWindow" (ByVal hwnd As Long, ByVal wFlag As Long) As Long
Private Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long
Private Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) As Long
Private Function GetWindowList() As String
Dim hwnd As Long
Dim s As String
hwnd = Me.hwnd
hwnd = GetWindow(hwnd, GW_HWNDFIRST)
While hwnd <> 0
s = String(256, Chr(0))
GetClassName hwnd, s, 255
s = Replace(s, Chr(0), "")
If s = "CabinetWClass" Then
GetWindowList = GetWindowList & GetUrl(hwnd) & vbCrLf
End If
hwnd = GetNextWindow(hwnd, GW_HWNDNEXT)
Wend
End Function
Private Function GetUrl(hwnd As Long) As String
Dim NexthWnd As Long
Dim s As String
NexthWnd = 0
NexthWnd = FindWindowEx(hwnd, NexthWnd, vbNullString, vbNullString)
While NexthWnd <> 0
s = String(256, Chr(0))
GetClassName NexthWnd, s, 255
s = Replace(s, Chr(0), "")
If s = "Edit" Then


相关文档:

vb批量打印数据库中的照片

Private Sub Command12_Click()
Dim i As Integer
On Error GoTo ABC
ShowPrinterSetup Me
For i = 1 To Adodc1.Recordset.RecordCount
If Picture2.Picture <> LoadPicture("") Then
  
    Printer.PaintPicture Picture2.Picture, 200, Picture1.Top + 1000
Else
   ......

让VB菜鸟最快写出自己的外挂

这年头,在这个论坛里面已经没有什么技术贴了...呵呵~发一篇惊天地,泣鬼神的帖子.当然这个只是模拟键盘的终极模拟.呵呵~
     键盘是我们使用计算机的一个很重要的输入设备了,即使在鼠标大行其道的今天,很多程序依然离不开键盘来操作。但是有时候,一些重复性的,很繁琐的键盘操作总会让人疲惫,于是 ......

MYSQL存储过程VB调用方法。

Private Sub Command1_Click()
   
    Dim MyComm As New ADODB.Command      '定义一个命令对象
    Dim Rs_GetList As New ADODB.Recordset '定义一个记录集对象
    Dim param As ADODB.Parameter     ......

vb建立 VPN 拨号连接

建立 VPN 拨号全部代码如下:
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)
Private Type GUID
    Data1 As Long
    Data2 As Integer
    Data3 As Integer
    ......

使用VB创建PPPoE以及VPN拨号连接的核心代码

Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)
Private Type GUID
    Data1   As Long
    Data2   As Integer
    Data3   As Integer
 &nbs ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号