Dev Ashish's API, SysTray icon doesn't dissappear as needed
Sure, here it is
http://www.mvps.org/access/api/api0045.htm
Note: if you use A2k or A2002 better you change the line
'Set new address for window's message handler
lpPrevWndProc = apiSetWindowLong(frm.hWnd, _
GWL_WNDPROC, _
AddrOf(strFunction))
with this other one
'Set new address for window's message handler
lpPrevWndProc = apiSetWindowLong(frm.hWnd, _
GWL_WNDPROC, _
AddressOf fWndProcTray)
BTW: the code is perfectly working for me! :-)
--
Saludos desde Barcelona
Juan M. Afan de Ribera
Quote:
> I thought you could only do that in VB.
> Is there a link to thae page that has this sample?
> Thanks
> > The following code [extract] doesn't make my Access app's system tray
icon
> > disappear when the app shuts down.
> > The icon does disappear if I put the mouse over it. Any ideas how I can
> get
> > Access to wait until the icon is removed before quitting? Or perhaps a
way
> > to refresh the system tray?
> > Thanks
> > Mark
> > Function sUnhookTrayIcon()
> > 'Restore the original message handler
> > Call apiSetWindowLong(Application.hWndAccessApp, _
> > GWL_WNDPROC, _
> > lpPrevWndProc)
> > 'Remove the icon in the SysTray
> > Call apiShellNotifyIcon(NIM_DELETE, nID)
> > 'Destroy the icon
> > Call apiDestroyIcon(psfi.hIcon)
> > End Function