VBRAPI

Up
3DGraphics
CECards
ControlPanel
CreateEMail
Painter
ImageProcessing
DIBRotation
HexEdit
ProfileStrings
VBRAPI
CEShopper
CEThreads
HideTaskBar
HardwareKey
KeepAlive
CEMonkey
Pinging
POOMSamples
FrameBuffer
ICENStall

Home
Up

 

Name: VBRAPI

Download: VBRapi.zip

What is it: Using RAPI from VB on the desktop.

Features:

For Windows CE 2.0!

No Rights Reserved (i.e. FreeWare)

NOTE: Not all exposed functions are thoroughly tested. So use at your own risk. However, the functions used in the samples are tested thoroughly.

 

RemoteCE.tlb is a typelibrary that will allow the programmer to use the RAPI functions easily (hopefully) from within any COM aware development environment. For example, you can use the typelibrary to build a backup program entirely within the VBA implementation in MS Word.

The RemoteCE typelibrary functions as a simple way to utilize the RAPI.dll from within Visual Basic, without the use of the 'Declare' statement. For more details about this type of typelibrary construction, consult 'Hardcore Visual Basic' by Bruce McKinney. With his book he also provides a typelibrary which covers most (if not all necessary) Window 32 API functions and constants.

If you wish to use an ActiveX control which incorporate more functionality, such as connection notification, etc… just wait… Mr. Ethan Hunt (of Mission Impossible fame) is working on it…

How Do I Install?

You must register the typelibrary on your machine in order to use it. The use of the typelibrary is only necessary for a developer. The typelibrary does not need to ship with the application after the application is compiled.

For example, to register the RemoteCE.tlb in Visual Basic 5, just go to the Project/References dialog. Select Browse and find the file RemoteCE.tlb. By selecting the file you register it on your system.

How Do I Use?

  1. Unzip the files into a directory
  2. For developers: Register the typelibrary
  3. Review the documentation (what there is) and the sample applications
  4. Create cool Desktop applications

 

Sample Applications

Application Name: RCeCopy.exe

What does it do? Demonstrates how to use the RemoteCE.tlb in a Visual Basic application to copy a file from one location to another location on the WindowsCE device.

 

Application Name: RCeDBList.exe

What does it do? Demonstrates how to use the RemoteCE.tlb in a Visual Basic application to list the Databases on the WindowsCE device.

 

Application Name: RCeDBView.exe

What does it do? Not included in this release

 

Application Name: RCeFileList.exe

What does it do? Demonstrates how to use the RemoteCE.tlb in a Visual Basic application to list the Files on the WindowsCE device.

 

Application Name: RCeGet.exe

What does it do? Demonstrates how to use the RemoteCE.tlb in a Visual Basic application to 'GET' (i.e. copy from) a file on the WindowsCE device

 

Application Name: RCePut.exe

What does it do? Demonstrates how to use the RemoteCE.tlb in a Visual Basic application to 'PUT' (i.e. copy to) a file to the WindowsCE device.

 

Application Name: RCeRegView.exe

What does it do? Demonstrates how to use the RemoteCE.tlb in a Visual Basic application to view the details of the registry. Works like the SDK standard 'Monkey' program.

 

Application Name: RCeSysInfo.exe

What does it do? Demonstrates how to use the RemoteCE.tlb in a Visual Basic application to view the details of the system.

 

Application Group: RceGrabBag

What does it do? Contains samples for various RAPI functions. These samples were used in testing.

RAPI functions:

This documentation helps to describe the RAPI functions as incorporated into the RemoteCE typelibrary. It is based on the original 'C/C++' documentation and therefore may have some glaring inaccuracies. [Editor: It will be continually upgraded, as knew things are added/modified/corrected]

Detailed documentation for all function calls can be found in the Win32 SDK documentation.

See the end of the document for the CONSTANT numbers (i.e. for example ERROR_DISK_FULL = 112)

IMPORTANT NOTE: Strings passed to the typelib are ASCII. String returned from the typelib are Integer arrays (Unicode).

CeCheckPassword

The CeCheckPassword function compares a specified string to the system password. This function is the RAPI version of the CheckPassword function.

Syntax

Function CeCheckPassword(lpszPassword As String) As Long

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Parameters

 

lpszPassword
Pointer to an ASCII character string to compare with the system password.

Return Values

Returns TRUE if lpszPassword matches the system password, else FALSE.

Remarks

Upon a RAPI related failure, the return value is FALSE.

See Also

RCeCheckPassword.frm

CeCloseHandle

The CeCloseHandle function closes an open object handle. This is the RAPI version of the CloseHandle function.

Syntax

Function CeCloseHandle(hObject As Long) As Long

At a Glance

Platforms: H/PC, Palm-size PC

 

See Also

RCeDBlist.vbp 

 

CeCopyFile

The CeCopyFile function copies an existing file to a new file. This is the RAPI version of the CopyFile function.

Syntax

Function CeCopyFile(lpExistingFileName As String, lpNewFileName As String, bFailIfExists As Long) As Long

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Remarks

Strings passed to the typelib are ascii. String returned from the typelib are Integer arrays (Unicode).

See Also

RCeCopyFile.vbp 

CeCreateDatabase

The CeCreateDatabase function creates a new database.

Syntax

