LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

MessagePopup Hidden

Solved!
Go to solution

Hey NI Nubie,

Could you post a simple example that still reproduces the hidden popup that you are describing? Once I can reproduce this here at NI I should be able to dig a little deeper and find the root cause of the issue. Thanks also to Ian as it sounds like this this definitely the same problem and your information on the other post should help us isolate this.

 

Lars L

National Instruments

0 Kudos
Message 11 of 20
(2,781 Views)

Lars,

 

I tried the CA_InitActiveXThreadStyleForCurrentThread (0, COINIT_APARTMENTTHREADED) command recommendation from the other thread but that did not work.

 

I will work on an example over the weekend as the project is quit huge with many files etc.

 

Thanks.

0 Kudos
Message 12 of 20
(2,779 Views)

Hi Lars,

 

Here is an example project finally.

 

Run the App and then do the following:

  1. Press the 'AUTO' button.
  2. Select 'SD1 TEST' from the drop down menu.
  3. Press 'ONE ONCE' button.
  4. Hide Main Panel (minimize it).
  5. After five seconds a ConfirmPopup() will maximize the MAil Panel and a sub-panel but will NOT display the ConfirmPopup() window.
  6. The App has to be killed from the task manager.

LabWindows/CVI 9.0 Version 9.0.0. (348)

 

Thanks.

0 Kudos
Message 13 of 20
(2,708 Views)

Hi,

 

I was able to reproduce the problem with your test program. Thanks for taking the time!

 

This does look like a bug. I've created a bug report for it (#227279) and I'll post an update here when we have a fix and/or a workaround.

 

Luis

0 Kudos
Message 14 of 20
(2,662 Views)

Hi Nubie,

 

This problem has now been investigated and fixed internally. The fix will be included in the next major release.

 

The short explanation of the problem is that the logic for handling the interaction of floating panels with popup panels is fairly complicated and, in this case, it was being thrown off by the concurrent minimization of the floating panel.

 

As a temporary workaround, since you can't change the floating style of your panel to "Float app active" (which would make the problem go away) you could also programmatically disable floating around your popup call. Like this:

 

      SetPanelAttribute (panelHandleSd, ATTR_FLOATING, VAL_FLOAT_NEVER);
      result = ConfirmPopup (msg_str, SdMsg2_ptr);
      SetPanelAttribute (panelHandleSd, ATTR_FLOATING, VAL_FLOAT_ALWAYS);
 

 Luis

 

0 Kudos
Message 15 of 20
(2,569 Views)

Hi Luis.

 

There is a problem with the workaround.

 

If the SD_PANEL is minimized (with the mouse click in the left box top right corner) then it never comes back and the user cannot see the instruction message displayed on the SD_PANEL.

The SD_PANEL must always be visible for instructions to the user.

 

Also if the main application panel is minimized then when restored from the task bar then the SD_PANEL must also be restored as well as the confirm popup window.

 

Let me know if this is not clear.

 

Thanks.

0 Kudos
Message 16 of 20
(2,562 Views)

I'm not sure I follow completely. But I'll restate what I think I understand, and if I'm wrong, please correct me.

 

The new scenario, as I understand it, is that the user minimizes the SD panel -- not the main panel. This would leave only the main panel visible. Some time later, you programmatically display the confirmation popup. But the problem is that you need the SD panel to be visible when the popup is displayed. Is this correct?

 

Well, the act of displaying a popup does not necessarily cause minimized panels to be restored/displayed. With one notable exception: if the application itself is minimized (not just its individual panels), then the application must be restored in order to display the popup. Because you have set the "minimize other panels" option in the main panel, when the user minimizes the main panel CVI will minimize the entire application. Therefore, when the popup is later displayed, the application is restored and its windows are made visible again. But you don't have this attribute set for the SD panel, therefore minimizing this panel does not minimize the entire application.

 

If you need the SD panel to be visible when you display the popup, why don't you restore it explicitly by setting its ATTR_WINDOW_ZOOM attribute before you display the popup?

0 Kudos
Message 17 of 20
(2,546 Views)

Not quite.

 

If the SD_PANEL is minimized leaving just the main panel visible and then some time later the confirmpopup is programmatically displayed, after the confirmpop has been dealt with the SD_PANEL cannot be found (maximized) (i.e. it is not visible and not on the task bar) it's like it vanished for good.

 

I could try the DisplayPanel (panelHandleSd) command immediately after the Comfirmpopup () to see if that brings it back?

 

The SD_PANEL does not have to be displayed at the same time as the confirmpopup but only immediately after the comfirmpopup has been dealt with.

0 Kudos
Message 18 of 20
(2,542 Views)
Solution
Accepted by topic author NI Nubie

Hi Luis. 

 

This works with your workaround:

 

      SetPanelAttribute (panelHandleSd, ATTR_FLOATING, VAL_FLOAT_NEVER);
      result = ConfirmPopup (msg_str, SdMsg2_ptr);
      SetPanelAttribute (panelHandleSd, ATTR_FLOATING, VAL_FLOAT_ALWAYS);

   ***SetPanelAttribute (panelHandleSd, ATTR_WINDOW_ZOOM, VAL_NO_ZOOM);***

 

Thanks!!!!

0 Kudos
Message 19 of 20
(2,537 Views)

Hi Nubie,

 

The reason the SD panel is disappearing after the user minimizes it is because it has its "Has Taskbar Button" attribute disabled in the UI editor. If it were visible, then the end user would be able to minimize it and then restore it from the taskbar, without you having to explicitly restore it programmatically.

 

Luis

0 Kudos
Message 20 of 20
(2,493 Views)