Solved

Need to programmatically get the name of my Windows CE device

Posted on 2007-11-27
4
1,039 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to stop auto installation of  various app in Micromax A310 4 413
Snap chat on Android 8 57
Droid 4 15 105
moto 4g plus phone applications 2 24
When I was a beginner in Windows Mobile programming, even for small test I used to create a single MFC dialog-based application with one button, and put my test code in the OnLButtonDown method. For Pocket PC it worked fine, on some Windows CE d…
Once again I push the limits of my phone.  An introduction to the Android Google Now Launcher.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

896 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now