Function CeCreateDatabase(lpszName As String, dwDbaseType As Long, wNumSortOrder As Integer, rgSortSpecs As SORTORDERSPEC) As ceOID

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Parameters

 

lpszName
Pointer to a null-terminated string that specifies the name for the new database. The name can have up to 32 characters, including the terminating null character. If the name is too long, it is truncated.
dwDbaseType
Type identifier for the database. This is an application-defined value that can be used for any application-defined purpose. For example, an application can use the type identifier to distinguish address book data from to-do list data or use the identifier during a database enumeration sequence. See CeFindFirstDatabase for details. The type identifier is not meant to be a unique identifier for the database. The system does not use this value.
wNumSortOrder
Number of sort orders active in the database, with four being the maximum number. This parameter can be zero if no sort orders are active.
rgSortSpecs
Pointer to an array of actual sort order descriptions. The size of the array is specified by wNumSortOrder. This parameter can be NULL if wNumSortOrder is zero.

Return Values

If the function succeeds, the return value is the object identifier of the newly created database — not a handle to an open database. If the function fails, the return value is NULL. To get extended error information when within a CE program call GetLastError. If within a RAPI program, call CeGetLastError. GetLastError and CeGetLastError may return one of the following values:

ERROR_DISK_FULL
The object store does not contain enough space to create the new database.
ERROR_INVALID_PARAMETER =
A parameter was invalid.
ERROR_DUP_NAME
A database already exists with the specified name.

Remarks

Because sort orders increase the system resources needed to perform each insert and delete operation, keep the number of sort orders to a minimum. However, try not to specify too few sort orders. If you do, you can use the CeSetDatabaseInfo function to change the sort order later; however, this function is even more expensive in terms of system resources.

See Also

CeDeleteDatabase, CeOidGetInfo, CeOpenDatabase, CeSetDatabaseInfo, SORTORDERSPEC

 

CeCreateDirectory

The CeCreateDirectory function creates a new directory. This is the RAPI version of the CreateDirectory function.

Syntax

Function CeCreateDirectory(lpPathName As String, SetToNull As Any) As Long

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Remarks

See Also

RCeCreateDirectory.frm

CeCreateFile

The CeCreateFile function creates, opens, or truncates a file, pipe, communications resource, disk device, or console. It returns a handle that can be used to access the object. It can also open and return a handle to a directory. This is the RAPI version of the CreateFile function.

The CreateFile function creates or opens the following objects and returns a handle that can be used to access the object:

files
pipes
mailslots
communications resources
consoles
directories (open only)

 

Syntax

Function CeCreateFile(lpFileName As String, dwDesiredAccess As Long, dwShareMode As Long, dwNull As Any, dwCreationDistribution As Long, dwFlagsAndAttributes As Long, hTemplateFile As Long) As Long

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Remarks

See Also

RCePutFile.vbp

 

CeCreateProcess

The CeCreateProcess function is used to run a new program. It creates a new process and its primary thread. The new process executes the specified executable file. This is the remote API version of the CreateProcess function.

Syntax

Function CeCreateProcess(lpApplicationName As String, lpCommandLine As String, dwNull0 As Any, dwNull1 As Any, False As Long, dwCreationFlags As Long, dwNull2 As Any, dwNull4 As Any, dwNull5 As Any, lpProcessInformation As PROCESS_INFORMATION) As Long

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Remarks

The name of the module to execute must be specified by the lpApplicationName parameter. Windows CE does not support passing NULL for lpApplicationName. The execution module cannot be specified in the command line string.

Windows CE searches the directories indicated by the lpApplicationName parameter in the following order:

The root of the PC Card if it exists
The windows (\windows) directory
The root (\ ) directory of the device

The following parameters are not supported and require the following settings:

lpProcessAttributes must be NULL
lpThreadAttributes must be NULL
bInheritHandles must be FALSE
lpEnvironment must be NULL
lpCurrentDirectory must be NULL
lpStartupInfo must be NULL

For Windows CE version 1.0, the dwCreationFlags parameter only supports the following values: CREATE_SUSPENDED and zero.

For Windows CE version 2.0, the dwCreationFlags parameter only supports the following values: CREATE_SUSPENDED, DEBUG_PROCESS, DEBUG_ONLY_THIS_PROCESS and zero.

Priority classes for processes are not supported.

The loader has a limited search path.

 

See Also

RceCreateProcess.frm

 

CeRecordOidGetInfo

The CeRecordOidGetInfo function retrieves information about a RECORD in the object store.

Syntax

Function CeRecordOidGetInfo(oid As ceOID, poidInfo As CERECORDOIDINFO) As Long

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Parameters

 

oid
Identifier of the object for which information is to be retrieved.
poidInfo

 

Pointer to a CERECORDOIDINFO structure that contains information about the object. This structure is a CEOIDINFO structure with the 'Union' value returning CERECORDINFO.

Return Values

If the function succeeds, the return value is TRUE. If the function fails, the return value is FALSE. To get extended error information, call GetLastError. GetLastError may return ERROR_INVALID_HANDLE if the given object identifier is invalid.

Remarks

Use the CeRecordOidGetInfo function to retrieve information about a record in the object store database or file system.

See Also

 

 

CeDirOidGetInfo

The CeDirOidGetInfo function retrieves information about a DIR in the object store.

Syntax

Function CeDirOidGetInfo(oid As ceOID, poidInfo As CEDIROIDINFO) As Long

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Parameters

 

