how do you find the name of a window you want to change focus to?
Printable View
how do you find the name of a window you want to change focus to?
Quote:
Originally Posted by joefox
Take a look at this link
If you aren't a member you can't view the solution.Quote:
Originally Posted by Mark Gambo
Ok:
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, lParam As Any) As Long Private Const WM_CLOSE = &H10 Private Sub Form_Load() Dim lngHwnd As Long lngHwnd = FindWindow(vbNullString, "MyApp") SendMessage lngHwnd, WM_CLOSE, 0, 0 End End Sub
But you will have to know the name of form inorder to use this code.
How do i find the name of the form? do i use spy ++?
this is what i found in spy++
http://img138.imageshack.us/img138/8...titled6ql1.jpg
name of a form in your app or some others apps form ??
Hummmm ?!?!?!?!