03-08-2017
07:52 AM
- last edited on
06-24-2025
03:01 PM
by
Content Cleaner
Hi all,
I'd like that my application is hidden in the tray when the user minimizes it.
The portion of the tray handling works correctly, but I'm not able to manage a small detail:
When the application is minimized in the tray, the panel becomes invisible but the application icon remains in the Windows taskbar. But I want the icon in the taskbar to disappear when the application is hidden in the tray and to reappear when the panel is visible.
In this document http://digital.ni.com/public.nsf/allkb/6E660558F3D420C786256FCB005B4F52 is reported how to hide the taskbar icon. It works but it cannot be applied at run time.
MSDN documents report this:
To prevent the window button from being placed on the taskbar, create the unowned window with the WS_EX_TOOLWINDOW extended style. As an alternative, you can create a hidden window and make this hidden window the owner of your visible window.
The Shell will remove a window's button from the taskbar only if the window's style supports visible taskbar buttons. If you want to dynamically change a window's style to one that doesn't support visible taskbar buttons, you must hide the window first (by calling ShowWindow with SW_HIDE), change the window style, and then show the window.
So, I've tried to use WINAPI (user32.dll) but without success.
Solved! Go to Solution.
03-08-2017 07:57 AM - edited 03-08-2017 07:59 AM
03-08-2017
09:42 AM
- last edited on
06-24-2025
03:02 PM
by
Content Cleaner
Hi all,
Sorry, I've duplicated my post of some hours ago because, for some reason, I receive e-mail notifications related to my post but I'm not able to view it anymore.
Here is my problem:
I'd like that my application is hidden in the tray when the user minimizes it.
The portion of the tray handling works correctly, but I'm not able to manage a small detail:
When the application is minimized in the tray, the panel becomes invisible but the application icon remains in the Windows taskbar. But I want the icon in the taskbar to disappear when the application is hidden in the tray and to reappear when the panel is visible.
In this document http://digital.ni.com/public.nsf/allkb/6E660558F3D420C786256FCB005B4F52 is reported how to hide the taskbar icon. It works but it cannot be applied at run time.
MSDN documents report this:
To prevent the window button from being placed on the taskbar, create the unowned window with the WS_EX_TOOLWINDOW extended style. As an alternative, you can create a hidden window and make this hidden window the owner of your visible window.
The Shell will remove a window's button from the taskbar only if the window's style supports visible taskbar buttons. If you want to dynamically change a window's style to one that doesn't support visible taskbar buttons, you must hide the window first (by calling ShowWindow with SW_HIDE), change the window style, and then show the window.
So, I've tried to use WINAPI (user32.dll) but without success.
As suggested by GerdW, I've already tried the INI key "HideRootwindow=True" for my executable. It hides the application icon in the taskbar, but I cannot show/hide it at run time.
03-08-2017
12:31 PM
- last edited on
06-24-2025
03:02 PM
by
Content Cleaner
> So, I've tried to use WINAPI (user32.dll) but without success.
No need to reinvent the wheel.
You can download:
Windows API Function Utilities (32-bit) for LabVIEW
https://forums.ni.com/t5/Example-Code/Windows-API-Function-Utilities-32-bit-for-LabVIEW/ta-p/3996462
03-08-2017 05:01 PM
For application.exe in file application.ini add row HideRootWindow=True
When you activate VI, set VI-> Property node Front Panel window.Minimizable = True, show window (invoke node VI.Open, window state = standard).
When hiding, you need to track that, set Minimizable = False
Taskbar icon will appear and disappear with window
03-09-2017 01:55 AM
Thanks Alexander. I just needed to set Minimizable = FALSE
It works fine!!
06-27-2018 12:16 AM
Thanks for your tips, Alex...
I got what I expected !!!
01-18-2022 01:34 AM
Hi Alexander
For app.exe is okay;
But it doesn't work when I run VI directlly as i follow below .png shortcut ,still show its icon in taskbar;
Do you have other methods ?
Thx