Skip to main content

Past Blast

Featured Products

Windows Mobile Developer Controls
Windows Mobile Developer Controls
Stay in touch using the DEVBUSS RSS feeds.
 

News

Windows Mobile Developer Controls
Sapphire Soltuions

Access the Pocket PC Owner Information using eVB

Written by Derek Mitchell  [author's bio]  [read 35404 times]
Edited by Derek

Download the code

Page 1 

This is a follow up to the deVBuzz tip in the Microsoft Mobile Device Newsletter of March 28th. That tip, which you can read here; explained how to retrieve the Pocket PC Owner Information Using eVB. Since then I have had several several requests asking how eVB can retrieve the other information contained in this key. Luckily Christian Forsberg has come to the rescue with the following bit of code. In addition he introduced me to some neat free resources from Odyssey Software. The following code uses the free OSIUtil component from Odyssey Software.

Using the OSIUtil component the code is very straight forward:

Dim lreg As OSIUTIL.Registry
Dim ls As String
'Get Owner Information
Set lreg = CreateObject("OSIUtil.Registry")
lreg.OpenKey hKeyCurrentUser, "ControlPanel\Owner", False
ls = lreg.GetValue("Owner")
txtName.Text = ls
txtCompany.Text = Mid(ls, 37)
txtAddress.Text = Mid(ls, 73)
txtTelephone.Text = Mid(ls, 259)
txtEmail.Text = Mid(ls, 284)
lreg.CloseKey
Set lreg = Nothing

eVB code courtesy of Christian Forsberg

And here are the results:

Remember if you don't use this eVB code sample then you need to add the Odyssey SW library to the Project References once you have installed the OSIUtil100 executable.

A little more on the OSI Utility Library

The following paragraph is taken from their help file:

The OSI Utility Library is a set of objects that can be used in both Win32 or WinCE (unless otherwise specified). They are provided as a tool to aid in development. Please refer to the Example folder for a demonstration of how these objects are used. This documentation is found in the Examples folder of your installation.

  • OSIUtil.Collection - Collection object - an ordered set of items that can be referred to as a unit. Modeled after VB's Collection Object.
  • OSIUtil.File - File object - functions that can be useful for writing to or reading from binary files.
  • OSIUtil.Registry - Registry object - functions that can be useful for writing to or reading from the Windows Registry.
  • OSIUtil.Win32 - Win32 object - provides a memory leak free fix to the eMbedded VB CreateObject (WinCE only), and a Win32 function GetGuidString (Win32 only).