API (VB6) for Closing a tray icon program
Posted on 2004-10-19
My data provider recently changed their program from a "Windowed application" to just a system tray program. I used to close the GUI program like this:
lngWin = FindWindow(vbNullString, "TALNET")
If lngWin <> 0 Then SendMessage lngWin, WM_CLOSE, 0&, 0&
But that doesn't work anymore because there is no window. My provider emailed back:
"Using the Win32 SendMessage API was a good idea for an app that had a GUI window, as TALNET did. Since TALDDE's just a tray icon, the logical analogy would be to find the Win32 API for sending a message to a tray icon"
Can anyone send me the code to close a program that is only running in the system tray? The program is called "taldde32.exe" in the Processes tab of the Windows Task Manager.