systray

29/07/2003 - 05:59 por hernan perez tonini | Informe spam
Esparta por ahora estoy con vfp 6 buscando un poco mas
encontre algo pero no se como seguir el codigo que
encontre el cual esta en VB y es el siguiente:

Declare Function Shell_NotifyIcon Lib "shell32.dll" Alias
_
"Shell_NotifyIconA" (ByVal dwMessage As Long, lpData As _
NOTIFYICONDATA) As Long

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

'Make your own constant, e.g.:
Public Const NIF_DOALL = NIF_MESSAGE Or NIF_ICON Or
NIF_TIP

Public Const WM_MOUSEMOVE = &H200
Public Const WM_LBUTTONDBLCLK = &H203
Public Const WM_LBUTTONDOWN = &H201
Public Const WM_RBUTTONDOWN = &H204

2) Add a form to the project, and add the following code:

Public Sub CreateIcon()
Dim Tic As NOTIFYICONDATA
Tic.cbSize = Len(Tic)
Tic.hwnd = Picture1.hwnd
Tic.uID = 1&
Tic.uFlags = NIF_DOALL
Tic.uCallbackMessage = WM_MOUSEMOVE
Tic.hIcon = Picture1.Picture
Tic.szTip = "Visual Basic Demo Project" & Chr$(0)
erg = Shell_NotifyIcon(NIM_ADD, Tic)
End Sub

Public Sub DeleteIcon()
Dim Tic As NOTIFYICONDATA
Tic.cbSize = Len(Tic)
Tic.hwnd = Picture1.hwnd
Tic.uID = 1&
erg = Shell_NotifyIcon(NIM_DELETE, Tic)
End Sub

si alguien pude pasarlo a VFp lo agradeceria
Desde ya muchas gracias
hernan perez tonini
buenos aires argentina
 

Leer las respuestas

#1 David Amador \(Davphantom\)
29/07/2003 - 07:27 | Informe spam
En la sección de OCX de mi pagina existe 4 OCX que hacen lo que necesitas
.

www.davphantom.cjb.net ...

David Amador Tapia
Webmaster de "La Web de Davphantom"
www.davphantom.cjb.net
Cartagena. Colombia
Tel (5) 6621502 - 6581523


"hernan perez tonini" escribió en el mensaje
news:07f001c35585$c2a28cf0$
Esparta por ahora estoy con vfp 6 buscando un poco mas
encontre algo pero no se como seguir el codigo que
encontre el cual esta en VB y es el siguiente:

Declare Function Shell_NotifyIcon Lib "shell32.dll" Alias
_
"Shell_NotifyIconA" (ByVal dwMessage As Long, lpData As _
NOTIFYICONDATA) As Long

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

'Make your own constant, e.g.:
Public Const NIF_DOALL = NIF_MESSAGE Or NIF_ICON Or
NIF_TIP

Public Const WM_MOUSEMOVE = &H200
Public Const WM_LBUTTONDBLCLK = &H203
Public Const WM_LBUTTONDOWN = &H201
Public Const WM_RBUTTONDOWN = &H204

2) Add a form to the project, and add the following code:

Public Sub CreateIcon()
Dim Tic As NOTIFYICONDATA
Tic.cbSize = Len(Tic)
Tic.hwnd = Picture1.hwnd
Tic.uID = 1&
Tic.uFlags = NIF_DOALL
Tic.uCallbackMessage = WM_MOUSEMOVE
Tic.hIcon = Picture1.Picture
Tic.szTip = "Visual Basic Demo Project" & Chr$(0)
erg = Shell_NotifyIcon(NIM_ADD, Tic)
End Sub

Public Sub DeleteIcon()
Dim Tic As NOTIFYICONDATA
Tic.cbSize = Len(Tic)
Tic.hwnd = Picture1.hwnd
Tic.uID = 1&
erg = Shell_NotifyIcon(NIM_DELETE, Tic)
End Sub

si alguien pude pasarlo a VFp lo agradeceria
Desde ya muchas gracias
hernan perez tonini
buenos aires argentina

Preguntas similares