oid
Identifier of the object for which information is to be retrieved.
poidInfo

 

Pointer to a CEDIROIDINFO structure that contains information about the object. This structure is a CEOIDINFO structure with the 'Union' value returning CEDIRINFO.

Return Values

If the function succeeds, the return value is TRUE. If the function fails, the return value is FALSE. To get extended error information, call GetLastError. GetLastError may return ERROR_INVALID_HANDLE if the given object identifier is invalid.

Remarks

Use the CeDirOidGetInfo function to retrieve information about a DIR in the object store database or file system.

See Also

 

CeFileOidGetInfo

The CeFileOidGetInfo function retrieves information about a FILE in the object store.

Syntax

Function CeFileOidGetInfo(oid As ceOID, poidInfo As CEFILEOIDINFO) As Long

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Parameters

 

oid
Identifier of the object for which information is to be retrieved.
poidInfo
Pointer to a CEFILEOIDINFO structure that contains information about the object. This structure is a CEOIDINFO structure with the 'Union' value returning CEFILEINFO.

Return Values

If the function succeeds, the return value is TRUE. If the function fails, the return value is FALSE. To get extended error information, call GetLastError. GetLastError may return ERROR_INVALID_HANDLE if the given object identifier is invalid.

Remarks

Use the CeFileOidGetInfo function to retrieve information about any object in the object store database or file system.

See Also

 

CeDBaseOidGetInfo

The CeDBaseOidGetInfo function retrieves information about a DBASE in the object store.

Syntax

Function CeDBaseOidGetInfo(oid As ceOID, poidInfo As CEDBASEOIDINFO) As Long

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Parameters

 

oid
Identifier of the object for which information is to be retrieved.
poidInfo
Pointer to a CEDBASEOIDINFO structure that contains information about the object. This structure is a CEOIDINFO structure with the 'Union' value returning CEDBASEINFO.

Return Values

If the function succeeds, the return value is TRUE. If the function fails, the return value is FALSE. To get extended error information, call GetLastError. GetLastError may return ERROR_INVALID_HANDLE if the given object identifier is invalid.

Remarks

Use the CeDBaseOidGetInfo function to retrieve information about any object in the object store database or file system.

See Also

RCeDBList.vbp

 

CeDeleteDatabase

The CeDeleteDatabase function removes a database from the object store.

Syntax

Function CeDeleteDatabase(oidDbase As ceOID) As Long

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Parameters

 

oidDbase
Object identifier of the database to be deleted.

Return Values

If the function succeeds, the return value is TRUE. If the function fails, the return value is FALSE. To get extended error information when within a CE program call GetLastError. If within a RAPI program, call CeGetLastError. GetLastError and CeGetLastError may return one of the following values:

ERROR_INVALID_PARAMETER
A parameter was invalid.
ERROR_SHARING_VIOLATION
Another thread has an open handle to the database.

Remarks

The CeDeleteDatabase function deletes a database, including all records in the database.

See Also

CeCreateDatabase

 

CeDeleteFile

The CeDeleteFile function deletes an existing file from the object store. This function is the RAPI version of the DeleteFile function.

Syntax

Function CeDeleteFile(lpFileName As String) As Long

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Remarks

See Also

 RceDeleteFile.frm

CeDeleteRecord

The CeDeleteRecord function deletes a record from a database.

Syntax

Function CeDeleteRecord(hDatabase As Long, oidRecord As ceOID) As Long

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Parameters

 

hDatabase
Handle to the database from which the record is to be deleted. The database must be open. Open a database by calling the CeOpenDatabase function.
oidRecord
Object identifier of the record to be deleted; this is obtained from CeOpenDatabase.

Return Values

If the function succeeds, the return value is TRUE. If the function fails, the return value is FALSE. To get extended error information when within a CE program call GetLastError. If within a RAPI program, call CeGetLastError. GetLastError and CeGetLastError may return ERROR_INVALID_PARAMETER if the handle or object identifier is invalid.

Remarks

If the CEDB_AUTOINCREMENT flag was not specified when the database was opened, and the record being deleted is the current record, the next read operation that uses the database handle will fail. If the CEDB_AUTOINCREMENT flag was specified, the system automatically moves the current seek pointer forward by one.

See Also

CeOpenDatabase

 

CeFindAllDatabases

Not available in the RemoteCE.tlb. Use CeFindFirstDatabase and CeFindNextDatabase.

 See Also

RceDblist.vbp

CeFindAllFiles

Not available in the RemoteCE.tlb. Use CeFindFirstFile and CeFindNextFile

 See Also

RCeFilelist.vbp

CeFindClose

The CeFindClose function closes the specified search handle. This is the RAPI version of the FindClose function.

Syntax

Function CeFindClose(hFindFile As Long) As Long

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Remarks

See Also

 

CeFindFirstDatabase

The CeFindFirstDatabase function opens an enumeration context for all databases in the system. A RAPI version of this function exists and is also called CeFindFirstDatabase.

Syntax

Function CeFindFirstDatabase(dwDbaseType As Long) As Long

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Parameters

 

dwDbaseType
Type identifier of the databases to enumerate. If this parameter is zero, all databases are enumerated.

Return Values

