TKSoft-Online

API: Dateieigenschaften Dialog anzeigen PDF Drucken E-Mail
( 0 Votes )
MS-Access Codes - Codeschnipsel Dateisystem
  
Mittwoch, den 30. April 2008 um 06:00 Uhr

Problemstellung:

Wie kann ich den Dateieigenschaften-Dialog anzeigen lassen? 

Lösung:

Folgenden Code in ein neues Modul kopieren.

Public Declare Function GetDesktopWindow _
    Lib "user32" () As Long

Public Declare Function ShellExecuteEX _
    Lib "shell32.dll" Alias "ShellExecuteEx" ( _
    lpShellExInfo As tShellExInfo) As Long

Public Type tShellExInfo
    cbSize           As Long
    fMask            As Long
    hwnd             As Long
    lpVerb           As String
    lpFile           As String
    lpParameters     As String
    lpDirectory      As String
    nShow            As Long
    hInstApp         As Long
    lpIDList         As Long
    lpClass          As String
    hkeyClass        As Long
    dwHotKey         As Long
    hIcon            As Long
    hProcess         As Long
End Type

Public Const SEE_MASK_INVOKEIDLIST = &HC
Public Const SEE_MASK_NOCLOSEPROCESS = &H40
Public Const SEE_MASK_FLAG_NO_UI = &H400

Public Function ShowShellObjectInfo( _
    ByVal sObjName As String, _
    Optional ByVal lngHWnd As Long = 0) As Long

    Dim typShellExInfo As tShellExInfo
    Dim lngRet As Long

    With typShellExInfo
        .cbSize = Len(typShellExInfo)

        .fMask = SEE_MASK_NOCLOSEPROCESS Or _
            SEE_MASK_INVOKEIDLIST Or SEE_MASK_FLAG_NO_UI

        .hwnd = IIf(lngHWnd = 0, GetDesktopWindow, lngHWnd)
        .lpVerb = "properties"
        .lpFile = sObjName
        .lpParameters = vbNullChar
        .lpDirectory = vbNullChar
        .nShow = 0
        .hInstApp = 0
        .lpIDList = 0
    End With

    lngRet = ShellExecuteEX(typShellExInfo)

    If Not (typShellExInfo.hInstApp > 32) Then
        ShowShellObjectInfo = -1
        Exit Function
    End If

    ShowShellObjectInfo = 0

End Function

 

Aufruf z.B.:

  ShowShellObjectInfo "D:\users\Daten\Vorlagen\Handkassenbeleg.doc"

 

Ergebnis:


DatumKlicks
Total2279
Do. 242
Mi. 233
Di. 224
Mo. 212
So. 202
Sa. 192
Fr. 182
Aktualisiert ( Freitag, den 02. Juli 2010 um 09:20 Uhr )
 

Kommentar schreiben


Sicherheitscode
Aktualisieren

Login

Latest Comments

Latest Forum Posts

Mehr »

Download Statistik

41 Kategorien
187 Dateien
173486 Downloads