codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  How to kill a MagBox? Please help.  CaboWabo Tortioneer at 13:07 on Saturday, April 30, 2005
 

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

  Re: How to kill a MagBox? Please help.  CaboWabo Tortioneer at 13:41 on Saturday, April 30, 2005
 

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








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Re: How to kill a MagBox? Please help.
•  help
•  cant view jsp
•  Cant include picture in JButton
•  View State management in User custom control
•  MSMQ with workgroup environment
•  access connection to JSP
•  Please help this n00bie to make a tabbed table work in Netscape 6+
•  ASP / Frames


Recent Articles
Communicating with the Database (Using ADO)
MagicGrid
Simple Thumbnail Browsing Solution
Type Anywhere
A Better Moustrap: FmtDate to replace FormatDateTime
ASP.NET Forum Source Code
Internal Search Engine
Javascript Growing Window
Simple date validation
Search engine friendly URLs using ASP.NET (C#.NET)


Site Survey
Help us serve you better. Take a five minute survey. Click here!

© Copyright codetoad.com 2001-2005