LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

windows maximize panel

Hi,
 
I am seeing a wierd problem occasionally and I am wondering if anyone has encountered this before.
 
Using:
 
Windows XP
LabWindows CVI 8.5
 
Problem:
The user minimizes the application, and later wants to use the program again and tries to maximize it by clicking on the windows task bar.  The program will not maximize itself but if the user right clicks on the program on the task bar and clicks unminimize the program again displays itself.  This isn't a problem every time the user minimizes the program but seems to be intermittent.
 
Thanks,
Garth
0 Kudos
Message 1 of 7
(6,833 Views)
I have seen something like that once before, but have not had time to experiment/pursue it.  The user may have had another top-level panel open at the time they minimized the app (i.e. parent handle = 0 in LoadPanel).  I'll post more if I can reproduce it.
0 Kudos
Message 2 of 7
(6,824 Views)
Here is a quick and dirty demo of the problem.  It even works running in debug mode.
 
--Ian
Message 3 of 7
(6,819 Views)

Hi Ian,

First thanks for the demo.  It does indeed pre-produce the behavior.

An interesting note is you have to use the minimize button to see this problem.  If you use the windows minimize everything and go to desktop button this problem does not occur. 

Can someone from Nation Instruments tell us why this is a problem?  Is this specific to software built with CVI 8.5?  I do not remember seeing this problem before.

Last: This is probably completely obvious but I am missing it.  How do you rate a post?

0 Kudos
Message 4 of 7
(6,814 Views)
The rating system has changed recently: users now must have posted at least 50 messages in order to be able to rate a post. Assuming you intended to award Ian with a few stars, I have taken the liberty of doing so for you.
 
JR
0 Kudos
Message 5 of 7
(6,779 Views)
Hello Garth,
 
Yes, this behavior you're seeing is the result of a change that took effect in version 8.5. The change came about as a result of numerous complaints with the previous minimizing behavior in CVI. You can read the gory details in this thread.
 
This topic is a bit complicated, but I'll try to explain it as succintly as possible.
 
What happens is that by default the application as a whole is associated with a taskbar button. Each individual panel (or window) can also be associated with its own taskbar button, although by default these are hidden. If they're not hidden, you can use each window's button to minimize/restore the window.
 
Let's assume for the moment that your panels don't have associated buttons. When you minimize a window, only that window is minimized. If there's only one window in your application, CVI automatically minimizes the application whenever you minimize the window, such that you can then click on the application's taskbar button to restore the application (and the window). But if you have two windows, when you minimize the first window, the application is still not minimized -- only the window. If you click on the application's taskbar button then, you're really minimizing the application (thus hiding the other window). When you click on it again, you are restoring the application, which means that it returns to the state it was in before it was minimized (one window visible, and the other hidden).
 
Before CVI 8.5, when you minimized a window, it would create a silly little button on the desktop, which could then be clicked on to restore the window. This was roundly panned by CVI users (rightly so) as being very unorthodox behavior. Now, by default that button is no longer used, which means that (by default) a panel does not have a dedicated button that you can click on to to restore it.
 
Fortunately, you have three possibilities that you can pick from to get around this predicament:
 
1. Restore the pre-8.5 behavior by calling:
 
    SetSystemAttribute (ATTR_MINIMIZE_PANELS_TO_DESKTOP, 1);
 
2. Allow each of your windows to have its own taskbar button by calling:
 
         SetPanelAttribute (panel, ATTR_HAS_TASKBAR_BUTTON, 1);
 
You don't have to enable buttons on all your windows, if you don't want to. Just the ones that you want to control individually from the taskbar.
 
3. If you would like one of your windows (the main window?) to be the master window of your application, as far as the minimize/restore behavior is concerned, you can configure it so that when you minimize that window, it minimizes all the others too (and the application). And when you restore the application, it also restores all windows. You can do that by calling:
 
         SetPanelAttribute (panel, ATTR_MINIMIZE_OTHER_PANELS, 1);
 
Hope this helps.
 
Luis
Message 6 of 7
(6,754 Views)

Luis,

Thank you for taking the time to write an explanation.

-Garth

0 Kudos
Message 7 of 7
(6,725 Views)