A module which provides an interface to the win32 CE Remote API
-
Initializes the remote API.
-
UnInitializes the remote API.
-
Creates a new process and its primary thread. The new process executes the specified executable file.
-
Initializes the remote API asynchronously.
-
Copies a file
-
This function compares a specified string to the system password.
-
Creates or opens the a file or other object and returns a handle that can be used to access the object.
-
Deletes a file.
-
Renames an existing file or a directory (including all its children).
-
Creates a directory
-
Removes an existing directory
-
Obtains the temp path on the device.
-
Retrieves information about the CE device.
-
Retrieves information about the CE desktop.
-
Retrieves information about the CE system.
-
Retrieves the location of special folders on the CE device.
-
Retrieves information about store on the CE system.
-
Retrieves the power status of the CE device.
-
Creates a shortcut on the remote device.
-
Retrieves the target of a shortcut.
-
Returns the current version of Windows, and information about the environment for the CE device.
-
Returns information about current memory availability.
-
Retrieves a list of matching filenames on the CE device. An interface to the API CeFindFirstFile/CeFindNextFile functions.
-
Determines a files attributes.
-
Changes a file's attributes.
-
Determines the size of a file.
-
Reads a file from the CE device.
-
Writes a string to a file
wincerapi.CEHANDLE
PyCEHANDLE = CEHANDLE() Creates a new CEHANDLE object
const wincerapi.CSIDL_BITBUCKET;
Recycle bin-file system directory containing file objects in the user's recycle bin. The location of this directory is not in the registry; it is marked with the hidden and system attributes to prevent the user from moving or deleting it.
const wincerapi.CSIDL_COMMON_DESKTOPDIRECTORY;
File system directory that contains files and folders that appear on the desktop for all users.
const wincerapi.CSIDL_COMMON_PROGRAMS;
File system directory that contains the directories for the common program groups that appear on the Start menu for all users.
const wincerapi.CSIDL_COMMON_STARTMENU;
File system directory that contains the programs and folders that appear on the Start menu for all users.
const wincerapi.CSIDL_COMMON_STARTUP;
File system directory that contains the programs that appear in the Startup folder for all users. The system starts these programs whenever any user logs on to a Windows desktop platform.
const wincerapi.CSIDL_CONTROLS;
Control Panel-virtual folder containing icons for the control panel applications.
const wincerapi.CSIDL_DESKTOP;
Windows desktop-virtual folder at the root of the name space.
const wincerapi.CSIDL_DESKTOPDIRECTORY;
File system directory used to physically store file objects on the desktop - not to be confused with the desktop folder itself.
const wincerapi.CSIDL_DRIVES;
My Computer-virtual folder containing everything on the local computer: storage devices, printers, and Control Panel. The folder can also contain mapped network drives.
const wincerapi.CSIDL_FONTS;
Virtual folder containing fonts.
const wincerapi.CSIDL_NETHOOD;
File system directory containing objects that appear in the network neighborhood.
const wincerapi.CSIDL_NETWORK;
Network Neighborhood-virtual folder representing the top level of the network hierarchy.
const wincerapi.CSIDL_PERSONAL;
File system directory that serves as a common repository for documents.
const wincerapi.CSIDL_PRINTERS;
Printers folder-virtual folder containing installed printers.
const wincerapi.CSIDL_PROGRAMS;
File system directory that contains the user's program groups which are also file system directories.
const wincerapi.CSIDL_RECENT;
File system directory containing the user's most recently used documents.
const wincerapi.CSIDL_SENDTO;
File system directory containing Send To menu items.
const wincerapi.CSIDL_STARTMENU;
File system directory containing Start menu items.
const wincerapi.CSIDL_STARTUP;
File system directory that corresponds to the user's Startup program group.
const wincerapi.CSIDL_TEMPLATES;
File system directory that serves as a common repository for document templates.
wincerapi.CeCheckPassword
CeCheckPassword(password) This function compares a specified string to the system password.
-
password : PyUnicode
The password to compare.
wincerapi.CeCopyFile
CeCopyFile(from, to, bFailIfExists) Copies a file
-
from : PyUnicode
The name of the file to copy from
-
to : PyUnicode
The name of the file to copy to
-
bFailIfExists : int
Indicates if the operation should fail if the file exists.
wincerapi.CeCreateDirectory
CeCreateDirectory(name, sa) Creates a directory
-
name : PyUnicode
The name of the directory to create
-
The security attributes, or None
wincerapi.CeCreateFile
PyCEHANDLE = CeCreateFile(fileName, desiredAccess
, shareMode
, attributes
, creationDisposition
, flagsAndAttributes
, hTemplateFile
) Creates or opens the a file or other object and returns a handle that can be used to access the object.
-
fileName : PyUnicode
The name of the file
-
desiredAccess : int
access (read-write) mode
Specifies the type of access to the object. An application can obtain read access, write access, read-write access, or device query access. This parameter can be any combination of the following values.
Value
Meaning
0Specifies device query access to the object. An application can query device attributes without accessing the device.
GENERIC_READSpecifies read access to the object. Data can be read from the file and the file pointer can be moved. Combine with GENERIC_WRITE for read-write access.
GENERIC_WRITESpecifies write access to the object. Data can be written to the file and the file pointer can be moved. Combine with GENERIC_READ for read-write access.
-
shareMode : int
Set of bit flags that specifies how the object can be shared. If dwShareMode is 0, the object cannot be shared. Subsequent open operations on the object will fail, until the handle is closed.
To share the object, use a combination of one or more of the following values:
Value
Meaning
FILE_SHARE_DELETEWindows NT: Subsequent open operations on the object will succeed only if delete access is requested.
FILE_SHARE_READSubsequent open operations on the object will succeed only if read access is requested.
FILE_SHARE_WRITESubsequent open operations on the object will succeed only if write access is requested.
-
attributes : PySECURITY_ATTRIBUTES
The security attributes, or None
-
creationDisposition : int
Specifies which action to take on files that exist, and which action to take when files do not exist. For more information about this parameter, see the Remarks section. This parameter must be one of the following values:
Value
Meaning
CREATE_NEWCreates a new file. The function fails if the specified file already exists.
CREATE_ALWAYSCreates a new file. If the file exists, the function overwrites the file and clears the existing attributes.
OPEN_EXISTINGOpens the file. The function fails if the file does not exist.
See the Remarks section for a discussion of why you should use the OPEN_EXISTING flag if you are using the CreateFile function for devices, including the console.
OPEN_ALWAYSOpens the file, if it exists. If the file does not exist, the function creates the file as if dwCreationDisposition were CREATE_NEW.
TRUNCATE_EXISTINGOpens the file. Once opened, the file is truncated so that its size is zero bytes. The calling process must open the file with at least GENERIC_WRITE access. The function fails if the file does not exist.
-
flagsAndAttributes : int
file attributes
-
hTemplateFile : PyHANDLE
Specifies a handle with GENERIC_READ access to a template file. The template file supplies file attributes and extended attributes for the file being created. Under Win95, this must be 0, else an exception will be raised.
The following objects can be opened: files pipes mailslots communications resources disk devices (Windows NT only) consoles directories (open only)
wincerapi.CeDeleteFile
CeDeleteFile(fileName) Deletes a file.
-
fileName : PyUnicode
The filename to delete
wincerapi.CeGetDesktopDeviceCaps
int = CeGetDesktopDeviceCaps() Retrieves information about the CE desktop.
wincerapi.CeGetFileAttributes
int = CeGetFileAttributes(fileName) Determines a files attributes.
-
fileName : PyUnicode
Name of the file to retrieve attributes for.
wincerapi.CeGetFileSize
PyLARGE_INTEGER
= CeGetFileSize() Determines the size of a file.
wincerapi.CeGetSpecialFolderPath
PyUnicode = CeGetSpecialFolderPath() Retrieves the location of special folders on the CE device.
wincerapi.CeGetStoreInformation
int, int = CeGetStoreInformation() Retrieves information about store on the CE system.
The result is a tuple of (storeSize, freeSize)
wincerapi.CeGetSystemInfo
tuple = CeGetSystemInfo() Retrieves information about the CE device.
- Search for GetSystemInfo at msdn, google or google groups.
The return value is a tuple of 9 values, which corresponds
to the Win32 SYSTEM_INFO structure. The element names are:
dwOemId dwPageSize lpMinimumApplicationAddress lpMaximumApplicationAddress ,
dwActiveProcessorMask dwNumberOfProcessors
dwProcessorType dwAllocationGranularity (wProcessorLevel,wProcessorRevision)
wincerapi.CeGetSystemMetrics
int = CeGetSystemMetrics() Retrieves information about the CE system.
wincerapi.CeGetSystemPowerStatusEx
tuple = CeGetSystemPowerStatusEx() Retrieves the power status of the CE device.
The result is a tuple of (ACLineStatus, BatteryFlag, BatteryLifePercent, BatteryLifeTime, BatteryFullLifeTime, BackupBatteryFlag, BackupBatteryLifePercent, BackupBatteryLifeTime, BackupBatteryLifeTime);
wincerapi.CeGetTempPath
PyUnicode = CeGetTempPath() Obtains the temp path on the device.
wincerapi.CeGetVersionEx
(int,int,int,int,string) = CeGetVersionEx() Returns the current version of Windows, and information about the environment for the CE device.
The return value is a tuple with the following information.
wincerapi.CeGlobalMemoryStatus
tuple = CeGlobalMemoryStatus() Returns information about current memory availability.
The return value is a tuple with the following information.
wincerapi.CeMoveFile
CeMoveFile(existingFileName, newFileName) Renames an existing file or a directory (including all its children).
-
existingFileName : PyUnicode
Name of the existing file
-
newFileName : PyUnicode
New name for the file
wincerapi.CeRapiInit
CeRapiInit() Initializes the remote API.
wincerapi.CeRapiInitEx
int = CeRapiInitEx() Initializes the remote API asynchronously.
wincerapi.CeRapiUninit
CeRapiUninit() UnInitializes the remote API.
wincerapi.CeReadFile
string = CeReadFile(hFile, bufSize
) Reads a file from the CE device.
-
hFile : PyHANDLE/int
Handle to the file
-
bufSize : int
Size of the buffer to create for the read.
wincerapi.CeRemoveDirectory
CeRemoveDirectory(lpPathName) Removes an existing directory
-
lpPathName : PyUnicode
Name of the path to remove.
wincerapi.CeSHCreateShortcut
CeSHCreateShortcut() Creates a shortcut on the remote device.
wincerapi.CeSHGetShortcutTarget
tuple = CeSHGetShortcutTarget() Retrieves the target of a shortcut.
wincerapi.CeSetFileAttributes
CeSetFileAttributes(filename, newAttributes) Changes a file's attributes.
-
filename : PyUnicode
filename
-
newAttributes : int
attributes to set
wincerapi.CreateProcess
PyHANDLE, PyHANDLE, int, int = CreateProcess(appName, commandLine
, processAttributes
, threadAttributes
, bInheritHandles
, dwCreationFlags
, newEnvironment
, currentDirectory
, startupinfo
) Creates a new process and its primary thread. The new process executes the specified executable file.
-
appName : string
name of executable module, or None
-
commandLine : string
command line string, or None
-
processAttributes : PySECURITY_ATTRIBUTES
process security attributes, or None
-
threadAttributes : PySECURITY_ATTRIBUTES
thread security attributes, or None
-
bInheritHandles : int
handle inheritance flag
-
dwCreationFlags : int
creation flags
-
newEnvironment : None
A dictionary of stringor Unicode pairs to define the environment for the process, or None to inherit the current environment.
-
currentDirectory : string
current directory name, or None
-
startupinfo : PySTARTUPINFO
a STARTUPINFO object that specifies how the main window for the new process should appear.
The result is a tuple of (hProcess, hThread, dwProcessId, dwThreadId)
wincerapi.FindFiles
list = FindFiles(fileSpec) Retrieves a list of matching filenames on the CE device. An interface to the API CeFindFirstFile/CeFindNextFile functions.
-
fileSpec : PyUnicode
A string that specifies a valid directory or path and filename, which can contain wildcard characters (* and ?).
-
Search for CeFindFirstFile at msdn, google or google groups.
-
Search for FindNextFile at msdn, google or google groups.
-
Search for CloseHandle at msdn, google or google groups.
The return value is a list of tuples, in the same format as the WIN32_FIND_DATA structure:
-
[0] int : attributes
File Attributes. A combination of the win32com.FILE_ATTRIBUTE_* flags.
-
[1] PyTime : createTime
File creation time.
-
[2] PyTime : accessTime
File access time.
-
[3] PyTime : writeTime
Time of last file write
-
[4] int : nFileSizeHigh
high order word of file size.
-
[5] int : nFileSizeLow
low order word of file size.
-
[6] int : OID
The object identifier for the file
-
[7] int : zero
Filler
-
[8] string : fileName
The name of the file.
-
[9] None : altName
Always None
wincerapi.WriteFile
int, int = WriteFile(hFile, data
) Writes a string to a file
-
hFile : PyHANDLE/int
Handle to the file
-
data : string
The data to write.
The result is a tuple of (errCode, nBytesWritten).
errCode will always be zero (until overlapped IO is supported!)