Foros del Web » Programación para mayores de 30 ;) » Programación General »

Icono

Estas en el tema de Icono en el foro de Programación General en Foros del Web. Como puedo cambiar el icono de la barra de tareas en tiempo de ejecución. Ademas quisiera saber como puedo colocar el boton de la barra ...
  #1 (permalink)  
Antiguo 08/01/2003, 07:28
Badjov
Invitado
 
Mensajes: n/a
Puntos:
Icono

Como puedo cambiar el icono de la barra de tareas en tiempo de ejecución.

Ademas quisiera saber como puedo colocar el boton de la barra de tareas (la que generalmente se encuentra abajo), al lado del reloj solo como icono. (como el del volumen).


Gracias.
  #2 (permalink)  
Antiguo 08/01/2003, 08:34
Avatar de Jorge_Mota  
Fecha de Ingreso: diciembre-2002
Ubicación: Chapinlandia :-D
Mensajes: 725
Antigüedad: 21 años, 5 meses
Puntos: 11
has intentado con

form1.icon = "C:\archivos\archivo.ico"

si da error intenta

form1.icon = loadpicture("C:\archivos\archivo.ico")


Es Que No Tengo Visual Basic Instalado, y no lo puedo Probar.


Con Respecto a lo de Poner un icono en la Systray prueba esto:
'(tomado de www.allapi.net)

'Download the full source+pictures+... at http://www.allapi.net/php/redirect/r...download&id=38
Private 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

Private Const NIM_ADD = &H0
Private Const NIM_MODIFY = &H1
Private Const NIM_DELETE = &H2
Private Const NIF_MESSAGE = &H1
Private Const NIF_ICON = &H2
Private Const NIF_TIP = &H4

Private Const WM_LBUTTONDBLCLK = &H203
Private Const WM_LBUTTONDOWN = &H201
Private Const WM_RBUTTONUP = &H205

Private Declare Function Shell_NotifyIcon Lib "shell32" Alias "Shell_NotifyIconA" (ByVal dwMessage As Long, pnid As NOTIFYICONDATA) As Boolean
Dim TrayI As NOTIFYICONDATA
Private Sub Form_Load()
TrayI.cbSize = Len(TrayI)
'Set the window's handle (this will be used to hook the specified window)
TrayI.hWnd = pichook.hWnd
'Application-defined identifier of the taskbar icon
TrayI.uId = 1&
'Set the flags
TrayI.uFlags = NIF_ICON Or NIF_TIP Or NIF_MESSAGE
'Set the callback message
TrayI.ucallbackMessage = WM_LBUTTONDOWN
'Set the picture (must be an icon!)
TrayI.hIcon = imgIcon(2).Picture
'Set the tooltiptext
TrayI.szTip = "Recent" & Chr$(0)
'Create the icon
Shell_NotifyIcon NIM_ADD, TrayI

Me.Hide
End Sub
Private Sub Form_Unload(Cancel As Integer)
'remove the icon
TrayI.cbSize = Len(TrayI)
TrayI.hWnd = pichook.hWnd
TrayI.uId = 1&
Shell_NotifyIcon NIM_DELETE, TrayI
End
End Sub
Private Sub mnuPop_Click(Index As Integer)
Select Case Index
Case 0
MsgBox "KPD-Team 1998" + Chr$(13) + "URL: http://www.allapi.net/" + Chr$(13) + "E-Mail: [email protected]", vbInformation + vbOKOnly
Case 2
Unload Me
End Select
End Sub
Private Sub pichook_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Msg = X / Screen.TwipsPerPixelX
If Msg = WM_LBUTTONDBLCLK Then
'Left button double click
mnuPop_Click 0
ElseIf Msg = WM_RBUTTONUP Then
'Right button click
Me.PopupMenu mnuPopUp
End If
End Sub
Private Sub Timer1_Timer()
Static Tek As Integer
'Animate the icon
Me.Icon = imgIcon(Tek).Picture
TrayI.hIcon = imgIcon(Tek).Picture
Tek = Tek + 1
If Tek = 3 Then Tek = 0
Shell_NotifyIcon NIM_MODIFY, TrayI
End Sub
__________________
Jorge Mota
Blog
Gubiz estafa

Última edición por Jorge_Mota; 08/01/2003 a las 08:37
  #3 (permalink)  
Antiguo 08/01/2003, 08:39
Badjov
Invitado
 
Mensajes: n/a
Puntos:
Era tan simple, eso lo sabia pero se me habia olvidado como se cargaba la imagen.

Funciono a la perfección, te lo agradezco mucho, gracias.

¡¡¡Solo me falta una respuesta!!!
  #4 (permalink)  
Antiguo 08/01/2003, 08:49
Badjov
Invitado
 
Mensajes: n/a
Puntos:
Todo listo, el systray ya esta colocado.

muchas gracias por tu ayuda.
  #5 (permalink)  
Antiguo 08/01/2003, 08:51
Avatar de Jorge_Mota  
Fecha de Ingreso: diciembre-2002
Ubicación: Chapinlandia :-D
Mensajes: 725
Antigüedad: 21 años, 5 meses
Puntos: 11
Me alegra.

Cual fue la que te funciono?
la de LoadPicture() ?
__________________
Jorge Mota
Blog
Gubiz estafa
  #6 (permalink)  
Antiguo 08/01/2003, 08:53
Badjov
Invitado
 
Mensajes: n/a
Puntos:
Primero fue el loadpicture, yo colocaba loadimage.

Después pude hacer funcionar el systray.

Gracias de nuevo.
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 00:22.