 |
 |

03-17-2003, 05:58 AM
|
|
Newcomer
|
|
Join Date: Mar 2003
Posts: 4
|
|
Help! Waiting until a program loads!
|
I am working on a launcher program. I am using the acitvex list control. When the user runs the laucher it will pull up their list of specified programs and then log the users on. The problem that I am having is I have to wait until the program finishes loading before sending the keystrokes. I have tried a timer but it does not work.. Does anyone have any suggestions??? Please HELP!
|
|

03-17-2003, 07:08 AM
|
 |
Dead dog's ghost
Forum Leader * Expert *
|
|
Join Date: Feb 2001
Location: Celje, Slovenia, Europe
Posts: 2,601
|
|
You should probably check, if the target window is enabled (that would mean it is capable of receiving messages) with IsWindowEnabled API call.
|
__________________
Yes, MSDN comes with VB! Yes, you must have at least 25 post to have an avatar! No, you cant write your OS in VB! and NO, YOU CAN NOT DECOMPILE IT!
I'm sure there are things that are more important than me - I just can't thing of any...
|

03-17-2003, 09:10 AM
|
|
Newcomer
|
|
Join Date: Mar 2003
Posts: 4
|
|
|
etmswindow = IsWindowEnabled(enterprise.hwnd)
is the *.hwnd the actual process or the name of the application in the window??? I have tried to use it but maybe I am doing something wrong...
On Error GoTo ErrHandler
Dim itm As ListItem
Dim ctr As Integer
ctr = 0
For Each itm In lvwApp.ListItems
'If itm.Checked Then
txtStatus = txtStatus & "Launching Application " & itm.text & "... "
ScrollText
On Error Resume Next 'launch the application
Call Shell(arrApp(itm.Index - 1).Path, vbNormalNoFocus)
DoEvents
etmswindow = IsWindowEnabled(etmsprod.hwnd)
If etmswindow <> 0 Then
AppActivate ("Enterprise Trouble Management System")
SendKeys ("{DEL}{DEL} {DEL} {DEL} {DEL} {DEL} {DEL} {DEL} {DEL} {DEL} {DEL} {DEL} {DEL} {DEL} {DEL} {DEL} {DEL} {DEL} {DEL} {DEL} {DEL} ")
SendKeys ("mgress {TAB}")
SendKeys ("password03 {ENTER}")
End If
'End If
If Err.Number <> 0 Then
txtStatus = txtStatus & Err.Description & "." & vbCrLf
Err.Clear
Else
txtStatus = txtStatus & "OK." & vbCrLf
End If
On Error GoTo ErrHandler
ScrollText
Next
ErrHandler:
txtStatus = txtStatus & "Error: " & Err.Description & vbCrLf & "Done."
ScrollText
End Sub
|
|

03-18-2003, 01:15 AM
|
 |
Dead dog's ghost
Forum Leader * Expert *
|
|
Join Date: Feb 2001
Location: Celje, Slovenia, Europe
Posts: 2,601
|
|
What is "etmsprod"? IS it the name of the called application?
As the argument to the function you must pass the handle to the application window. To get it, you should probably use GetWindow or GetWindowDC and pass it thru.
|
__________________
Yes, MSDN comes with VB! Yes, you must have at least 25 post to have an avatar! No, you cant write your OS in VB! and NO, YOU CAN NOT DECOMPILE IT!
I'm sure there are things that are more important than me - I just can't thing of any...
|

03-18-2003, 06:04 AM
|
|
Newcomer
|
|
Join Date: Mar 2003
Posts: 4
|
|
|
Etmsprod is the application - One of the many actually. I will try what you mentioned. Unfortunately, I am new to VB and was wondering if you hand any syntax usage of that command. Thanks, Mark
|
|

03-18-2003, 06:06 AM
|
|
Newcomer
|
|
Join Date: Mar 2003
Posts: 4
|
|
|
The problem that I am having is I have to log the user onto about 5 different applications so I am going to have to find out which window handle corresponds to each program and then send the specific keystrokes and passwords for each program. I have finished everything else and I am stuck on this. 8-(
|
|

03-18-2003, 06:17 AM
|
 |
Senior Contributor
* Expert *
|
|
Join Date: Sep 2002
Location: Karlsruhe, Germany
Posts: 1,319
|
|
|
Not sure if this is what you need, but you can find out
each window's name using the GetWindowText() API,
cycling through every active window using GetActiveWindow()
and GetWindow() API's
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|
|
|
 |
|