LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

close a window with api

is it possible to close a window like the file - new - window in word??
i want to close a error message from another program

thanks

Message Edited by hmuehlbacher on 04-28-2006 03:03 AM

0 Kudos
Message 1 of 4
(2,863 Views)

You can send a WM_Quit message to the window if you know its name, but I don't think that would work with an error message. If you want to try it, you can try searching the site for a collection of windows VI called winutil (or winutil32 or something similar) which include a VI which does this just that.

Another option is to simulate a mouse click or a keyboard click, which can be done by calling the mouse_event or keybd_event functions, both of which have been demonstrated elsewhere on this site. The trick would be knowing where and when to do this.

The real quesiton would be why close the error messages. Error messages are supposed to alert users to errors. They are not designed to be dismissed automatically by unrelated programs.


___________________
Try to take over the world!
0 Kudos
Message 2 of 4
(2,846 Views)
Hi,


You generaly don't want to close the window, but the process.


If you close the window, the program will still be running, and it will be impossible to close it, bcause it has no window! You'll have to use taskmanager...


So you need to search all processes, select the correct one by name, and kill the process. If you have multiple word windows, I don't think you can kill just one window, but I'm not sure. All word windows might run under the same process...



Try this one:
http://forums.ni.com/ni/board/message?board.id=170&message.id=94159&query.id=114041#M94159


Or search the forum for "kill process". There seems to be a way using the system exec.


Regards,


Wiebe.



"hmuehlbacher" <x@no.email> wrote in message news:1146211814508-358273@exchange.ni.com...
is it possible to close a window like the file - new - window in word??i want to close a error message from another programthanksMessage Edited by hmuehlbacher on 04-28-2006 03:03 AM
0 Kudos
Message 3 of 4
(2,833 Views)
Hello,
I had a similar problem and found a solution with the attached dll. But it implicates that the dialog-window has the focus.
Dave
Greets, Dave
0 Kudos
Message 4 of 4
(2,822 Views)