>Thanks for your explanation,
>
>maybe you know how to convert this to VFP,
>This is a VB sample of the code that does the trick
>
You can't do this purely in VFP, as it involves a callback; VFP does not have the capability of providing a callbak address for a piece of VFP code. You can handle this in one of several ways; an ActiveX control can return a callback address as an integer through one of it's methods, and that can be used to generate a callback to the ActiveX which then raises an event that VFP would respond to; you could use the same sort of strategy using an FLL or DLL. IAC, it will involve coding something in some part not in VFP, or using something that someone else wrote in a product other than VFP that supports publishing a callback address and is able to raise an event.
>------------------------------------------------------------
>Declare Function Shell_NotifyIcon Lib "shell32" Alias "Shell_NotifyIconA" (ByVal dwMessage As Long, pnid As NOTIFYICONDATA) As Boolean
>Public Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As Long
>
>Public Const WM_LBUTTONDBLCLICK = &H203
>Public Const WM_RBUTTONUP = &H205
>Public Const WM_MOUSEMOVE = &H200
>Public Const NIM_ADD = &H0
>Public Const NIM_MODIFY = &H1
>Public Const NIM_DELETE = &H2
>Public Const NIF_MESSAGE = &H1
>Public Const NIF_ICON = &H2
>Public Const NIF_TIP = &H4
>
>Public CIAsystray As NOTIFYICONDATA
>
>Public Type NOTIFYICONDATA
> cbSize As Long
> hwnd As Long
> uId As Long
> uFlags As Long
> ucallbackMessage As Long
> hIcon As Long
> szTip As String * 64
>End Type
>
>Public Sub SystemTrayAddIcon(Form As Form)
> CIAsystray.cbSize = Len(CIAsystray)
> CIAsystray.hwnd = Form.hwnd
> CIAsystray.uId = vbNull
> CIAsystray.uFlags = NIF_ICON Or NIF_TIP Or NIF_MESSAGE
> CIAsystray.ucallbackMessage = WM_MOUSEMOVE
> CIAsystray.hIcon = Form.Icon
> CIAsystray.szTip = Form.Caption & vbNullChar
> Call Shell_NotifyIcon(NIM_ADD, CIAsystray)
>
> App.TaskVisible = False
> Form.Hide
>End Sub
>------------------------------------------------------------
>
>Many thanks
>Jacques Herweijer