CSDN博客

img wanyuehan

如何用GetWindow函数来列举桌面上的窗口

发表于2004/12/31 9:14:00  960人阅读

Dim RenHWND As Integer, WinText As String * 256
     t% = 0: lstWindows.Clear
     RenHWND = GetWindow(frmTop.hWnd, GW_HWNDFIRST)
     Do
     i% = GetWindowText(RenHWND, WinText, 256)
     If i% <> 0 Then
     l% = GetWindowTextLength(RenHWND)
     If Left$(WinText, l%) <> frmTop.Caption And Left$(WinText, l%) <> App.Title Then
     lstWindows.AddItem WinText: ReDim Preserve winHWND(t%) As Integer
     winHWND(t%) = RenHWND: t% = t% + 1
     End If
     End If
     RenHWND = GetWindow(RenHWND, GW_HWNDNEXT)
     Loop Until RenHWND = 0
     lstWindows.ListIndex = 0
0 0

相关博文

我的热门文章

img
取 消
img即使是一小步
也想与你分享
打开
img