Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Dec 2001
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Access Automation (Acc2000)

    I have code in a database that checks for the existence of an active application on the PC using

    Set ObjName = GetObject(, appname)
    If Err.Number = 0 then
    ...validation of correct app window by checking ObjName.Caption value, if not a match, a new app is started

    Problem is, if someone manually opens the app ( which is a terminal emulator), the Access code will always open a new window when the check is done because the GetObject function only retrieves the first instance of the application, and the caption value is different when opened manually as opposed to having been opened by Access. As the emulation and host have time-out values, I have to constantly check to see if the application is opened, resulting in multiple instances of the app, each of which was used only once by Access automation.

    Is there any way to find all instances of a PC application (a "next" version of the GetObject function, so to speak), and check each to find the proper one to attach?

    Thanks,

    W

  2. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Access Automation (Acc2000)

    Hi Warren,
    From what you've described I think the FindWindow API function is what you need. If you need details on it, try http://www.allapi.net.
    Hope that helps.
    Regards,
    Rory

    Microsoft MVP - Excel

  3. #3
    New Lounger
    Join Date
    Dec 2001
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access Automation (Acc2000)

    Thanks Rory.

    I had tried using the FindWIndow API and I can successfully find the window handle I would like to use, but the GetObject function only allows me to attach to the first instance of an application. No allowances that I can find to attach to a specific handle.

    I did find something about using GetObject to attach to a "document name", maybe I can do something with that.

    By the way, I tried going to the allapi.net site, but as yet have not been able to get a response from that server.

    Thanks again,

    Warren

Posting Permissions

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