Aitor Solar Posted October 17, 2005 Report Share Posted October 17, 2005 Is there any way of controlling (programmatically) a Windows Dialog popped-up by a VI? Like getting a reference to the dialog and closing it or pressing the OK button . Thanks, Aitor Quote Link to comment
william wallace Posted October 18, 2005 Report Share Posted October 18, 2005 Hi Entropy: You can use "function->time & dialog->one button dialog/two button dialog/three button dialog",or use the MS's API. William Quote Link to comment
Aitor Solar Posted October 18, 2005 Author Report Share Posted October 18, 2005 Hi Entropy:You can use "function->time & dialog->one button dialog/two button dialog/three button dialog",or use the MS's API. William Well, the program shouldn't have dialogs, because it's a remote panel application. But sometimes, one pops-up (you can't control all the embedded dialogs, particularly when some VIs come from another programming team, or sometimes caused by Matlab incompabilities). So I need to detect when a dialog launches and close it. And this I have no idea. I can quit LabVIEW, but just close that specific Windows dialog... Saludos, Aitor Quote Link to comment
Rolf Kalbermatter Posted October 18, 2005 Report Share Posted October 18, 2005 Well, the program shouldn't have dialogs, because it's a remote panel application. But sometimes, one pops-up (you can't control all the embedded dialogs, particularly when some VIs come from another programming team, or sometimes caused by Matlab incompabilities). So I need to detect when a dialog launches and close it. And this I have no idea. I can quit LabVIEW, but just close that specific Windows dialog... Saludos, Aitor It really depends what you want to do. A LabVIEW dialog is quite different from a Windows dialog. With Windows dialogs you could in principle use the Windows API to search for the default control to send a message to it to dismiss it. This wouldn't work for LabVIEW dialogs, since LabVIEW controls are not standard Windows widget controls but fully custom implemented by LabVIEW itself. The easiest way would be to post a return or esc key press to the keyboard queue. This assumes that the dialog has these keys assigned to its OK and Cancel buttons (almost alsways the case for Windows dialogs, but in LabVIEW dialogs implemented by VIs written by the application developer, this sepcifically has to be assigned by the developer). If this wouldn't work, you would have to distinguish between Windows dialogs where you would have to enumerate the controls in the dialog and then send a message to the correct control using Windows API functions or a LabVIEW dialog where you would use VI server to do the same. Rolf Kalbermatter Quote Link to comment
william wallace Posted October 19, 2005 Report Share Posted October 19, 2005 Well, the program shouldn't have dialogs, because it's a remote panel application. But sometimes, one pops-up (you can't control all the embedded dialogs, particularly when some VIs come from another programming team, or sometimes caused by Matlab incompabilities). So I need to detect when a dialog launches and close it. And this I have no idea. I can quit LabVIEW, but just close that specific Windows dialog... Saludos, Aitor Hi Aitor: Hope I got what you means. Try to use this to control the dialog in your case.Use the "Simple Error Handler.vi" and set the "Type of dialog" to 0("no dialog").This maybe helpful.See the attachment. Good luck. William Quote Link to comment
Aitor Solar Posted October 20, 2005 Author Report Share Posted October 20, 2005 The easiest way would be to post a return or esc key press to the keyboard queue. Thanks, sir. That's a good and simple idea I didn't think of. :headbang: Try to use this to control the dialog in your case.Use the "Simple Error Handler.vi" and set the "Type of dialog" to 0("no dialog").This maybe helpful.See the attachment. Yes, but then I would need all the VIs follow this protocol. Something out of my hand here. Thanks, people Aitor Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.