send
Grupo de Telegram
play_arrow
Este sitio utiliza cookies propias y de terceros. Si continúa navegando consideramos que acepta el uso de cookies. OK Más Información.

Control total del taskbar

  • 0 Respuestas
  • 1310 Vistas

0 Usuarios y 1 Visitante están viendo este tema.

Conectado ANTRAX

  • *
  • Administrator
  • Mensajes: 5283
  • Actividad:
    35%
  • Reputación 28
  • ANTRAX
    • Ver Perfil
    • Underc0de
    • Email
  • Skype: underc0de.org
  • Twitter: @Underc0de
« en: Julio 26, 2010, 11:53:47 am »
Con esto puedes ocultar y/o mostrar los iconos que se encuentran al aldo del reloj del taskbar.

En un módulo:

Código: Visual Basic
  1. Public isvisible As Integer
  2. Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, y, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
  3. Private Const HWND_TOPMOST = -1
  4. Private Const HWND_NOTOPMOST = -2
  5. Private Const SWP_NOMOVE = &H2
  6. Private Const SWP_NOSIZE = &H1
  7. Private Const TOPMOST_FLAGS = SWP_NOMOVE Or SWP_NOSIZE
  8. Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
  9. Public Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
  10. Public Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
  11.  
  12. Public Function HideTaskBarIcons()
  13.     Dim FindClass As Long, Handle As Long
  14.     FindClass& = FindWindow("Shell_TrayWnd", "")
  15.     Handle& = FindWindowEx(FindClass&, 0, "TrayNotifyWnd", vbNullString)
  16.     ShowWindow Handle&, 0
  17. End Function
  18.  
  19. Public Function ShowTaskBarIcons()
  20.     Dim FindClass As Long, Handle As Long
  21.     FindClass& = FindWindow("Shell_TrayWnd", "")
  22.     Handle& = FindWindowEx(FindClass&, 0, "TrayNotifyWnd", vbNullString)
  23.     ShowWindow Handle&, 1
  24. End Function
  25.  
  26. Public Function HideTaskBarClock()
  27.     Dim FindClass As Long, FindParent As Long, Handle As Long
  28.     FindClass& = FindWindow("Shell_TrayWnd", vbNullString)
  29.     FindParent& = FindWindowEx(FindClass&, 0, "TrayNotifyWnd", vbNullString)
  30.     Handle& = FindWindowEx(FindParent&, 0, "TrayClockWClass", vbNullString)
  31.     ShowWindow Handle&, 0
  32. End Function
  33.  
  34. Public Function ShowTaskBarClock()
  35.     Dim FindClass As Long, FindParent As Long, Handle As Long
  36.     FindClass& = FindWindow("Shell_TrayWnd", vbNullString)
  37.     FindParent& = FindWindowEx(FindClass&, 0, "TrayNotifyWnd", vbNullString)
  38.     Handle& = FindWindowEx(FindParent&, 0, "TrayClockWClass", vbNullString)
  39.     ShowWindow Handle&, 1
  40. End Function
  41.  
  42. Public Function HideDesktop()
  43.     ShowWindow FindWindowEx(FindWindowEx(FindWindow("Progman", vbNullString), 0&, "SHELLDLL_DefView", vbNullString), 0&, "SysListView32", vbNullString), 0
  44. End Function
  45.  
  46. Public Function ShowDesktop()
  47.     ShowWindow FindWindowEx(FindWindowEx(FindWindow("Progman", vbNullString), 0&, "SHELLDLL_DefView", vbNullString), 0&, "SysListView32", vbNullString), 5
  48. End Function
  49.  
  50. Public Function HideStartButton()
  51.     Dim Handle As Long, FindClass As Long
  52.     FindClass& = FindWindow("Shell_TrayWnd", "")
  53.     Handle& = FindWindowEx(FindClass&, 0, "Button", vbNullString)
  54.     ShowWindow Handle&, 0
  55. End Function
  56.  
  57. Public Function ShowStartButton()
  58.     Dim Handle As Long, FindClass As Long
  59.     FindClass& = FindWindow("Shell_TrayWnd", "")
  60.     Handle& = FindWindowEx(FindClass&, 0, "Button", vbNullString)
  61.     ShowWindow Handle&, 1
  62. End Function
  63.  
  64. Public Function HideTaskBar()
  65.     Dim Handle As Long
  66.     Handle& = FindWindow("Shell_TrayWnd", vbNullString)
  67.     ShowWindow Handle&, 0
  68. End Function
  69.  
  70. Public Function ShowTaskBar()
  71.     Dim Handle As Long
  72.     Handle& = FindWindow("Shell_TrayWnd", vbNullString)
  73.     ShowWindow Handle&, 1
  74. End Function
  75.  
  76. Public Sub MakeNormal(hwnd As Long)
  77.     SetWindowPos hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, TOPMOST_FLAGS
  78. End Sub
  79.  
  80. Public Sub MakeTopMost(hwnd As Long)
  81.     SetWindowPos hwnd, HWND_TOPMOST, 0, 0, 0, 0, TOPMOST_FLAGS
  82. End Sub

