LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

catch minimize panel event (one more time)

Solved!
Go to solution

As discussed in other threads, CVI doesn't have a specific event fired when a panel is minimized. Some workarounds has been proposed, and I successfully used the EVENT_LOST_FOCUS method for a long time.

But now I found a situation when this workaround doesn't' work:

  • if the main panel has a tab control
  • if one of the tab pages has the focus

the EVENT_LOST_FOCUS is not generated for the main panel when the application is minimized with the classical top-right "_" button in the title bar.

 

How can I catch the minimize panel event in this situation?

Vix
-------------------------------------------
In claris non fit interpretatio

-------------------------------------------
Using LV from 7
Using LW/CVI from 6.0
0 Kudos
Message 1 of 3
(2,961 Views)
Solution
Accepted by topic author vix

You can install a panel callback for all of the tab page panels.

 

As an example, this is how you install a panel callback for the first tab page panel.

 

    GetPanelHandleFromTabPage(panelHandle, PANEL_TAB, 0, &tabPanel0);
    InstallPanelCallback(tabPanel0, TabPanelCB, 0);

And then catch the EVENT_LOST_FOCUS in TabPanelCB. In order to check the WINDOW_ZOOM, you'll have to get the top level panel handle. The panel attribute ATTR_PARENT_PANEL returns the the panel handle of the parent of the panel you specify. If you pass the handle of a top-level panel, zero is returned.

 

Hope this helps,

 

- jared

Message 2 of 3
(2,953 Views)

Thanks for your help, jared.

The panel attribute name is ATTR_PANEL_PARENT Smiley Wink

 

Vix
-------------------------------------------
In claris non fit interpretatio

-------------------------------------------
Using LV from 7
Using LW/CVI from 6.0
0 Kudos
Message 3 of 3
(2,944 Views)