|
Hi everybody. Sorry for my stupid question, but I'm clueless.
In short, here's my problem:
I have a VB prog which tests another one.
It starts the app under test:
ProcID=Shell(App.Path+"MyPrgUnderTestblah", vbNormalFocus)
...the app under test opens fine. The app under test opens a MsgBox by itself, which says some error, and waits for clicking an "OK" button. This is the main point of the test. I wait for that MsgBox to appear, I can take its ID by findW=FindWindow(vbNullString, "its name") - cause I know its name already.
By the same means, I can find AppUnderTest's ID as well.
If the MsgBox appears, I want to close the AppUnderTest (which I succeed by the usual "TerminateProcess" + "CloseHandle") and of course I want to kill the MsgBox too (cause for unknown reasons, when gettin killed, the AppUnderTest does not kill its own MsgBoxes) I can't succeed to kill the MsgBox, no matter what I do. It's my understanding that a msgbox is not a thread (doing "hTask = OpenProcess(PROCESS_TERMINATE, 0&, lTaskID)" gives me a result=0, which is an error). Yet I know its hwnd, I know its processID etc. I only can't kill it.
No "TerminateProcess" helps, no "CloseHandle" helps.
I imagine some "SendKeys" stuff would possibly help, but I'm not very used to that command, nor I found some examples of using it the way I want (I want to send the "Enter" key to THAT specific window, and I havent't found any example about this way of using it)
Can anyone give me some hints? Can anyone imagine a way to kill the damn MsgBox? Please help, cause I'm really clueless and desperate.
TIA, best--
CW Tortioneer
|
|
|
Forget it. I just did the stupid "SendKeys" and it worked. I can't imagine how, but it worked.
Sorry for disturbing. Best--
CaboWabo Tortioneer-in-Chief
|
|
|
|
|
|
|
|