Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


AppExist AppWait AppWaitClose RunWait
not Working on 16-bit Applications

Keywords: AppExist AppWaitClose runwait

Question:

I'm running NT 3.51 and need to close a 16bit app, if it exists. Well the problem first of all is that AppExist can't even tell if the app is running or not and WinClose is not closing it out either.

I know I have to compile my script as a 16bit EXE, otherwise WIL will not detect a 16bit app in NT when I use AppExist.

I have used the name of the program (IEFCMW.EXE) and tried the Name of the Window (IEF Client Manager) but nothing works. I have done this on a 32bit app and it works....

Answer:

AppExist, AppWait, AppWaitClose (and sometimes RunWait), and WinExeName cannot see 16 bit apps. (WinExeName can only interpret the window name for a 16-bit app as "16-bit Application".) The 32 bit size cannot see the 16 bit side.

On a related note, watch out for FileItemize and DirItemize...The default delimiter is a tab in the 32 bit versions and a space in the 16 bit versions.

In general, you need to use WinWaitClose to make your 16-bit application wait when running a 16-bit app from a 32-bit version of WinBatch. You can write a 16 bit utility to do the functions for you. I.e., compile a 16 bit EXE that you can call from a 32 bit EXE to do the dirty work for you. E.g.:

	response="ERROR"
	if param1=="APPEXIST"
	   response=AppExist(param2)
	endif
	if param1=="APPWAITCLOSE"
	   response=AppWaitClose(param2)
	endif
	if param1=="WINEXENAME"
	   response=WinExeName(param2)
	endif

	IniWritePvt("XXX","Response",response,"myfile.ini")
	exit
Then call it from your 32 bit script ala:
	;AppExist
	RunWait('util16.exe','APPEXIST fred.exe')

	;AppWaitClose
	RunWait('util16.exe','APPWAITCLOSE fred.exe')

	;WinExeName
	RunWait('util16.exe','WINEXENAME "WINDOW TITLE"')

If AppWaitClose does not close an application, WinClose should work. Maybe. (Assuming you close it just like you close other Windows applications.)

First, you'll have to figure out the Window name. Get the app running and try..

	a=WinItemize()
	b=AskItemList("Windows",a,@tab,@sorted,@single)
	c=strlen(b)
	Message("Length=%c%",b)
	WinClose(b)

Article ID:   W12720
Filename:   AppExist AppWaitClose RunWait and 16 bit Apps.txt