取消
显示结果 
搜索替代 
您的意思是: 

Show/Hide icon of my application in the Window taskbar at run time

已解决!
转到解答

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.

 

 

0 项奖励
1 条消息(共 8 条)
15,279 次查看

Hi i,

 

did you try the INI key "HideRootwindow=True" for your executable?

Don't you get a taskbar entry when your main window is open?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 项奖励
2 条消息(共 8 条)
15,275 次查看

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.

0 项奖励
3 条消息(共 8 条)
15,314 次查看

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

 

 

 

George Zou
0 项奖励
4 条消息(共 8 条)
15,273 次查看
解答
已被主题作者 sqrt(-1) 接受

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

 

hide-show app.png

5 条消息(共 8 条)
15,248 次查看

Thanks Alexander. I just needed to set Minimizable = FALSE

 

It works fine!!

 

 

 

0 项奖励
6 条消息(共 8 条)
15,232 次查看

Thanks for your tips, Alex... 

I got what I expected !!!

0 项奖励
7 条消息(共 8 条)
13,289 次查看

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

 

 

hide-show app.png

0 项奖励
8 条消息(共 8 条)
7,639 次查看