LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I find if a panel is active?

Hi.
Sometimes I want to now if a panel is active in my aplication.
I used the function

GetPanelAttribute (MyHandle, ATTR_VISIBLE, &value);

but if that panel was not loaded in that moment the function creates an error and the program stops. I want to now if it is active to take an action.

Thanks.
0 Kudos
Message 1 of 2
(2,940 Views)
What you are doing is a good way to accomplish this. The main modification is you need to do is get the error number it returns after the call. So....

SetBreakOnLibraryErrors (0);
error = GetPanelAttribute (MyHandle, ATTR_VISIBLE, &value);
SetBreakOnLibraryErrors (1);

If error > 0 then you know that the Panel is not loaded. Not that the SetBreakOnLibraryErrors(0)command will turn off the CVI error messages around this call so that your program can continue to run.
Message 2 of 2
(2,940 Views)