-
Hi...
I have a little problem:
I cant set focus on object which is NOT located on the form.
Let's say I run the program EXTERNAL.EXE, it has 3 objects on its form. When I set focus on the EXTERNAL form, I can set focus with TAB on these 3 objects.
Let's say I wanna set focus on object with TabIndex=1 located at the EXTERNAL.EXE form,
How do I do this with a VB program?
-
If you ca find out its hWnd then you can use the setFocus API
Code:
Private Declare Function SetFocus Lib "user32" Alias "SetFocus" (ByVal hwnd As Long) As Long
but I'm not sure how Tabindex's are handled (I don't thinks it's Window's reponsibility to do the tapping, I think it's the programs, which would make it very hard)
but you could try setting the focus to the parent window of all the controls, that will probably get you to the first item in the taborder.