1. 2009. 10. 29. 20:21 프로그래밍 언어/Basic

'API 부분
Public Declare Function FindWindowEx Lib "user32.dll" Alias "FindWindowExW" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As Long, ByVal lpsz2 As Long) As Long
Public Declare Function SendMessage Lib "user32.dll" Alias "SendMessageW" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Public Const WM_GETTEXT As Long = &HD
Public Const WM_GETTEXTLENGTH As Long = &HE

'코드부분
Dim wTitle As String, wLength As Long
Do
hWnd = FindWindowEx(0&, hWnd, StrPtr("ThunderRT6FormDC"), StrPtr(vbNullString))
wLength = SendMessage(hWnd, WM_GETTEXTLENGTH, 0&, 0&)
wTitle = Space$(wLength)
Call SendMessage(hWnd, WM_GETTEXT, wLength+vbnull, StrPtr(wTitle))
If InStr(vbNull, wTitle, "캡션중 단어", vbTextCompare) > 0 Then
  MsgBox hWnd & " - " & wTitle
  hWnd = 0
End If
Loop While hWnd

Posted by Nightly Luna
,
® © Tanny Tales
/ rss