Visualizzazione dei risultati da 1 a 7 su 7
  1. #1
    Utente di HTML.it
    Registrato dal
    Nov 2002
    Messaggi
    2,460

    [vb6] creare una taskbar

    com'è possibile ricreare un clone della taskbar di windows in vb ?
    se è possibile..

  2. #2
    Utente bannato
    Registrato dal
    Sep 2003
    Messaggi
    1,012
    Un metodo sarebbe creare un form abbastanza basso e largo con Borderstyle=0 e moverable = false.
    Poi magariusi diversi controlli image...

  3. #3
    Utente di HTML.it
    Registrato dal
    Nov 2002
    Messaggi
    2,460
    si ma io intendo per la gestione finestrelle dei processi..
    tipo quella di internet explorer ecc

  4. #4
    Utente bannato
    Registrato dal
    Sep 2003
    Messaggi
    1,012
    Ad esempio con questo codice:
    codice:
    hWnd = ChildWindow(DesktopWindow)
    Do While hWnd <> 0
    MsgBox hWnd
        hWnd = NextWindow(hWnd)
    Loop
    + le dichiarazioni API hai la lista delle finestre aperte
    poi puoi vedere se sono visibili,il loro testo, tutto attraverso le API...

  5. #5
    Di api ChildWindow però ne esistono due

    -ChildWindowFromPoint

    -ChildWindowFromPointEx
    "Penso che nel mondo ci sia mercato per quattro o cinque computer"... Thomas Watson, presidente della IBM, 1943

  6. #6
    Utente di HTML.it
    Registrato dal
    Nov 2002
    Messaggi
    2,460
    potreste darmi un bel tutorials o qualche pagina di documentazione che mi informo ?

  7. #7
    Utente bannato
    Registrato dal
    Sep 2003
    Messaggi
    1,012
    Scusa ma l'API ChildWindow non esiste!
    Era una funzione che avevo fatto io!

    Ecco un esempio che riempie un array di tipo finestra con tutte le finestre aperte:

    codice:
    'Serve per getwindowrect
    Private Type RECT
            Left As Long
            Top As Long
            Right As Long
            Bottom As Long
    End Type
    
    Private Type Finestra
        Handle As Long
        Titolo As String
        Visibile As Boolean
        Stato As FormWindowStateConstants
        PosY As Long
        PosX As Long
        Altezza As Long
        Larghezza As Long
    End Type
    
    'Dichiarazioni API
    Private Declare Function GetWindowRect Lib "user32" (ByVal hWnd As Long, lpRect As RECT) As Long
    Private Declare Function IsWindowVisible Lib "user32" (ByVal hWnd As Long) As Long
    Private Declare Function IsIconic Lib "user32" (ByVal hWnd As Long) As Long
    Private Declare Function IsZoomed Lib "user32" (ByVal hWnd As Long) As Long
    Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hWnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
    Private Declare Function GetWindow Lib "user32" (ByVal hWnd As Long, ByVal wCmd As Long) As Long
    Private Declare Function GetDesktopWindow Lib "user32" () As Long
    
    'Costanti API
    Private Const GW_CHILD = 5
    Private Const GW_HWNDNEXT = 2
    
    Private Sub RiempiVettore(ByRef arr() As Finestra)
    Dim h As Long, tot As Integer
    Dim Buf As String * 255
    Dim LunghezzaTitolo As Long
    Dim Pos As RECT
    tot = 0
    h = GetWindow(GetDesktopWindow, GW_CHILD)
    Do While h <> 0
        tot = tot + 1
        ReDim Preserve arr(tot - 1) As Finestra
    'Imposta l'handle
        arr(tot - 1).Handle = h
    'Calcola il titolo con GetWindowText()
        Buf = String(255, " ")
        LunghezzaTitolo = GetWindowText(h, Buf, 255)
        arr(tot - 1).Titolo = Left(Buf, LunghezzaTitolo)
    'Calcola altezza, larghezza e posizione
        Call GetWindowRect(h, Pos)
        arr(tot - 1).PosX = Pos.Left
        arr(tot - 1).PosY = Pos.Top
        arr(tot - 1).Altezza = Pos.Bottom - Pos.Top
        arr(tot - 1).Altezza = Pos.Right - Pos.Left
    'Calcola se è visibile
        arr(tot - 1).Visibile = IsWindowVisible(h)
    'Calcola lo stato
        If IsIconic(h) Then
            'Ridotto ad icona
            arr(tot - 1).Stato = vbMinimized
        ElseIf IsZoomed(h) Then
            'Ingrandito
            arr(tot - 1).Stato = vbMaximized
        Else
            'Normale
            arr(tot - 1).Stato = vbNormal
        End If
    'Prossima finestra
         h = GetWindow(h, GW_HWNDNEXT)
    Loop
    End Sub
    
    Private Sub Form_Load()
    Dim arr() As Finestra
    Call RiempiVettore(arr())
    End Sub

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.