Send keys to vb6
You may need to provide more details. But IF you are trying to send an input key to a VB6 application and it does not pick it up as usual, the fact that the KeyPreview property for the form is not true. No control with current focus absorbs the pressed keystroke.
If you've created an app that receives an enter key. I highly recommend that you refactor your application so that any code that runs by typing can be executed with code. This is usually done by moving the code to an area that is accessible to both applications. This is because Sendkeys are not known to be deterministic and can cause a lot of weirdness.
There is a key element you can use from the Win32 API information here I found it more reliable than SendKeys.
source to share
I made an application for testing vb6. with 1 shape, 1 default button, 1 timer:
Private Sub Command1_Click()
Debug.Print CStr(Now) + " Command1"
End Sub
Private Sub Timer1_Timer()
Debug.Print CStr(Now) + " Sendkeys"
SendKeys "{Enter}"
End Sub
It seemed like it worked when sending in itself. 11/30/2008 18:11:38 Sendkeys 11/30/2008 6:11:48 PM Command1 11/30/2008 18:11:43 Send 11/30/2008 6:11:48 PM Sendkeys 11 / 30/2008 6:11:48 PM Command1
Do you want to submit another process?
source to share
You can try my PushKeys program which is available here . It is syntax compatible with SendKeys, but uses the keybd_event API and has a built in sleep function.
source to share
There are problems with SendKeys in Vista. See this article by Karl Peterson for details and solutions.
source to share