|
-
Apr 28th, 2006, 12:47 PM
#1
Thread Starter
Frenzied Member
VB6 Switching Focus
how do you find the name of a window you want to change focus to?
-
Apr 28th, 2006, 12:52 PM
#2
Re: VB6 Switching Focus
 Originally Posted by joefox
how do you find the name of a window you want to change focus to?
Take a look at this link
Regards,
Mark
Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."
-
Apr 28th, 2006, 12:56 PM
#3
Re: VB6 Switching Focus
 Originally Posted by Mark Gambo
If you aren't a member you can't view the solution.
-
Apr 28th, 2006, 01:06 PM
#4
Re: VB6 Switching Focus
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.
Regards,
Mark
Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."
-
Apr 28th, 2006, 03:18 PM
#5
Thread Starter
Frenzied Member
Re: VB6 Switching Focus
How do i find the name of the form? do i use spy ++?
this is what i found in spy++
Last edited by joefox; Apr 28th, 2006 at 03:23 PM.
-
Apr 28th, 2006, 03:19 PM
#6
Re: VB6 Switching Focus
name of a form in your app or some others apps form ??
__________________
________________0îîî___
___îîî0________(___)____
__(___)_________) _/_____
___\_ (_________(_/______
____\_)_________________
-
Apr 28th, 2006, 03:56 PM
#7
Thread Starter
Frenzied Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|