Visualizzazione dei risultati da 1 a 4 su 4
  1. #1

    [WIN->VB] Aprire Cartelle senza l' Explorer!

    I file sappiamo tutti che quando ci clicchiamo vengono aperti tramite un programma associato al tipo d' estensione.
    Quindi basta cambiare programma e il file si apre con cio' che si vuole!
    Ma...
    :master: se io volessi aprire una cartella?? Sicuramente usa l' EXPLORER. Ma è associato ad un estensione o classe??? Ovvero queli sono l'estensione o classe di una cartella se esistono?
    Come faccio per fare si che quando clicco 2 volte su una cartella essa non mi si apra con l' Explorer ma con il programma che decido io??? Ciao e grazie in anticipo
    jabjoint

  2. #2
    Utente bannato
    Registrato dal
    Apr 2002
    Messaggi
    546
    Se ti va bene questo..............

    Metti un pulsante nel form e chiamalo cmdBrowseDir

    '------------taglia da quì-------------
    Option Explicit

    Private Type BROWSEINFO
    hOwner As Long
    pidlRoot As Long
    pszDisplayName As String
    lpszTitle As String
    ulFlags As Long
    lpfn As Long
    lParam As Long
    iImage As Long
    End Type

    Private Type SHITEMID
    cb As Long
    abID As Byte
    End Type

    Private Type ITEMIDLIST
    mkid As SHITEMID
    End Type

    Private Const BIF_RETURNONLYFSDIRS = &H1
    Private Const BIF_DONTGOBELOWDOMAIN = &H2
    Private Const BIF_STATUSTEXT = &H4
    Private Const BIF_RETURNFSANCESTORS = &H8
    Private Const BIF_BROWSEFORCOMPUTER = &H1000
    Private Const BIF_BROWSEFORPRINTER = &H2000

    Private Declare Function SHGetPathFromIDList Lib "shell32.dll" Alias "SHGetPathFromIDListA" (ByVal pidl As Long, ByVal pszPath As String) As Long
    Private Declare Function SHGetSpecialFolderLocation Lib "shell32.dll" (ByVal hwndOwner As Long, ByVal nFolder As Long, pidl As ITEMIDLIST) As Long
    Private Declare Function SHBrowseForFolder Lib "shell32.dll" Alias "SHBrowseForFolderA" (lpBrowseInfo As BROWSEINFO) As Long



    Private Function BrowseFolder(ByVal hwnd As Long, ByVal szDialogTitle As String) As String
    Dim Esito As Long
    Dim Bi As BROWSEINFO
    Dim dwIList As Long
    Dim szPath As String

    Bi.hOwner = hwnd
    Bi.lpszTitle = szDialogTitle
    Bi.ulFlags = BIF_RETURNONLYFSDIRS
    szPath = Space$(1024)
    dwIList = SHBrowseForFolder(Bi)
    Esito = SHGetPathFromIDList(ByVal dwIList, ByVal szPath)
    If Esito Then
    BrowseFolder = Left$(szPath, InStr(szPath, Chr(0)) - 1)
    Else
    BrowseFolder = ""
    End If

    End Function


    Private Sub cmdBrowseDir_Click()
    Dim DirSelected As String

    DirSelected = BrowseFolder(Me.hwnd, "Seleziona" & Chr$(10) & "La cartella")
    If DirSelected = "" Then Exit Sub
    MsgBox DirSelected

    End Sub

    '---------a qui------------------------

    ciao jab


    link
    homepage
    http://%77%77%77%2e%74%77%6f%72%6b%2e%69%74/
    software
    http://%77%77%77%2e%74%77%6f%72%6b%2...programmi.html
    forum
    http://%77%77%77%2e%74%77%6f%72%6b%2...um/default.asp

  3. #3
    Inanzitutto Grazie per il codice anche se non era quello che mi serviva ma cmq mi potrà servire per tanto l' ho salvato in un file di testo.

    Il mio problema era quello di fare un programma che mi tenesse sotto controllo le cartelle che voglio io.
    L' explorer apre le cartelle giusto?
    Io devo aprirle tramite un mio programma! Devo quindi far attivare il mio programma quando clicco sulla cartella! Poi il mio programma deciderà se aprire o meno la cartella! Ovviamente tutto per mantenerle segrete! Per aprirle ci vorrà una password(ma questo non è importante x voi )

    Se nn avete capito un tubo.

    Eccovi un es:

    es. avete presente i file TXT????

    Bene quelli utilizzano il NOTEPAD.EXE per essere aperti. Giusto?
    Ecco nel registro c' è scritto dove c' è l' estensione ".txt"
    e il relativo notepad.exe seguito da "%1" che indica il file!!!

    Porca puttana aiutatemi!!!!!
    jabjoint

  4. #4
    Aspettate l' ESEMPIO VALE x i file TXT che è una cazzata da applicare a me serve per le CARTELLE!!!
    jabjoint

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 © 2024 vBulletin Solutions, Inc. All rights reserved.