Solved

Need to programmatically get the name of my Windows CE device

Posted on 2007-11-27
4
1,044 Views
Last Modified: 2013-12-21
I have a windows CE 5.0 device ( a Psion teklogix 7535 G2 handheld, specifically ), and I am trying to programmatically get the name of my device ( NOT the adapters, but the actual handheld's name).   I am using EVC ( Embedded Visual C++) to code.  You can manually see the device name that I am referring to if you go under System properties and then the device name tab.   I am at a complete loss as to how to do this.  Any help would be greatly appreciated.  Thanks!
0
Comment
Question by:meldsa
  • 2
  • 2
4 Comments
 
LVL 48

Accepted Solution

by:
Mikal613 earned 250 total points
ID: 20358374
Its in the registry

HKEY_LOCAL_MACHINE\Ident]
   "OrigName"="WinCE"
   "Name"="DEviceNAme"
0
 

Author Comment

by:meldsa
ID: 20358387
How do I programmatically access the registry?
0
 
LVL 48

Expert Comment

by:Mikal613
ID: 20358449
0
 

Author Comment

by:meldsa
ID: 20359246
The code that worked for me as per Mikal63's helpful suggestions is

if (RegOpenKeyEx( HKEY_LOCAL_MACHINE, _T("Ident"), 	                                    
                                0, KEY_READ, &hKey ) == ERROR_SUCCESS) 
{ 
     DWORD dwType = REG_SZ; 
     DWORD dwDataSize = 0; 
     CString deviceName; 
     if ( RegQueryValueEx( hKey, _T("name"), 0, &dwType, (PBYTE)NULL,   
               &dwDataSize ) == ERROR_SUCCESS) 
     { 
          RegQueryValueEx( hKey, _T("name"), 0, &dwType,
                  (PBYTE)(LPTSTR)deviceName.GetBuffer(dwDataSize + 1), 
                   &dwDataSize ); 
	  deviceName.ReleaseBuffer(); 
     }
 
     RegCloseKey(hKey); 
}

Open in new window

0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you are anything like me, you install many apps on your phone and have your life on it, sometimes literally.  When I bought my current phone, a Samsung Galaxy S5 from Verizon, they were only selling the versions with 16 GB internal.  I didn't rea…
I recently asked a question (http://www.experts-exchange.com/Programming/Smartphones/Android/Q_28684946.html) about Computer Inventory applications for Mobile Devices.  I was specifically interested in an app I could use on my android phone.  The be…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question