Visual Basic Forum

Visual Basic Forum
für VB6 und VB.NET Programmierer
 
RegistrierenRegistrieren  LoginLogin

Neues Thema eröffnen   Neue Antwort erstellen    Visual Basic Forum Foren-Übersicht -> [VB.NET] Tipps & Tricks
Autor
Nachricht
^^kev####
Überflieger
Überflieger

Anmeldedatum: 01.05.2008
Beiträge: 476
Wohnort: Haan

Datei mittels Windows Dialog kopieren
Verfasst am: 29.06.2009, 14:04

Beschreibung:
Datei mittels Windows Dialog kopieren

Funktion:
Visual Basic: [code]Private Declare Function SHFileOperation Lib "shell32.dll" Alias "SHFileOperationA" (ByRef lpFileOp As SHFILEOPSTRUCT) As Integer

Private Structure SHFILEOPSTRUCT
Dim hwnd As Integer
Dim wFunc As Integer
Dim pFrom As String
Dim pTo As String
Dim fFlags As Short
Dim fAnyOperationsAborted As Boolean
Dim hNameMappings As Integer
Dim lpszProgressTitle As String
End Structure

Const FO_COPY As Short = &H2S

Public Function ShellCopy(ByVal strSource As String, ByVal strTarget As String, ByVal Handle As Long) As Boolean
Dim SFO As New SHFILEOPSTRUCT

If Right(strSource, 1) = "" Then strSource = Mid(strSource, 1, Len(strSource) - 1)
ShellCopy = True
With SFO
.hwnd = Handle
.wFunc = FO_COPY
.pFrom = strSource & Chr(0) & Chr(0)
.pTo = strTarget & Chr(0) & Chr(0)
End With

Call SHFileOperation(SFO)
If SFO.fAnyOperationsAborted Then ShellCopy = False
End Function
[/code]

Quelle: dotnet-snippets.de
_________________
 
Neues Thema eröffnen   Neue Antwort erstellen    Visual Basic Forum Foren-Übersicht -> [VB.NET] Tipps & Tricks

Tags: windows dialog, dialog kopieren

 
 Verwandte Themen   Aufrufe   Letzter Beitrag 
Keine neuen Beiträge Problem mit always on top funktion 1039 30.10.2009, 11:26
Keine neuen Beiträge IntStr()funktion 1177 11.10.2007, 08:49
Keine neuen Beiträge TopMost Funktion unter DirectX 921 27.07.2007, 10:48
Keine neuen Beiträge Wie Funktion nutzen ? 1101 29.06.2007, 20:59
Keine neuen Beiträge update funktion einbauen 1341 28.01.2007, 23:11
 



[ Time: 0.1386s ][ Queries: 83 (0.0295s) ][ GZIP on - Debug on ]