Dev Ashish's API, SysTray icon doesn't dissappear as needed 
Author Message
 Dev Ashish's API, SysTray icon doesn't dissappear as needed

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



Tue, 15 Nov 2005 03:51:39 GMT  
 Dev Ashish's API, SysTray icon doesn't dissappear as needed
I thought you could only do that in VB.
Is there a link to thae page that has this sample?

Thanks



Quote:
> 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



Wed, 30 Nov 2005 05:50:09 GMT  
 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



Fri, 02 Dec 2005 05:25:42 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Code doesn't work (from Dev's site)

2. Systray Icon won't work when program is compiled

3. API/function doesn't stop and I don't understand it :o)

4. Dev Ashish or other Access 'Gurus' please help

5. fRefreshLinks Doesn't work if path doesn't exist

6. Form_Load() doesn't execute, form doesn't load

7. class doesn't support automation or doesn't support expected interface

8. asyncread doesn't tell if file doesn't exists

9. application classes for Dev Ashish program

10. Ken Getz's GetOpenFile as Posted on Dev's site

11. DEV ASHISH - Bugs: Undefined Function in Expression (Error 3985)

12. FAO Dev Ashish

 

 
Powered by phpBB® Forum Software