LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Losing control of applications running in maximized mode!

Solved!
Go to solution

Running an application with the display mode set to maximized (I mean with the application's window that covers the task bar), if you switch to the desktop (i.e. pressing Windows key+D), you are no longer able to return back to your application.

You can see the application's button on the task bar, but nothing happens if you click on it, nor you successed using the Task Manager tool, you have simply lost your application, all what you can do is closing it, pressing Alt+F4.

 

Please look at the video attached to this message, it exactly shows what I've just tried to describe.

 

I've already signaled this bug 3 years ago on CVI 8.1.1, then I've bought CVI 9 and CVI 10 but the bug is still present.

It is a potential important issue on my point of view, because I need to run a program with the display mode set to maximized. The program controls production tools and machineries with some people and materials involved, you can understand that, losing the program control, it becomes an embarrassing situation.

I hope you can fix it as soon as possible.
Thank you for any suggestion.

 

Best regards
Sergio

Download All
0 Kudos
Message 1 of 5
(3,064 Views)
Solution
Accepted by topic author Laser

Hello Sergio -

 

I'm curious if moving the call SetPanelAttribute (panel, ATTR_WINDOW_ZOOM, VAL_MAXIMIZE); to sometime after the call to DisplayPanel resolves the issue for you?

 

NickB

National Instruments

0 Kudos
Message 2 of 5
(3,053 Views)

Hello Nick,

 

yes it seems to work!

The source code for the example I've attached is very simple:

 

#include <cvirte.h>       
#include <userint.h>
#include "Maximize.h"

static int panelHandle;

int main (int argc, char *argv[])
{
    if (InitCVIRTE (0, argv, 0) == 0)
        return -1;    /* out of memory */
    if ((panelHandle = LoadPanel (0, "Maximize.uir", PANEL)) < 0)
        return -1;
//  SetPanelAttribute (panelHandle, ATTR_WINDOW_ZOOM, VAL_MAXIMIZE);  // [1]
    DisplayPanel (panelHandle);
    SetPanelAttribute (panelHandle, ATTR_WINDOW_ZOOM, VAL_MAXIMIZE);  // [2]
    RunUserInterface ();
    DiscardPanel (panelHandle);
    return 0;
}

int CVICALLBACK PanelClose (int panel, int event, void *callbackData,
        int eventData1, int eventData2)
{
    switch (event)
    {
        case EVENT_CLOSE:
            QuitUserInterface (0);
            break;
    }
    return 0;
}


with SetPanelAttribute in position [1] I get the problem while, moving SetPanelAttribute in position [2], the problem disappears.

I hope this trick works for much more complex code also!

 

Thank you but, please, don't forget to fix the bug into the next version of CVI. Smiley Wink

 

Sergio

0 Kudos
Message 3 of 5
(3,045 Views)

It is to be noted, though, that in this case DisplayPanel is not necessary at all!

As clarified by the help for the attribute, "Setting the ATTR_WINDOW_ZOOM attribute always makes the panel visible."

In effect I have several applications that run in maximized mode without the abnormal behaviour you are seeing, and I don't make a call to DisplayPanel.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 4 of 5
(3,038 Views)

Thank you Roberto,

 

to be honest I never noticed that the attribute ATTR_WINDOW_ZOOM makes the panel visible, so I tried your suggestion removing the DisplayPanel() line from the example, actually the panel is displayed but unfortunately I get back the problem again.

Thus the only solution that seems to work at the moment, is to put SetPanelAttribute() after DisplayPanel().

 

Thank you anyway!

 

Sergio

 

 

0 Kudos
Message 5 of 5
(3,032 Views)