06-27-2011 05:29 AM
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:
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?
Solved! Go to Solution.
06-27-2011 10:20 AM
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
06-28-2011 01:13 AM
Thanks for your help, jared.
The panel attribute name is ATTR_PANEL_PARENT