Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Call the Shell_NotifyIcon function in VFP6
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00585078
Message ID:
00585110
Views:
35
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

------------------------------------------------------------
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform