LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Deactivating MessagePopup

Hello,
 
I'm using MessagePopup in my application to display messages.Now my issue is that Messgaepopup window must be removed or deactivated if the user has not clicked OK for 5sec.Since my application is an automation run software,Popup panels will disrupt its automation behaviour if OK has not been clicked and the software will not resume its execution.So if I had written the MessagePop in line 10 and if the user had not clicked OK for 5 sec thn application should resume execution from line 11 onwards after waiting for 5 sec .
 
Please provide your valuable suggestions.
 
Mala
0 Kudos
Message 1 of 2
(2,897 Views)

You could avoid using MessagePopup and realize your own message panel to show with InstallPopup, handling this situation with a simple loop like this one:

int     tmpHandle, pnl, ctl;
double   tini;

tmpHandle = LoadPanel (.......);
InstallPopup (tmpHandle);
tini = Timer ();
while (Timer () - tini < 10.0) {
  GetUserEvent (1, &pnl, &ctl);
}
RemovePopup (0);

With this code you could also add some more buttons for example to handle an "OK / Abort" response from the user. Remember that GetUserEvent traps all commit events generated on the panel, so in case some controls are present that should not determine closing of the panel you should set them to "Normal" instead of "Hot" so that no commit event is generated when the user operates on them.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 2
(2,888 Views)