How do I use EnumWindows & EnumWindowsProc?

I neec to find out if a DOS window that opens after being shelled from VB (the DOS window is MakeCab.EXE) has finished in order to 'Kill' it's text input file.

When I use GetWindow I get the handle of the calling application and not the DOS window.