| |
Fortgeschrittene ProgrammierungRe: Zugriff auf Pocket PC wie im Windows Explorer | | | Autor: Mattes | Datum: 28.06.07 10:44 |
| Hi,
sorry, ich hätte Dich fast vergessen, da ich bezüglich Arbeit momentan viel um die Ohren habe.
Den folgenden Code habe ich aus meinem Rapi Modul kopiert. Er enthält einige Api Deklarationen für den Pocket PC. Ich hoffe Du kannst damit was Anfangen. Ansonsten meld Dich einfach. Bei mir ist es zeitlich nur etwas schwierig im moment.
Also hier nur der Code:
Public Const HKEY_CLASSES_ROOT = &H80000000
Public Const HKEY_CURRENT_USER = &H80000001
Public Const HKEY_LOCAL_MACHINE = &H80000002
Public Const ERROR_SUCCESS = 0
Public Const REG_DWORD = 4 '32-bit number.
Public Const REG_SZ = 1
Public Const INVALID_HANDLE = -1
Public Const GENERIC_READ = &H80000000
Public Const GENERIC_WRITE = &H40000000 '(1073741824)
Public Const FILE_SHARE_READ = 1
Public Const FILE_SHARE_WRITE = 2
Public Const CREATE_ALWAYS = 2
Public Const OPEN_EXISTING = 3
Public Const INIT_SUCCESS = 0
Public Const WRITE_ERROR = 0
Public Const READ_ERROR = 0
Public Const FILE_ATTRIBUTE_NORMAL = 128
Declare Function CeRapiInitEx Lib "rapi.dll" ( _
pRapiInit As RAPIINIT) As Long
Declare Function CeRapiUninit Lib "rapi.dll" () As Long
Declare Function CeCloseHandle Lib "rapi.dll" (ByVal hObject As Long) As Long
'Registry Funktion
Declare Function CeRegOpenKeyEx Lib "rapi.dll" ( _
ByVal hkey As Long, _
ByVal lpSubKey As Long, _
ByVal ulOptions As Long, _
ByVal samDesired As Long, _
phkResult As Long) As Long
Declare Function CeRegQueryValueEx Lib "rapi.dll" ( _
ByVal hkey As Long, _
ByVal lpValueName As Long, _
ByVal lpReserved As Long, _
lpType As Long, _
ByVal lpdata As Long, _
lpcbData As Long) As Long
Declare Function CeRegQueryValueExString Lib "rapi.dll" _
Alias "CeRegQueryValueEx" ( _
ByVal hkey As Long, _
ByVal lpValueName As Long, _
ByVal lpReserved As Long, _
lpType As Long, _
ByVal lpdata As Long, _
lpcbData As Long) As Long
Declare Function CeRegQueryValueExLong Lib "rapi.dll" _
Alias "CeRegQueryValueEx" ( _
ByVal hkey As Long, _
ByVal lpValueName As Long, _
ByVal lpReserved As Long, _
lpType As Long, _
lpdata As Long, _
lpcbData As Long) As Long
Declare Function CeRegCloseKey Lib "rapi.dll" ( _
ByVal hkey As Long) As Long
'File Funtionen
Declare Function CeDeleteFile Lib "rapi.dll" (ByVal lpFileName As Long) As Long
Declare Function CeFindFirstFile Lib "rapi.dll" ( _
ByVal lpFileName As Long, _
lpFindFileData As CE_FIND_DATA) As Long
Declare Function CeFindNextFile Lib "rapi.dll" (ByVal hFindFile As Long, _
lpFindFileData As CE_FIND_DATA) As Long
Public Declare Function CeCreateFile Lib "rapi.dll" ( _
ByVal lpFileName As Long, _
ByVal dwDesiredAccess As Long, _
ByVal dwShareMode As Long, _
lpSecurityAttributes As SECURITY_ATTRIBUTES, _
ByVal dwCreationDistribution As Long, _
ByVal dwFlagsAndAttributes As Long, _
ByVal hTemplateFile As Long) As Long
Declare Function CeReadFile Lib "rapi.dll" (ByVal hFile As Long, _
lpBuffer As Any, _
ByVal nNumberOfBytesToRead As Long, _
lpNumberOfBytesRead As Long, _
ByVal CeReadFileNull As Long) As Long
Declare Function CeCopyFile Lib "rapi.dll" (CurrentPath As Long, _
NewPath As Long, Overwrite As Boolean) As Long
Type SECURITY_ATTRIBUTES
nLength As Long
lpSecurityDescriptor As Long
bInheritHandle As Long
End Type
Type FILETIME
dwHighDateTime As Long
dwLowDateTime As Long
End Type
Type CE_FIND_DATA
dwFileAttributes As Long
ftCreationTime As FILETIME
ftLastAccessTime As FILETIME
ftLastWriteTime As FILETIME
nFileSizeHigh As Long
nFileSizeLow As Long
dwOID As Long
cFileName(0 To 259) As Integer
End Type
Type RAPIINIT
cbsize As Long
heRapiInit As Long
hrRapiInit As Long
End Type
' Initialize RAPI
Function ConnectRapi() As Long
Dim lcon As Long
Dim lRapiInit As RAPIINIT
CeRapiUninit
DoEvents
With lRapiInit
.cbsize = Len(lRapiInit)
.heRapiInit = 0
.hrRapiInit = 0
End With
lcon = CeRapiInitEx(lRapiInit)
ConnectRapi = lcon
End Function
' Uninitialize RAPI
Function DisconnectRapi() As Long
Dim lcon As Long
lcon = CeRapiUninit
DisconnectRapi = lcon
End Function
P.S.: | |
| Sie sind nicht angemeldet! Um auf diesen Beitrag zu antworten oder neue Beiträge schreiben zu können, müssen Sie sich zunächst anmelden.
Einloggen | Neu registrieren |
|
|
sevWizard für VB5/6
Professionelle Assistenten im Handumdrehen
Erstellen Sie eigene Assistenten (Wizards) im Look & Feel von Windows 2000/XP - mit allem Komfort und zwar in Windeseile :-) Weitere InfosTipp des Monats TOP Entwickler-Paket
TOP-Preis!!
Mit der Developer CD erhalten Sie insgesamt 24 Entwickler- komponenten und Windows-DLLs. Die Einzelkomponenten haben einen Gesamtwert von 1605.50 EUR...
Jetzt nur 599,00 EURWeitere Infos
|
|
|
Copyright ©2000-2024 vb@rchiv Dieter Otter Alle Rechte vorbehalten.
Microsoft, Windows und Visual Basic sind entweder eingetragene Marken oder Marken der Microsoft Corporation in den USA und/oder anderen Ländern. Weitere auf dieser Homepage aufgeführten Produkt- und Firmennamen können geschützte Marken ihrer jeweiligen Inhaber sein.
Diese Seiten wurden optimiert für eine Bildschirmauflösung von mind. 1280x1024 Pixel
|
|