Greetings!
I use "IntControl(1007,p1,p2,p3,p4)" to hide my script's main window and create a system tray icon.
When the script draws a box, that box gets its own taskbar icon, which is not desired but in and of it self is not a problem.
However, when the box is destroyed, using BoxDestroy(1), the taskbar icon does NOT go with it leaving a "zombie" taskbar icon sitting there.
If you click on this zombie taskbar icon, it seems to re-display the box without its contents; just a white square with a title bar.
I am looking for a way to either prevent the Box from making a taskbar icon OR a way to clean it up afterwards.
The below code should reproduce the issue as an example - when the "Done" Message is up, you will see that the taskbar icon is still present; clicking the icon shows the destroyed Box without the sample text present.
IntControl(1007,1,1,"On Hover Name","") ;Create system Tray icon
message("Start", "Start")
BoxesUp("100,100,500,500", @NORMAL) ;TaskBar icon appears here
BoxDrawText(1, "0,0,1000,1000", "This is some text.", @TRUE, 21)
TimeDelay(2)
BoxDestroy(1) ;Taskbar icon remains
TimeDelay(2)
message("Done", "Done")
Thanks in advance! 🙂
PS: I am running Windows 11 24H2 (64bit) in case that matters.
I can't reproduce your problem.
After rereading your post, I think there is a basic misconception here. You are expecting the BoxDestroy function to remove the taskbar icon. The BoxDestroy function removes WinBath boxes. It does not affect taskbar icons; taskbar icons are not WinBatch box windows.
You should read the documentation for IntControl 1007 carefully. Pay particular attention to p1 value 2.
Quote from: td on October 06, 2025, 01:29:39 PMAfter rereading your post, I think there is a basic misconception here. You are expecting the BoxDestroy function to remove the taskbar icon. The BoxDestroy function removes WinBath boxes. It does not affect taskbar icons; taskbar icons are not WinBatch box windows.
You should read the documentation for IntControl 1007 carefully. Pay particular attention to p1 value 2.
Well, that begs the question: Why then does the boxesup function
create a taskbar icon?
In the code sample I provided, I call IntControl 1007 with p1 = 1 and p2 = 1 first. At that point, there is no icon in the taskbar. But after the boxesup function executes, one appears (at least it does on my computer.)
Logically, if boxesup created the icon, shouldn't boxdestroy remove it?
My work around will be to call IntControl 1007 with p1 = 2 and then with p1 = 1 and p2 = 1 immediately afterwards. Is that "works as intended"?
I do truly appreciate your assistance - thank you! 🙂
Again, the taskbar icon is not a box. This icon will appear whether you use the box functions or not.
[edit] By taskbar icon, I am referring to the icon in the notification area of the taskbar. If you are seeing an icon outside the taskbar notification area, then simply call WinHide("") right after calling BoxDestroy(1). And yes, that is "expected behavior."
Quote from: td on October 09, 2025, 12:55:55 PMAgain, the taskbar icon is not a box. This icon will appear whether you use the box functions or not.
[edit] By taskbar icon, I am referring to the icon in the notification area of the taskbar. If you are seeing an icon outside the taskbar notification area, then simply call WinHide("") right after calling BoxDestroy(1). And yes, that is "expected behavior."
I believe that you think I was confusing the Taskbar with the System Tray (aka the "Notification Area"); this is not the case.
After I called IntControl 1007 to specifically hide the Taskbar icon and add a Notification Area icon, I would not have expected
any additional icon, neither Taskbar NOR Notification Area, to appear without it being specifically invoked in some way.
It's fine if that's how it is supposed to work; I thought that it was possibly happening in error so I wanted to make sure that it was not some mistake I was making.
Thanks! 😀
As previously mentioned, if you see an icon on the taskbar outside the notification area, use WinHide(""). If you wish to remove the icon from the notification area, use IntControl 1007.