Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: systray Task List winclose
allwins = WinItemize() htab = Num2Char(9) n = ItemCount(allwins, htab) For x = 1 to n win = ItemExtract(x, allwins, htab) message("Program Name", win) nextAfter you've found the name of the application, add the following line to the script file you are creating.
Winclose("VshieldMonitor")
I think this may be more of a 95/NT question rather than a winbatch question. I know that the popup menu is there and I will look for it in the registry, but just wonder if there is anything special that I must do?
;This intcontrol puts script in systray and hides icon on taskbar IntControl(1007, 1, 1, "YooHoo", "") while 1 ;This intcontrol Suspends the script ;until user clicks on the tray icon IntControl(1007, 3, 1, "", "") Pause("BEEEP","Icon was clicked") ;do stuff here endwhile exit
To take a random program and cajole it into going into the systray area is an entirely different task. It's something like...gee the clock is in there, how come I can't put Notepad in there.
One of our users reported having good fortune with a Freeware component called TRAY.EXE to load programs, including Winbatch compiled executables, into the System Tray.
The syntax is simple:
Tray.EXE d:\path\executable.exeIt works in hidden mode---the new icon will appear in the tray.
To get a copy, you can write the author, Thomas Ronneberg of Norway, Thomas@intercom.no
Or, it can be found at the: Windows 95 Annoyances site, in the "Collected Windows95 Software" section. If you have VisualC++ there is some sample code that shows you how to do it.
Or, there's another third party utility that will do it, located at:
ICONCRRL.ZIP: Icon Corral 1.0i for Windows95.
Allows you to "hide" files over in the taskbar tray (where the clock is). Great for programs that are running all the time and usually minimized (like schedule plus). New version (Newest File Date: 03-08-96) ( 83015 bytes, Posted 03-30-96)Here's another third party utility, EnTRAY, which lets you dynamically add and remove programs, documents and shortcuts to your system tray (Windows taskbar). These programs and documents can then be run from the tray through a single mouse click. In addition, EnTRAY also lets you minimize or maximize all windows through a single mouse-click by clicking on the EnTRAY icon itself.
http://www.bendigo.net.au/tucows/util95.html
The only one I've see is to MouseMove the mouse on top of the systray icon and then MouseClick it. Once the menu pops up normal SendKeys can handle it.
The problem is that if the icons shift, then the script breaks.
The trick is getting the MouseMove co-ordinates correct so the MouseClick happens in the correct spot.
And you will need to use WinMetrics to check the current resolution to figure out what set of mousemove co-ordinates to use to move to, to change it.
mylink = "c:\win95\desktop\mynet.lnk" ;------------------------------------ ShellExecute(mylink, "", "", @NORMAL, "") WinWaitExist("Connect To",-1)) SendKeysto("Connect To","~") WinWaitClose("Connect To")PS. The WinWaitClose is VERY important.
;Tried this at 640x480 800x600 and 1024x768 ;Seems to work pretty good. CurrLocn = MouseInfo(2) Locn1 = ItemExtract(1, CurrLocn, " ") Locn2 = ItemExtract(2, CurrLocn, " ") For X = 800 to 1000 MouseMove(X , 970, "", "") Next MouseMove(Locn1, Locn2, "", "")
If not now, might there be a function in the future that could distinguish between those types of windows, or is there some other way to dynamically determine that?
Thanks.
WinExeName could be used to determine the exe of the owning window, and from that you could have a table of exe names.
There is no real way I know of to tell if a window comes from an application that may also have something in the systray.
Article ID: W13463
Filename: Systray Icon Questions.txt
File Created: 2001:01:26:15:04:12
Last Updated: 2001:01:26:15:04:12