If the function succeeds, the return value is a handle to an enumeration context. To find the next database of the given type, specify the handle in a call to the CeFindNextDatabase function. If the function fails, the return value is INVALID_HANDLE_VALUE. To get extended error information when within a CE program call GetLastError. If within a RAPI program, call CeGetLastError. GetLastError and CeGetLastError may return ERROR_OUTOFMEMORY if no memory is available to allocate a database handle.

Remarks

Use the CeCloseHandle function to close the handle returned by the CeFindFirstDatabase function.

See Also

RceDblist.vbp 

CeFindFirstFile

The CeFindFirstFile function searches a directory for a file whose name matches the specified filename. CeFindFirstFile examines subdirectory names as well as filenames. This is the RAPI version of the FindFirstFile function.

Syntax

Function CeFindFirstFile(lpFileName As String, lpFindFileData As CE_FIND_DATA) As Long

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Remarks

See Also

RceFilelist.vbp 

CeFindNextDatabase

The CeFindNextDatabase function retrieves the next database in an enumeration context. A RAPI version of this function exists and is also called CeFindNextDatabase.

Syntax

Function CeFindNextDatabase(hEnum As Long) As ceOID

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Parameters

 

hEnum
Handle to an enumeration context; this handle is returned from CeFindFirstDatabase.

Return Values

If the function succeeds, the return value is the object identifier of the next database to be enumerated. If no more databases are left to enumerate, or if an error occurs, the return value is zero. To get extended error information, when within a CE program call GetLastError. If within a RAPI program call CeGetLastError. GetLastError and CeGetLastError may return one of the following values:

ERROR_NO_MORE_ITEMS
The object store contains no more databases to enumerate.
ERROR_INVALID_PARAMETER
The hEnum parameter specified an invalid handle.

Remarks

See Also

RCeDBList.vbp 

CeFindNextFile

The CeFindNextFile function continues a file search from a previous call to the CeFindFirstFile function. This is the RAPI version of the FindNextFile function.

Syntax

Function CeFindNextFile(hFindFile As Long, lpFindFileData As CE_FIND_DATA) As Long

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Remarks

See Also

RceFileList.vbp 

CeGetClassName

The CeGetClassName function retrieves the name of the class to which the specified window belongs. This is the RAPI version of the GetClassName function.

Syntax

Function CeGetClassName(hWnd As Long, lpString As String, nMaxCount As Long) As Long

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Remarks

Returned ClassName is Unicode.

See Also

 

CeGetDesktopDeviceCaps

The CeGetDesktopDeviceCaps function retrieves device-specific information about a specified device. This is the RAPI version of the GetDeviceCaps function.

Syntax

Function CeGetDesktopDeviceCaps(nIndex As Long) As Long

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Remarks

See Also

RceSysInfo.vbp

CeGetFileAttributes

The CeGetFileAttributes function returns attributes for a specified file or directory. This is the RAPI version of the GetFileAttributes function.

Syntax

Function CeGetFileAttributes(lpFileName As String) As Long

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Remarks

See Also

 RceGetFileAttributes.frm

CeGetFileSize

The CeGetFileSize function retrieves the size, in bytes, of the specified file. This is the RAPI version of the GetFileSize function.

Syntax

Function CeGetFileSize(hFile As Long, lpFileSizeHigh As Long) As Long

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Remarks

See Also

 RceGetFileSize.frm

CeGetFileTime

The CeGetFileTime function retrieves the date and time that a file was created, last accessed, and last modified. This is the RAPI version of the GetFileTime function.

Syntax

Function CeGetFileTime(hFile As Long, lpCreationTime As FILETIME, lpLastAccessTime As FILETIME, lpLastWriteTime As FILETIME) As Long

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Remarks

See Also

 RceGetFileTime.frm

CeGetLastError

The CeGetLastError function returns the calling thread’s last error code. This is the RAPI version of the GetLastError function.

Syntax

Function CeGetLastError() As Long

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Remarks

See Also

 

CeGetSpecialFolderPath

The CeGetSpecialFolderPath function gets the path to a special shell folder.

Syntax

Function CeGetSpecialFolderPath(nFolder As Long, nBufferLength As Long, lpBuffer As String) As Long

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Parameters

 

nFolder
Value specifying the folder for which to retrieve the location. This parameter can be one of the following values:
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.
CSIDL_COMMON_DESKTOP
File system directory that contains files and folders that appear on the desktop for all users.
CSIDL_COMMON_PROGRAMS
File system directory that contains the directories for the common program groups that appear on the Start menu for all users.
CSIDL_COMMON_STARTMENU
File system directory that contains the programs and folders that appear on the Start menu for all users.
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.
CSIDL_CONTROLS
Control Panel—virtual folder containing icons for the control panel applications.
CSIDL_DESKTOP
Windows desktop—virtual folder at the root of the name space.
CSIDL_DESKTOPDIRECTORY
File system directory used to physically store file objects on the desktop — not to be confused with the desktop folder itself.
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.
CSIDL_FONTS
Virtual folder containing fonts.
CSIDL_NETHOOD
File system directory containing objects that appear in the network neighborhood.
CSIDL_NETWORK
Network Neighborhood—virtual folder representing the top level of the network hierarchy.
CSIDL_PERSONAL
File system directory that serves as a common repository for documents.
CSIDL_PRINTERS
Printers folder—virtual folder containing installed printers.
CSIDL_PROGRAMS
File system directory that contains the user’s program groups which are also file system directories.
CSIDL_RECENT
File system directory containing the user’s most recently used documents.
CSIDL_SENDTO
File system directory containing Send To menu items.
CSIDL_STARTMENU
File system directory containing Start menu items.
CSIDL_STARTUP
File system directory that corresponds to the user’s Startup program group.
CSIDL_TEMPLATES
File system directory that serves as a common repository for document templates.
nBufferLength
Size of lpBuffer in characters.
lpBuffer
Unicode string.

