06-28-2011 04:11 AM
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
Solved! Go to Solution.
06-28-2011 11:16 AM
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
06-29-2011 01:23 AM
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.
Sergio
06-29-2011 01:49 AM
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.
06-29-2011 04:50 AM
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