Click to See Complete Forum and Search --> : Controlling other application from VB


gnans
March 21st, 2001, 09:25 AM
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

coolbiz
March 21st, 2001, 10:17 AM
Can you send "EXIT{ENTER}" instead? We know that by typing EXIT command, will exit any DOS box automatically.

-Cool Bizs

Cimperiali
March 22nd, 2001, 07:43 AM
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.

Iouri
March 22nd, 2001, 08:19 AM
If you make the bat file, go to the properties and check the box 'Close window on exit'

Iouri Boutchkine
iouri@hotsheet.com