En el form:

Código: Visual Basic
  1. Dim ico As Integer
  2. Dim clo As Integer
  3. Dim stb As Integer
  4. Dim tsk As Integer
  5. Dim dsk As Integer
  6.  
  7. Private Sub Command1_Click()
  8. If isvisible = 1 Then
  9.         If ico = 0 Then
  10.         ShowTaskBarIcons
  11.         ico = 1
  12.         ElseIf ico = 1 Then
  13.         HideTaskBarIcons
  14.         ico = 0
  15.         End If
  16.     ElseIf isvisible = 0 Then
  17.     End If
  18. End Sub
  19.  
  20. Private Sub Command2_Click()
  21. If isvisible = 1 Then
  22.         If clo = 0 Then
  23.         ShowTaskBarClock
  24.         clo = 1
  25.         ElseIf clo = 1 Then
  26.         HideTaskBarClock
  27.         clo = 0
  28.         End If
  29.     ElseIf isvisible = 0 Then
  30.     End If
  31. End Sub
  32.  
  33. Private Sub Command3_Click()
  34. If isvisible = 1 Then
  35.         If stb = 0 Then
  36.         ShowStartButton
  37.         stb = 1
  38.         ElseIf stb = 1 Then
  39.         HideStartButton
  40.         stb = 0
  41.         End If
  42.     ElseIf isvisible = 0 Then
  43.     End If
  44. End Sub
  45.  
  46. Private Sub Command4_Click()
  47.  If isvisible = 1 Then
  48.         If tsk = 0 Then
  49.         ShowTaskBar
  50.         tsk = 1
  51.         ElseIf tsk = 1 Then
  52.         HideTaskBar
  53.         tsk = 0
  54.         End If
  55.     ElseIf isvisible = 0 Then
  56.     End If
  57. End Sub
  58.  
  59. Private Sub Command5_Click()
  60. If isvisible = 1 Then
  61.         If dsk = 0 Then
  62.         ShowDesktop
  63.         dsk = 1
  64.         ElseIf dsk = 1 Then
  65.         HideDesktop
  66.         dsk = 0
  67.         End If
  68.     ElseIf isvisible = 0 Then
  69.     End If
  70. End Sub
  71.  
  72. Private Sub Command6_Click()
  73.    If isvisible = 1 Then
  74.         ShowTaskBarIcons
  75.         ShowTaskBarClock
  76.         ShowDesktop
  77.         ShowStartButton
  78.         ShowTaskBar
  79.         ico = 1
  80.         clo = 1
  81.         stb = 1
  82.         tsk = 1
  83.         dsk = 1
  84.     ElseIf isvisible = 0 Then
  85.     End If
  86. End Sub
  87.  
  88. Private Sub Form_Load()
  89. MakeTopMost Me.hwnd
  90. isvisible = 1
  91. ico = 1
  92. clo = 1
  93. stb = 1
  94. tsk = 1
  95. dsk = 1
  96. End Sub
« Última modificación: Julio 08, 2011, 10:31:44 am por ANTRAX »


 

¿Te gustó el post? COMPARTILO!



Aplicacion cliente servidor control Winsock (MSWINSCK.OCX)

Iniciado por ANTRAX

Respuestas: 0
Vistas: 1120
Último mensaje Julio 26, 2010, 12:20:55 pm
por ANTRAX
.bas para control de ODBC de bases de datos

Iniciado por ANTRAX

Respuestas: 0
Vistas: 1225
Último mensaje Julio 26, 2010, 12:41:20 pm
por ANTRAX
EAN13: Verificar y generar codigo de control

Iniciado por ANTRAX

Respuestas: 0
Vistas: 3100
Último mensaje Julio 26, 2010, 04:22:33 pm
por ANTRAX