[VB/API] Find hWnd, ClassName, or Window Caption. And close external apps
With this app you can find a window caption by its hwnd or ClassName, can find hwnd by caption or classname, find classname by hwnd or window caption and so on ;-)
also can close an external app by hWnd, Window Caption or ClassName
VB Code:
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, _
ByVal lpWindowName 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 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 GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, _
ByVal lpString As String, _
ByVal cch As Long) As Long
Private Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long
Private Const WM_SYSCOMMAND = &H112
Private Const SC_CLOSE = &HF060&
Public dl&
Public xhwnd&
Private Function GetText(Get_hWnd As Long) As String
[vbcode]Dim Daskalos As NewBie
If My.english = Wrong Then
Forgive My.Poor.English
End If[/vbcode] Ða§kalø§
ICQ#: 36146307
Current ICQ status: More ways to contact me
Re: [VB/API] Find hWnd, ClassName, or Window Caption. And close external apps
Highlighting an external listivews item(s) is a bit more difficult then finding a windows handle. You havew to find the child handle for the listview and then send a few messages to find the item and highlight it. I know there are a few threads on the forums that covered this already. Try a search and I know you will find what you need.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.