CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Feb 2003
    Location
    Holland
    Posts
    146

    [RESOLVED] When a 2nd .exe. starts disable screen of first .exe

    I have a .exe called menu.exe
    On that screen are 2 listboxes.

    When i chose from the menu to run another
    program, say herman.exe, the menu.exe will keep running.
    The second exe. herman.exe, will get focus.
    But the two lisboxes, or the frmmenu, from menu.exe should be set
    to Enabled = false,

    When stopping the herman.exe then menu.exe must get the focus
    and the two listboxes, or the frmmenu, should be set to Enabled = True.

    Herman

  2. #2
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: When a 2nd .exe. starts disable screen of first .exe

    Sounds like you want a modal dialog. You can only do that if you write both programs as one project.
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  3. #3
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: When a 2nd .exe. starts disable screen of first .exe

    Another possibilty would be to run some code in a timer to check and see if the other program is still running such as findwindow.
    Always use [code][/code] tags when posting code.

  4. #4
    Join Date
    Feb 2003
    Location
    Holland
    Posts
    146

    Re: When a 2nd .exe. starts disable screen of first .exe

    DataMiser,
    Thanks, that was a good hint.
    In the formload from menu.exe i put:
    Timer1.Interval = 3000 ' Set Timer interval.
    Timer1.Enabled = True
    SaveSetting "HataSal", LangJaar, "AnderProgramma", "Nee"

    and

    Private Sub Timer1_Timer()
    If GetSetting("HataSal", LangJaar, "AnderProgramma") = "Nee" Then
    frmMenu.Enabled = True
    End If
    End Sub


    Calling f.i. herman.exe from the menu i put in:
    SaveSetting "HataSal", LangJaar, "AnderProgramma", "Ja"
    frmMenu.Enabled = False

    When clossing herman.exe i put in:
    SaveSetting "HataSal", LangJaar, "AnderProgramma", "Nee"

    This works fine, exept that when i run herman.exe and click on the form from menu.exe, herman.exe will be minimized.
    When running herman.exe, herman.exe should always been on the foreground.
    Any idea how to fix that?
    Regard,
    Herman

  5. #5
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: When a 2nd .exe. starts disable screen of first .exe

    You could use the always on top api
    Always use [code][/code] tags when posting code.

  6. #6
    Join Date
    Feb 2003
    Location
    Holland
    Posts
    146

    Re: When a 2nd .exe. starts disable screen of first .exe

    DataMiser,
    Thanks. Is working as well.
    Regards,
    Herman

  7. #7
    Join Date
    Apr 2009
    Posts
    394

    Re: [RESOLVED] When a 2nd .exe. starts disable screen of first .exe

    Friends time... (yahoo, google, ask, answers, bing) vb6 shell and wait...

    http://www.vbaccelerator.com/home/vb...on/article.asp



    Good Luck

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

Featured