CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2001
    Location
    India
    Posts
    2

    Controlling other application from VB

    Hi,
    Here I have code in the button click event to close the console window, which is run by the Shell("application",mode) function in VB from other event .Using AppActivate(taskid,mode) function, I activate console window using its task id,which is returned from Shell function and I close it by sending Control+C(^C) through SendKeys (KeysCombination,mode) statement. This is working fine in Windows NT platform. But the same code on Windows'9X does not close the console window. what would be the problem?
    How do I solve it? Please help me..

    regards
    Gnana Reddy


  2. #2
    Join Date
    Feb 2001
    Location
    Stamford CT USA
    Posts
    2,167

    Re: Controlling other application from VB

    Can you send "EXIT{ENTER}" instead? We know that by typing EXIT command, will exit any DOS box automatically.

    -Cool Bizs

    Good Luck,
    -Cool Bizs

  3. #3
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: Controlling other application from VB

    or: make a .bat file for launch your dos (console) application and add at last line the instruction
    exit
    then shell to the .bat file
    Hope this help

    Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  4. #4
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: Controlling other application from VB

    If you make the bat file, go to the properties and check the box 'Close window on exit'

    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

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