Results 1 to 4 of 4

Thread: prevent closing of an application, without closing another application launched by it

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2001
    Location
    Bangalore
    Posts
    11

    Unhappy prevent closing of an application, without closing another application launched by it

    Hi All,

    I have a VBApplication(Exe) which is launched by cilcking on a link from a purchased product.

    The application which is launched is a data entry form, and it updates a database as well as pass some data back to the application which has launched it through DDE calls..

    My requirement is , after launching the VB Exe I want to stop users from exiting the Launcher Application without closing the Launched Application.

    Any suggestions/ solutions are most welcome....

    Thanks in Advance

    Kiran
    PS: I have no access to change/Modify the Purchased Product..all i can play with is the VB exe i am creating..

  2. #2
    Frenzied Member blindlizard's Avatar
    Join Date
    Feb 2001
    Location
    Austin, TX - United States of America
    Posts
    1,141
    It may not be the best answer, but hat if the VB app looks every second or so to make sure the host app is running. If it is not, kill the VB app.
    I drink to make other people more interesting!
    [vbcode]On Error GoTo Bar[/vbcode]
    http://www.monsterlizard.com

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2001
    Location
    Bangalore
    Posts
    11
    Originally posted by blindlizard
    It may not be the best answer, but hat if the VB app looks every second or so to make sure the host app is running. If it is not, kill the VB app.
    Thanks for the suggestion...
    Could you tell me how i do that...I mean how do i get the application name and check whether it is running..

    Thanks

  4. #4
    AngelFire
    Guest

    Try this!!

    You can you FindWindow API function to determine that the host app running or not.
    It just like this:

    PHP Code:
    Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As StringByVal lpWindowName As String) As Long

    Private sub GetHostName()
         
    Dim sHost as string
         Dim hRet 
    as long 
         
         sHost
    =<your host app>
         
    hRet=FindWindow("",sHost)
         If 
    hRet <> 0 then
              
    'App running
              '
    Do ur stuff
         
    else
              
    'App not running
              '
    do ur stuff
         
    endif
    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