Return Values

The return value is the length of the returned string; if a RAPI related failure, return value is FALSE.

 

CeGetStoreInformation

The CeGetStoreInformation function fills in a STORE_INFORMATION structure with the size of the object store and the amount of free space currently in the object store. This is the RAPI version of GetStoreInformation.

Syntax

Function CeGetStoreInformation(lpsi As STORE_INFORMATION) As Long

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Remarks

Upon a RAPI-related failure, the return value is FALSE.

See Also

 RceGetStoreInformation.frm

 

CeGetSystemInfo

The CeGetSystemInfo function returns information about the current system. This is the RAPI version of the GetSystemInfo function.

Syntax

Sub CeGetSystemInfo(lpSystemInfo As SYSTEM_INFO)

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Remarks

See Also

RceSysInfo.vbp

CeGetSystemMetrics

The CeGetSystemMetrics function retrieves the dimensions (widths and heights) of Windows display elements and system configuration settings. All dimensions retrieved by CeGetSystemMetrics are in pixels. This is the RAPI version of the GetSystemMetrics function.

Syntax

Function CeGetSystemMetrics(nIndex As Long) As Long

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Remarks

See Also

RceSysInfo.vbp

CeGetSystemPowerStatusEx

The CeGetSystemPowerStatusEx function retrieves the power status of the system. The status indicates whether the system is running on AC or DC power, whether or not the batteries are currently charging, and the remaining life of main and backup batteries. This is the RAPI version of the GetSystemPowerStatusEx function.

Syntax

Function CeGetSystemPowerStatusEx(pstatus As SYSTEM_POWER_STATUS_EX, fUpdate As Long) As Long

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Parameters

 

pstatus
Pointer to the SYSTEM_POWER_STATUS_EX structure receiving the power status information.
fUpdate
If this parameter is set to TRUE, CeGetSystemPowerStatusEx gets the latest information from the device driver, otherwise it retrieves cached information that may be out-of-date by several seconds.

Return Values

This function returns TRUE if successful, otherwise FALSE.

Remarks

See Also

RceSysInfo.vbp

CeGetTempPath

This function does not work correctly.

The CeGetTempPath function gets the path to the directory designated for temporary files.

Syntax

Function CeGetTempPath(nBufferLength As Long, lpBuffer As String) As Long

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Parameters

 

nBufferLength
Size of lpBuffer in characters.
lpBuffer
Address of the buffer for the folder path.

Return Values

The return value is the length, in characters, of the string copied to lpBuffer, not including the terminating null character. If the return value is greater than nBufferLength, the return value is the size of the buffer required to hold the path.

The returned value is a Unicode string. Use an integer array to retrieve the string.

If CeGetTempPath fails, the return value is 0. To get extended error information, call CeGetLastError.

Remarks

The CeGetTempPath function gets the temporary file path as follows:

1. The path specified by the TMP environment variable.

2. The path specified by the TEMP environment variable, if TMP is not defined.

3. The current directory, if both TMP and TEMP are not defined.

 

CeGetVersionEx

The CeGetVersionEx function obtains extended information about the version of the operating system that is currently running. This is the RAPI version of the GetVersionEx function.

Syntax

Function CeGetVersionEx(lpVersionInformation As CEOSVERSIONINFO) As Long

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Remarks

When writing applications for Windows CE Japanese 2.01 be aware that the Tool Bar will indicate that the version is 2.0.

See Also

 RceSysInfo.vbp

CeGetWindow

The CeGetWindow function retrieves the handle to a window that has the specified relationship to the specified window. This is the RAPI version of the GetWindow function.

Syntax

Function CeGetWindow(hWnd As Long, uCmd As Long) As Long

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Remarks

See Also

 

CeGetWindowLong

The CeGetWindowLong function retrieves information about the specified window. CeGetWindowLong also retrieves the 32-bit (long) value at the specified offset into the extra window memory of a window. This is the RAPI version of the GetWindowLong function.

Syntax

Function CeGetWindowLong(hWnd As Long, nIndex As Long) As Long

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Remarks

See Also

 

CeGetWindowText

The CeGetWindowText function copies the text of the specified window’s title bar (if it has one) into a buffer. If the specified window is a control, the text of the control is copied. This is the RAPI version of the GetWindowText function.

Syntax

Function CeGetWindowText(hWnd As Long, lpString As String, nMaxCount As Long) As Long

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Remarks

See Also

 

CeGlobalMemoryStatus

The CeGlobalMemoryStatus function gets information on the physical and virtual memory of the system. This is the RAPI version of the GlobalMemoryStatus function.

Syntax

Sub CeGlobalMemoryStatus(lpmst As MEMORYSTATUS)

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Remarks

See Also

 RceSysInfo.vbp

CeMoveFile

The CeMoveFile function renames an existing file or a directory — including all its children. This is the RAPI version of the MoveFile function.

