Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

API-Funktion für Öffnen Dialog

Empfohlene Antworten

Veröffentlicht

Hallo!

Ich bräuchte die API-Funktion, bei der der Öffnen Dialog aufgeht, d. h. der Dialog bei dem man eine Datei am ende auswählen muss. Bis jetzt hab ich nur die API-Funktion gefunden, bei der Man den ganzen Ordner auswählen kann (SHBrowseForFolder)

Gruß Sonic83

die Funktion heißt "GetOpenFileName"

hier ein Beispiel für VB (falls des deine Sprache ist.. )

ausm API-Guide den man unter www.allapi.net sich downloaden kann! Da sind dann api's für alle Lebenslagen drin!

so hier das beispiel...

Private Declare Function GetOpenFileName Lib "comdlg32.dll" Alias "GetOpenFileNameA" (pOpenfilename As OPENFILENAME) As Long

Private Type OPENFILENAME

lStructSize As Long

hwndOwner As Long

hInstance As Long

lpstrFilter As String

lpstrCustomFilter As String

nMaxCustFilter As Long

nFilterIndex As Long

lpstrFile As String

nMaxFile As Long

lpstrFileTitle As String

nMaxFileTitle As Long

lpstrInitialDir As String

lpstrTitle As String

flags As Long

nFileOffset As Integer

nFileExtension As Integer

lpstrDefExt As String

lCustData As Long

lpfnHook As Long

lpTemplateName As String

End Type

Private Sub Form_Load()

'KPD-Team 1998

'URL: http://www.allapi.net/

'E-Mail: KPDTeam@Allapi.net

Dim OFName As OPENFILENAME

OFName.lStructSize = Len(OFName)

'Set the parent window

OFName.hwndOwner = Me.hWnd

'Set the application's instance

OFName.hInstance = App.hInstance

'Select a filter

OFName.lpstrFilter = "Text Files (*.txt)" + Chr$(0) + "*.txt" + Chr$(0) + "All Files (*.*)" + Chr$(0) + "*.*" + Chr$(0)

'create a buffer for the file

OFName.lpstrFile = Space$(254)

'set the maximum length of a returned file

OFName.nMaxFile = 255

'Create a buffer for the file title

OFName.lpstrFileTitle = Space$(254)

'Set the maximum length of a returned file title

OFName.nMaxFileTitle = 255

'Set the initial directory

OFName.lpstrInitialDir = "C:\"

'Set the title

OFName.lpstrTitle = "Open File - KPD-Team 1998"

'No flags

OFName.flags = 0

'Show the 'Open File'-dialog

If GetOpenFileName(OFName) Then

MsgBox "File to Open: " + Trim$(OFName.lpstrFile)

Else

MsgBox "Cancel was pressed"

End If

End Sub

<FONT COLOR="#a62a2a" SIZE="1">[ 10. Dezember 2001 14:28: Beitrag 1 mal editiert, zuletzt von Mister A ]</font>

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.