From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Window Minimize and Restore issue

Hi Dear CVI experts.

 

I'm using this configuration : CV 2010 (SP1) on Windows 7 (32 bit).

 

I noticed a strange behaviour similar to the one in this thread:

http://forums.ni.com/t5/LabWindows-CVI/Minimize-Maximize-Restore-window-bug-with-CVI-8-5-1/m-p/80251...

The mentioned one seems to only have the problem that window content is not being drawn correct after restore. In my case the window keeps completely invisible.

 

Here a description to reproduce the problem:

- Start an application with a main window, with Window-Zoom maximized.

- Click on the application icon in the taskbar to hide the window.

- Clicking again on the application icon in the taskbar doesn't bring the window back - it stays invisible.

This effect only happens when the title bar of the window is visible. When the titlear is not visible, it works correctly. When the window is being minimized by the buttons on top right of the window there's also no problem.

 

Is this a known issue that has already been fixed or does a workaround exist ?

 

Best regards

 

   Tom

 

P.S.: My colleague has CVI 2013 installed and we could reproduce the effect also on his machine

 

 

 

 

 

0 Kudos
Message 1 of 11
(7,251 Views)

Hello Tomsaw,

 

have you used a standart example?

 

this settings could help as additional attributes

SetPanelAttribute (gMainWindow.panel, ATTR_MINIMIZE_OTHER_PANELS, 1);

SetPanelAttribute(freq_panel_id, ATTR_HAS_TASKBAR_BUTTON, 1);
SetPanelAttribute(time_panel_id, ATTR_HAS_TASKBAR_BUTTON, 1);

 

Could you provide an example so i can test?

 

Thanks

best regards
Alexander
0 Kudos
Message 2 of 11
(7,228 Views)

Hello Alexander,

 

thanks for your response. In trying to provide you with a sample - I couldn't reproduce the effect first. Comparing a simple test project I've made with my colleagues' project I found on difference causing the problem:

 

So here's the result:

 

1. Code where the effect isn't present

 

 /* initialize and load resources */
 nullChk (InitCVIRTE (0, argv, 0));
 errChk (panelHandle = LoadPanel (0, "User Interface Application.uir", PANEL));
 
 /* display the panel and run the user interface */
 errChk (DisplayPanel (panelHandle));

 SetPanelAttribute (panelHandle, ATTR_WINDOW_ZOOM, VAL_MAXIMIZE);
 errChk (RunUserInterface ());

 

2. Code causing the effect 

 

 /* initialize and load resources */
 nullChk (InitCVIRTE (0, argv, 0));
 errChk (panelHandle = LoadPanel (0, "User Interface Application.uir", PANEL));

 SetPanelAttribute (panelHandle, ATTR_WINDOW_ZOOM, VAL_MAXIMIZE);
 
 /* display the panel and run the user interface */
 errChk (DisplayPanel (panelHandle));
 errChk (RunUserInterface ());

 

So it's just depending on the time when "SetPanelAttribute" is called. Maybe it's wrong usage - or a CVI problem.

 

Best regards,

 

     Tom

 

   

 

 

0 Kudos
Message 3 of 11
(7,184 Views)

Hello Tom,

 

i have tested you code with CVI 2014 and Windows 7 64 Bit and both code works,

so the behaviour seem to be fixed in 2014.

best regards
Alexander
0 Kudos
Message 4 of 11
(7,169 Views)

Can I assume that "CVI 2014" is a typo ? Smiley Surprised

 

Carlo A.
Megaris




0 Kudos
Message 5 of 11
(7,038 Views)

Hello carlox,

 

sorry, yes it was CVI 2013 service pack 2.

best regards
Alexander
0 Kudos
Message 6 of 11
(7,031 Views)

Hello Guys,

 

i have a related problem.

I have a main panel with a second panel. If the main panel opens the second panel (via button) and the main

window is minimized, i'm not able to restore it. Neighter with alt tab or clicking on the icon in the taskbar, and

it doesnt matter if a close the second panel or leave it open.

Im using CVI 2013 SP2 on Win7 64.

 

Can u please test the code and tell me if you have the same problem or not?

 

Best regards,

Dorian

0 Kudos
Message 7 of 11
(6,838 Views)

New day, new ideas.

I found out that enabling "Minimize Other Panels" on the main Panel does fix the problem.

So, if i minimize the main Panel while the seconds panel is open, all panels are minimized and i'm able

to restore them.

 

 

Best regards,

Dorian

0 Kudos
Message 8 of 11
(6,813 Views)

It sounds like you have already found a solution for your problem. But in the eventuality that you might find yourself in a similar situtaion in the future, I'll try to clarify it a bit.

 

The difference between the two versions of your program is that in your first try, you were minimizing only a single window, whereas in the second try you are minimizing the entire application (this happens automatically when you enable the "Minimize other panels" option). 

 

Unfortunately, Windows 7 makes it a bit hard to unminimize a window when there is more than one window in your application. If your application has just one window, you can usually just click on the button and the window is restored. But if there's more than one window, clicking the button only "restores" the window that was already visible to begin with. And so, in this case, you have to first find the window you want to restore before you can restore it. The way you do that is by hovering over the taskbar button, wait for the small preview window that pops up after you hover, then right-click on the preview window and pick the window that you want to unminimize. The following picture should illustrate this:

 

minimize.png

 

 

0 Kudos
Message 9 of 11
(6,786 Views)

Hello LuisG 

 

thank you very much for the explanation. I could verify exactly what you wrote.

But  hovering over the taskbar button and then right click, just to restore a window (or program) is a little bit to hard for a customer, who only wants to operate the mashine. And on a touchscreen monitor its even more complicate 🙂

 

Maybe NI changes the behavior so something like the rest of the programs which runs under Win7.

 

Best regards

Dorian

0 Kudos
Message 10 of 11
(6,727 Views)