Syntax

Function CeMoveFile(lpExistingFileName As String, lpNewFileName As String) As Long

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Remarks

See Also

 

CeOidGetInfo

Use the CeDBaseOidGetInfo, CeDirOidGetInfo, CeFileOidGetInfo, amd CeRecordOidGetInfo to retrieve information from the respective Object Store Items.

CeOpenDatabase

The CeOpenDatabase function opens an existing database.

Syntax

Function CeOpenDatabase(poid As ceOID, lpszName As String, propid As cePROPID, dwFlags As Long, hwndNotify As Long) As Long

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Parameters

 

poid
Pointer to the object identifier of the database to be opened. To open a database by name, set the value pointed to by poid to zero to receive the object identifer of the newly opened database when a database name is specified for lpszName.
lpszName
Pointer to the name of the database to be opened. This parameter is ignored if the value pointed to by poid is non-zero.
propid
Property identifier of the primary key for the sort order in which the database is to be traversed. All subsequent calls to CeSeekDatabase assume this sort order. This parameter can be zero if the sort order is not important.
dwFlags
Action flag. The following values are supported:
CEDB_AUTOINCREMENT
Causes the current seek position to be automatically incremented with each call to the CeReadRecordProps function.
0 (ZERO)
Current seek position is not incremented with each call to CeReadRecordProps.
hwndNotify
Handle to the window to which notification messages (DB_CEOID_*) will be posted if another thread modifies the given database while you have it open. This parameter can be NULL if you do not need to receive notifications.

Return Values

If the function succeeds, the return value is a handle to the open database. If the function fails, the return value is INVALID_HANDLE_VALUE. To get extended error information when within a CE program call GetLastError. If within a RAPI program, call CeGetLastError. GetLastError and CeGetLastError may return one of the following values:

ERROR_INVALID_PARAMETER
A parameter was invalid.
ERROR_FILE_NOT_FOUND
No database exists with the specified name. This value applies only if the value pointed to by poid was set to NULLwhen the function was called.
ERROR_NOT_ENOUGH_MEMORY
No memory was available to allocate a database handle.

Remarks

Use the CeCloseHandle function to close the handle returned by the CeOpenDatabase function.

Unlike many other traditional databases, opening and closing a database does not imply any transactioning. In other words, the database is not committed at the closing—it is committed after each individual call.

See Also

 

CeRapiFreeBuffer

The CeRapiFreeBuffer function frees the memory on the desktop PC allocated by a call to CeReadRecordProps.

Syntax

HRESULT CeRapiFreeBuffer(LPVOID Buffer);

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Parameters

 

Buffer
Pointer to the buffer to be freed.

Return Values

If the function completes successfully it returns the value SOK, otherwise it returns E_FAIL.

Remarks

Any RAPI function that allocates memory on the desktop PC on the users behalf must be freed by calling the CeRapiFreeBuffer function.

See Also

CeReadRecordProps

 

CeRapiGetError

The CeRapiGetError function reports remote API related failures. CeRapiGetError can be used to determine if a call failed due to a failure in the remote API.

Syntax

Function CeRapiGetError() As Long

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Parameters

None.

Return Values

This function returns standard Win32 error values.

Remarks

 

CeRapiInit

The CeRapiInit function attempts to initialize the Windows CE Remote API.

Syntax

Function CeRapiInit() As Long

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Parameters

None.

Return Values

If this function succeeds, the return value is E_SUCCESS. If this function is called when already initialized, it returns E_FAIL.

Remarks

The functions CeRapiInit or CeRapiInitEx must be called before any remote API calls can be performed. They initialize the underlying communications layers between the desktop PC and the target platform device.

A call to CeRapiInit does not return until the connection is made, an error occurs, or another thread calls CeRapiUninit. The CeRapiInitEx function does not block the calling thread. Instead, it uses an event to signal when initialization is complete.

See Also

All sample applications

 

CeRapiInitEx

The CeRapiInitEx function attempts to initialize the Windows CE Remote API and initially returns an event handle.

Avoid this function.

Syntax

Function CeRapiInitEx(pRapiInit As RAPIINIT) As Long

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Parameters

 

pRapiInit
Pointer to a RAPIINIT structure. The cbSize member of this structure contains the size of the structure being passed in. Initially, a handle to an event is passed back in the heRapiInit member of this structure. When the connection is made or an error occurs the event is set. The hrRapiInit member of this structure contains the value E_SUCCESS if the connection is successful or E_FAIL if an error occurred.

Return Values

If this function initially succeeds, it returns E_SUCCESS. If this function is called when RAPI is already initialized, it returns E_FAIL.

Remarks

The CeRapiInitEx or CeRapiInit functions must be called before any remote API calls can be performed. They initialize the underlying communications layers between the desktop PC and the target platform device.

Call CeRapiInitEx to avoid blocking a thread inside of a call to CeRapiInit. CeRapiInitEx returns immediately and continues initialization until the connection is made, until an error occurs, or until there is a call to CeRapiUninit. When CeRapiInitEx is complete it then sets the event specified in the heRapiInit member of the RAPIINIT structure.

After calling CeRapiInitEx, check the return value to see if an error occurred. If the call was initially successful, call the MsgWaitForMultipleObjects function to wait on the event handle passed back in the heRapiInit member of the RAPIINIT structure. When the event is set, check the hrRapiInit member of the structure to determine if the connection was successful.

