06-27-2007 08:26 PM
06-28-2007 09:14 AM
A thread cannot use DestroyWindow to destroy a window created by a different thread.That's why you can't use it to destroy a Notepad window.
06-28-2007 06:22 PM
You are correct! destroywindow can only work within the same application. But the thing is I like the similar thing to work on a child window of a different application.
There are some places I would use the techniques. I initiate an application (.exe) from my labview program using execute without waiting to end. This application run on its own thread irrelevant to labview and it is a third party program thus I can't modify it. At a point of time, the application popup a model window stating its progress and it should ideally close after certain seconds and keep the application running, but it does not and keeps on waiting for user to click on a button or close it. Once the window is closed, the application save a bundle of data into a file from which my labview software can start reading the data and process it and so forth. So without the destroywindow facility, the whole application halts till someone clicks. Because there are a few in the process and their timing are so uncertain and lengthy that an automation is demanded.
Instead of doing destroywindow or the like, I guess we can do sendinput(). Unfortunately, I am scared of dealing with data structures, UNION and this sort of things in LabView, so I like to avoid from it and take the easy route, which, as you can see, was not very successful. Anyway, sendinput() may not work if the application blocks messages, which we don't know yet.
Anyhow, I believe there must be a way to deal with it. So......
06-28-2007 10:39 PM
Maybe you can build it into an exe & test it, if it serves its purpose...
Even if it fails, then some experts ve to shed light on it, I suppose...
06-28-2007 11:11 PM
06-29-2007 02:06 AM
06-29-2007 09:07 AM
06-29-2007 10:55 PM
You can also make a call to a standard windows dll to output key presses like in this vi.
07-01-2007 08:06 PM - edited 07-01-2007 08:06 PM
Thanks guys, the DLL works well in one of the child windows which takes Enter to close, but not for the rest, since they only take mouse click on X. And one of them requires mouse click on one of the button which does not associate with any hot key. Well we are progressing.
Message Edited by jcai on 07-01-2007 08:07 PM
07-02-2007 08:48 AM