Results 1 to 3 of 3

Thread: Waiting for another app

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2001
    Posts
    17

    Waiting for another app

    I have a app that needs to wait until Acrobat fully opens to do some processing. I use the FindWindow api call but it returns that it found Acorbat before Acrobat is done initiallizing.
    Does anybody have any idea how I can get my program to wait long enough for Acrobat?
    "I can picture in my mind a world without war, a world without hate. And I can picture us attacking that world, because they'd never expect it." -- Jack Handy

  2. #2
    Matthew Gates
    Guest
    You could try using a DoEvents.
    Or you could try using the AppActivate Statement and make it wait.


    AppActivate title[, wait]

  3. #3
    Registered User Nucleus's Avatar
    Join Date
    Apr 2001
    Location
    So that's what you are up to ;)
    Posts
    2,530
    You could also try building in a delay long enough to allow for acrobat to open.
    VB Code:
    1. Option Explicit
    2. Private Declare Function GetTickCount Lib "kernel32" () As Long
    3.  
    4. Private Sub Command1_Click()
    5.     '//2000ms Delay
    6.     Delay 2000
    7. End Sub
    8.  
    9. Private Sub Delay(ByVal interval As Long)
    10. Dim i&
    11.     i = GetTickCount
    12.     Do While GetTickCount - i < interval
    13.         DoEvents
    14.     Loop
    15. End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width