To shut down or to abort the connection process, call the CeRapiUnInit function.

See Also

 

CeRapiUninit

The CeRapiUnInit function uninitializes the Windows CE Remote API. Use CeRapiInit and CeRapiUninit to open and close sessions with the Windows CE devices.

Syntax

Function CeRapiUninit() As Long

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Parameters

None.

Return Values

If this function is called when not initialized, it will return E_FAIL.

Remarks

The CeRapiUnInit function should be called when the application has completed its use of the remote API services. It gracefully closes down the connection to the Windows CE device. If called when not in an initialized state, it will return E_FAIL.

 

CeReadFile

The CeReadFile function reads data from a file, starting at the position indicated by the file pointer. After the read operation has been completed, the file pointer is adjusted by the number of bytes actually read. This is the RAPI version of the ReadFile function.

Using this version of CeReadFile will return a byte array. Review the sample file (RceGetFile.vbp) to see how the lpBuffer should be initialized and used in Visual Basic.

Syntax

Function CeReadFile(hFile As Long, lpBuffer As Any, nNumberOfBytesToRead As Long, lpNumberOfBytesRead As Long, CeReadFileNull As Long) As Long

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Remarks

See Also

ReadFile

 

CeReadFileStr

The CeReadFileStr function reads data from a file, starting at the position indicated by the file pointer. After the read operation has been completed, the file pointer is adjusted by the number of bytes actually read. This is the RAPI version of the ReadFile function.

Using this version of CeReadFileStr will return a string. Review the sample file (RceGetFile.vbp) to see how the lpBuffer should be initialized and used in Visual Basic.

Syntax

 Function CeReadFileStr(hFile As Long, lpBuffer As String, nNumberOfBytesToRead As Long, lpNumberOfBytesRead As Long, CeReadFileNull As Long) As Long

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Remarks

See Also

ReadFile

 

CeReadRecordProps

The CeReadRecordProps function reads properties from the current record. This function is untested.

Syntax

Function CeReadRecordProps(hDbase As Long, dwFlags As Long, lpcPropID As <Unsupported variant type>, rgPropID As cePROPID, lplpBuffer As Byte, lpcbBuffer As Long) As ceOID

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Parameters

 

hDbase
Handle to an open database. The database must have been opened by a previous call to the CeOpenDatabase function.
dwFlags
Read flags. The following value is supported:
CEDB_ALLOWREALLOC
The LocalAlloc function was used to allocate the buffer specified by the lplpBuffer parameter, and the server can reallocate the buffer if it is not large enough to hold the requested properties.
lpcPropID
Number of property identifiers in the array specified by the rgPropID parameter. If rgPropID is NULL, this parameter receives the number of properties retrieved.
rgPropID
Pointer to an array of property identifiers for the properties to be retrieved. If this parameter is NULL, CeReadRecordProps retrieves all properties in the record.
lplpBuffer
Address of a pointer to a buffer that receives the requested properties. If the dwFlags parameter includes the CEDB_ALLOWREALLOC flag, the buffer may be reallocated if necessary. If the CEDB_ALLOWREALLOC flag is specified and this parameter is NULL, the server uses the LocalAlloc function to allocate a buffer of the appropriate size in the caller’s address space and returns a pointer to the buffer. Note that if the CEDB_ALLOWREALLOC flag is specified, it is possible for the value of this pointer to change even on failure. For example, the old memory might be freed and the allocation might then fail, leaving the pointer set to NULL.
lpcbBuffer
Pointer to a variable that contains the size, in bytes, of the buffer specified by the lplpBuffer parameter. When CeReadRecordProps returns, lpcbBuffer receives a value that indicates the actual size of the data copied to the buffer. If the buffer was too small to contain the data, this parameter can be used to calculate the amount of memory to allocate for the buffer if CEDB_ALLOWREALLOC was not specified.

Return Values

If the function succeeds, the return value is the object identifier of the record from which the function read. If the function fails, the return value is zero. To get extended error information when within a CE program call GetLastError. If within a RAPI program, call CeGetLastError. GetLastError and CeGetLastError may return one of the following values:

ERROR_INVALID_PARAMETER
A parameter was invalid.
ERROR_NO_DATA
None of the requested properties was found. The output buffer and the size are valid.
ERROR_INSUFFICIENT_BUFFER
The given buffer was not large enough, and the reallocation failed — if the CEDB_ALLOWREALLOC flag was specified. The lpcbBuffer parameter contains the required buffer size.
ERROR_KEY_DELETED
The record that was about to be read was deleted by another thread. If the current record was reached as a result of an autoseek, this error is not returned, and the next record is returned.
ERROR_NO_MORE_ITEMS
The current seek pointer is at the end of the database.

Remarks

The CeReadRecordProps function reads the specified set of properties from the current record. If the database was opened with the autoseek flag — that is, if the dwFlags parameter of CeOpenDatabase was set to CEDB_AUTOINCREMENT — CeReadRecordProps increments the seek pointer by one so that the next call reads the next record in the current sort order. That is, if the database was opened with a sort order active, then CeReadRecordProps will return the records in sorted order. If the database was not opened with a sort order active, then the order in which records are returned is not predictable.

Read all needed properties from the record in a single call. The entire record is stored in a compressed format, and each time a property is read it must be decompressed. All the properties are returned in a single marshalled structure, which consists of an array of CEPROPVAL structures, one for each property requested — or one for each property found if the application set the rgPropID parameter to NULL when calling the function.

If a property was requested, such as strings or blobs that are packed in at the end of the array, the pointers in the CEPROPVAL structures point into this marshalled structure. This means that the only memory that must be freed is the original pointer to the buffer passed in to the call. Even if the function fails, it may have allocated memory on the caller’s behalf. Free the pointer returned by this function if the pointer is not NULL.

See Also

 

CeRegCloseKey

The CeRegCloseKey function releases the handle to the specified key. This is the RAPI version of the RegCloseKey function.

Syntax

Function CeRegCloseKey(hKey As Long) As Long

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Remarks

See Also

RceRegView.vbp 

CeRegCreateKeyEx

The CeRegCreateKeyEx function creates the specified key. If the key already exists in the registry, CeRegCreateKeyEx opens it. This is the RAPI version of the RegCreateKeyEx function.

Syntax

Function CeRegCreateKeyEx(hKey As Long, lpszSubKey As String, dwReserved As Long, lpszClass As String, dwOptions As Long, samDesired As Long, lpSecurityAttributes As _SECURITY_ATTRIBUTES, phkResult As Long, lpdwDisposition As Long) As Long

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Remarks

See Also

 

CeRegDeleteKey

The CeRegDeleteKey function deletes a key and all its descendants. This is the RAPI version of the RegDeleteKey function.

Syntax

Function CeRegDeleteKey(hKey As Long, lpszSubKey As String) As Long

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Remarks

See Also

 

CeRegDeleteValue

The CeRegDeleteValue function removes a named value from the specified registry key. This is the RAPI version of the RegDeleteValue function.

Syntax

Function CeRegDeleteValue(hKey As Long, lpszValueName As String) As Long

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Remarks

See Also

 

CeRegEnumKeyEx

The CeRegEnumKeyEx function enumerates subkeys of the specified open registry key. CeRegEnumKeyEx retrieves information about one subkey each time it is called; it retrieves the class name of the subkey and the time it was last modified. This is the RAPI version of the RegEnumKeyEx function.

Syntax

Function CeRegEnumKeyEx(hKey As Long, dwIndex As Long, lpszName As Any, lpcchName As Long, lpReserved As Long, lpszClass As String, lpcchClass As Long, lpftLastWrite As FILETIME) As Long

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Remarks

 

CeRegEnumValue

The CeRegEnumValue function enumerates the values for the specified open registry key. CeRegEnumValue copies one indexed value name and data block for the key each time it is called. This is the RAPI version of the RegEnumValue function.

Syntax

Function CeRegEnumValue(hKey As Long, dwIndex As Long, lpszName As Any, lpcchName As Long, lpReserved As Long, lpType As Long, lpData As Any, lpcbData As Long) As Long

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Remarks

See Also

RceRegView.vbp 

CeRegOpenKeyEx

The CeRegOpenKeyEx function opens the specified key. This is the RAPI version of the RegOpenKeyEx function.

Syntax

Function CeRegOpenKeyEx(hKey As Long, lpszSubKey As String, dwReserved As Long, samDesired As Long, phkResult As Long) As Long

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Remarks

See Also

 

CeRegQueryInfoKey

The CeRegQueryInfoKey function retrieves information about a specified registry key. This is the RAPI version of the RegQueryInfoKey function.

Syntax

Function CeRegQueryInfoKey(hKey As Long, lpszClass As Any, lpcchClass As Long, lpReserved As Long, lpcSubKeys As Long, lpcchMaxSubKeyLen As Long, lpcchMaxClassLen As Long, lpcValues As Long, lpcchMaxValueNameLen As Long, lpcbMaxValueData As Long, lpcbSecurityDescriptor As Long, lpftLastWriteTime As Any) As Long

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Remarks

See Also

 

CeRegQueryValueEx

The CeRegQueryValueEx function retrieves the type and data for a specified value name associated with an open registry key. This is the RAPI version of the RegQueryValueEx function.

Syntax

Function CeRegQueryValueEx(hKey As Long, lpszValueName As Any, lpReserved As Long, lpType As Long, lpData As Byte, lpcbData As Long) As Long

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Remarks

See Also

 

CeRegSetValueEx

The CeRegSetValueEx function stores data in the value field of an open registry key. It can also set additional value and type information for the specified key. This is the RAPI version of the RegSetValueEx function.

Syntax

Function CeRegSetValueEx(hKey As Long, lpValueName As String, Reserved As Long, dwType As Long, lpData As Byte, cbData As Long) As Long

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Remarks

See Also

 

CeRemoveDirectory

The CeRemoveDirectory function deletes an existing empty directory. This is the RAPI version of the RemoveDirectory function.

Syntax

Function CeRemoveDirectory(lpPathName As String) As Long

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions: 2.0 and later

 

Remarks

See Also

  

CeSeekDatabase

The CeSeekDatabase function seeks the specified record in an open database.

Syntax

Function CeSeekDatabase(hDatabase As Long, dwSeekType As Long, dwValue As Long, lpdwIndex As Long) As ceOID

At a Glance

Platforms: H/PC, Palm-size PC
Windows CE versions:<