Getting Windows Mobile Device ID

by Ken Tucker 26. March 2009 21:10

I got email today asking me how to get the device ID from a pocket pc with vb

 

Imports System.Text

Public Class Form1

    <System.Runtime.InteropServices.DllImport("coredll.dll")> _
Private Shared Function GetDeviceUniqueID(ByVal appdata As Byte(), ByVal cbApplictionData As Integer, ByVal dwDeviceIDVersion As Integer, ByVal deviceIDOuput As Byte(), ByRef pcbDeviceIDOutput As Integer) As Integer
    End Function

    Private Function GetDeviceId(ByVal appData As String) As Byte()

        Dim appDataBytes As Byte() = System.Text.Encoding.ASCII.GetBytes(appData)
        Dim outputSize As Integer = 20
        Dim output(19) As Byte

        Dim result As Integer = GetDeviceUniqueID(appDataBytes, appDataBytes.Length, 1, output, outputSize)

        Return output

    End Function

    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim sbId As New StringBuilder

        Dim bID() As Byte = GetDeviceId("MyAppName")

        For Each b In bID
            sbId.Append(String.Format("{0:x2}", b))
        Next

        Debug.WriteLine(sbId.ToString)
    End Sub
End Class

 

References

 

http://www.peterfoot.net/GetDeviceUniqueIDForVB.aspx

http://msdn.microsoft.com/en-us/library/ms893522.aspx

Comments

3/29/2009 1:44:58 PM #

Hm... I've missed something and don't know that dwDeviceIDVersion (Integer) working in it. THKS!

kamagra

4/1/2009 10:24:19 PM #

thanks for the information. its very useful.

Tubagus Rusmawan

4/4/2009 2:47:46 AM #

I am sure, this will be very useful...

tech gadgets

4/8/2009 1:09:51 AM #

thanks for info

tukang nggame

4/10/2009 2:20:13 PM #

great post
thank u my friend

jammer

4/10/2009 2:20:38 PM #

thank u
nice

movers

4/10/2009 2:20:53 PM #

love u all

jammer

4/17/2009 5:21:15 AM #

im not really understand the code, but thanks for sharing.

comforter down

4/17/2009 6:20:54 PM #

Thanks for the screenshot, and the references were a nice touch too. Thankyou.

Group Leadership

4/22/2009 8:09:10 AM #

nice screen shot. Well described and thanks for sharing!

pregnant woman

4/26/2009 12:05:31 AM #

nice post for this blog

tukang nggame

4/26/2009 7:56:13 PM #

Hell yeah! This thought leadership from you was quite refreshing, I have to say. Keep it up.

Leadership

4/27/2009 7:42:31 PM #

thanks good article

Melayu Boleh

4/28/2009 11:56:21 PM #

Very informative article..
thanks for this great informations, now i find what i want to know..
thanks..

Kampanye Damai Pemilu Indonesia 2009

5/3/2009 4:11:57 AM #

very Nice info

tukang nggame

5/7/2009 9:29:33 AM #

i didn't know we can do like that. i will test your code now.

anak Melayu Boleh

5/8/2009 4:13:05 AM #

yes do it now

MelayuBoleh

5/23/2009 3:24:06 AM #

I am sure, this will be very useful...

cell phone news

5/23/2009 3:25:27 AM #

thanks for the information. its very useful.

techcaoz

5/23/2009 3:26:19 AM #

really enjoy your post, thanks

gadget reviews

5/23/2009 4:33:37 PM #

great post

Melayu Boleh

5/25/2009 12:31:52 PM #

great post
I like it sir
made my day

Dallas Movers

5/25/2009 12:32:37 PM #

I realy like it sir
it makes me love u even more

israel elections

5/25/2009 12:33:34 PM #

such a lovely thing to do
great thinking
made me love u even more

Cleveland Movers

1/20/2010 9:02:56 AM #

Web Site Development

Hi webmaster, commenters and everybody else !!! The blog was absolutely fantastic! Lots of great information and inspiration, both of which we all need!b Keep 'em coming... you all do such a great job at such Concepts... can't tell you how much I, for one appreciate all you do!

Web Site Development

2/18/2010 9:16:26 AM #

Designer Cookware from Pasta Dad

PastaDaddy.com is a UK designer cookware online shop bringing you the latest in kitchen gadgets and designer kitchenware.

Designer Cookware from Pasta Dad

2/18/2010 11:10:43 AM #

Electronics

I cannot find the settings for changing the device ID in Windows Mobile 6.  It "used" to be in "systems ... settings ... device ID" but there are no such choices in Mobile 6.  Please help!  Thanks.

Electronics

2/18/2010 11:13:16 AM #

Mobile Phones

I saw this tip on changing the device Name on Windows Mobile 6 device over at Jason Langridge’ web site and I thought I’d pass it along as an FYI.  He had a customer ask how they could change the device names of Windows Mobile 6 devices to align with their PC/Laptop naming conventions

Mobile Phones

2/18/2010 11:14:22 AM #

Phone Cards

You can use GetDeviceUniqueID (New API in Windows Mobile 5.0).
For more information and also managed sample code, you can read Windows Mobile Team Blog,
Link: blogs.msdn.com/.../510997.aspx" title="blogs.msdn.com/.../510997.aspx">blogs.msdn.com/.../510997.aspx

Phone Cards

2/18/2010 11:16:38 AM #

India Calling Cards

I have developed an internet based application that I am currently porting to the Cingular 3125.  This application is written in VB.NET.  I have it running on a few Pocket PCs including the Cingular 8125 as well as the Smartphone Motorola Q.  One of the functions in my application, for tracking purposes, is obtaining the smartphone's unique device ID.

India Calling Cards

2/18/2010 3:16:32 PM #

Phone Systems va

Generally I do not post on blogs, but I would like to say that this post really forced me to do so, Excellent post!

Phone Systems va

2/18/2010 3:18:03 PM #

Used Cell Phones

Resources like the one you mentioned here will be very useful to me! I will post a link to this page on my blog. I am sure my visitors will find that very useful

Used Cell Phones

2/18/2010 3:27:22 PM #

Green Datacenter

Very interesting topic will bookmark your site to check if you write more about in the future.

Green Datacenter

2/18/2010 3:28:07 PM #

Antenna

This is easier and surely gives comfort to internet users. Thanks for sharing. Post like this offers great benefit. Thank you!

Antenna

2/19/2010 8:08:01 AM #

IT Outsourcing

Useful information shared..Iam very happy to read this article..thanks for giving us nice info.Fantastic walk-through. I appreciate this post.

IT Outsourcing

2/19/2010 8:11:03 AM #

Web Design London

Chris Leckness is the Owner/Administrator of Mobilitysite. He is a Microsoft MVP, Mobile Devices and a member of the exclusive focus group, Mobius. Chris has been a big time supporter/user of Windows Mobile since the Dell Axim days when it was Pocket PC 2002. Chris loves Zune, but also owns 3 iPhones too. His personal blog is chris.leckness.com.

Web Design London

2/19/2010 8:13:07 AM #

Miami Web Design

I am a beginner using FlashLite and trying to use an fscommand2 to get the device's serial number (Windows Mobile 5 OS on IPAQ 2495b).

What I am trying to accomplish: to hard code a device's ID into a FlashLite swf and if, after getting the ID in runtime, it does not match the hard-coded value, to quit/exit the swf (close it).

Miami Web Design

2/19/2010 8:15:17 AM #

Business Innovation London

This year at Mix, Microsoft will be unveiling its brand new application platform for Windows Phone 7 Series. Keynotes and breakout sessions will explain and demonstrate the new application platform and give you the information you need to deliver a new generation of compelling mobile applications.

Business Innovation London

2/19/2010 1:58:16 PM #

Online Advertising Agency

I must say that overall I am really impressed with this blog.It is easy to see that you are impassioned about your writing. I wish I had got your ability to write. I look forward to more updates and will be returning.

Online Advertising Agency

2/22/2010 1:08:03 PM #

Auto Insurance

When was the last time you learned that your auto insurance was going to cost less than it had coasted previously?  If you're like most consumers, this probably doesn't happen often.  By employing a comparison engine, you can often short-list the cheapest auto insurance coverage, and not spend days in traffic.  In these days of spiraling costs, its nice to know that you aren't overpaying for your car insurance coverage.

Auto Insurance

2/23/2010 2:45:27 PM #

Miami Computer IT Support

I've surfed the net more than three hours today, however, I haven't found such useful information. Thanks a lot, it is really useful to me.

Miami Computer IT Support

2/23/2010 2:47:02 PM #

Zend CMS

You got a really useful blog I have been here reading for about an hour. I am a newbie and your success is very much an inspiration for me.

Zend CMS

2/23/2010 2:47:38 PM #

Dedicated Servers UK

Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. If possible, as you gain expertise, would you mind updating your blog with more information? It is extremely helpful for me.

Dedicated Servers UK

2/23/2010 2:48:18 PM #

Video Marketing Services

I like your blog post, keep on writing this great material!  I'll make sure to follow up on your blog in the future.

Video Marketing Services

2/23/2010 2:49:16 PM #

Business Network Kent

Usually I do not post on blogs, but I would like to say that this blog really forced me to do so! Thanks, really nice post.

Business Network Kent

2/23/2010 2:50:55 PM #

Antenna Installation

I would like to share it with all my friends and hope they will like it too.

Antenna Installation

2/24/2010 7:36:44 AM #

Wii Fit Plus

Reading this post reminds me of my old room mate! He always kept talking about this. I will forward this article to him. Pretty sure he will have a good read. Thanks for sharing!

Wii Fit Plus

2/25/2010 2:32:45 PM #

Designer Cookware from Pasta Dad

Designer Cookware from Pasta Daddy

Designer Cookware from Pasta Dad

2/27/2010 12:50:43 PM #

vinciamo ai casinò virtuali

I have seen the Pure and Tilt in the USA, but is the HD2 even available in the USA from any of the carriers? I know you can get it at NewEgg.com and other for $800+ but I don't believe any carrier in the USA even has them at the moment...so I assume when it does officially launch in with be as a WinMo7 phone.

vinciamo ai casinò virtuali

3/2/2010 12:33:53 PM #

maffick

california alcohol rehab

maffick

3/3/2010 1:35:36 PM #

Dial India

I have developed an internet based application that I am currently porting to the Cingular 3125.  This application is written in VB.NET.  I have it running on a few Pocket PCs including the Cingular 8125 as well as the Smartphone Motorola Q.  One of the functions in my application, for tracking purposes, is obtaining the smartphone's unique device ID.

Dial India

3/3/2010 1:36:33 PM #

Unlimited Calling Card to India

Many iPhone developers are discovering the potential for new markets and significant revenue opportunities within the Windows Mobile environment and are wondering how to port their Apple applications to Windows® phones.

Unlimited Calling Card to India

3/5/2010 2:42:43 PM #

maffick

residential cocaine treatment Los Angeles

maffick

3/11/2010 7:07:48 PM #

ontario auto insurance

How do you save money on your auto insurance in Ontario province, where the premiums are high in comparison to other provinces such as Quebec. Shop around and compare prices from different insurance providers.

ontario auto insurance

3/25/2010 6:49:02 PM #

Twitter Folower

Twitter Folower

Twitter Folower

3/26/2010 7:53:07 AM #

hrer

http://hebe-blue.com/">白,蓝“/ 1”
http://tennis-athletcs.com/">网球athletcs“/ 1”
http://sports-aquatics.com/">体育,水上运动“/ 1”
http://swimming-athletics.com/">游泳,田径“/ 1”
http://sports-swimming.com/">体育游泳“/ 1”
http://sports-freestyle.com/">体育自由式“/ 1”
http://sports-backstroke.com/">体育仰泳“/ 1”
http://football-all.net/">足球全部“</ 1”
http://sports-butterfly.com/">体育蝴蝶“/ 1”
http://baseball-allin.com/">棒球奥林“/ 1”
http://sports-track.net/">运动轨道“/ 1”
http://sports-jumping.com/">体育跳“/ 1”
http://sports-polevault.com/">体育polevault“/ 1”
http://softball-into.com/">到“垒球/ 1”
http://sports-winston.com/">体育温斯顿“/ 1”

hrer

3/26/2010 8:06:46 AM #

hrer

http://hebe-blue.com/">hebe-blue
http://tennis-athletcs.com/">tennis-athletcs
http://sports-aquatics.com/">sports-aquatics
http://swimming-athletics.com/">swimming-athletics
http://sports-swimming.com/">sports-swimming
http://sports-freestyle.com/">sports-freestyle
http://sports-backstroke.com/">sports-backstroke
http://football-all.net/">football-all
http://sports-butterfly.com/">sports-butterfly
http://baseball-allin.com/">baseball-allin
http://sports-track.net/">sports-track
http://sports-jumping.com/">sports-jumping
http://sports-polevault.com/">sports-polevault
http://softball-into.com/">softball-into
http://sports-winston.com/">sports-winston55

hrer

3/26/2010 8:12:10 AM #

hrer

http://hebe-blue.com/">hebe-blue
http://tennis-athletcs.com/">tennis-athletcs
http://sports-aquatics.com/">sports-aquatics
http://swimming-athletics.com/">swimming-athletics
http://sports-swimming.com/">sports-swimming
http://sports-freestyle.com/">sports-freestyle
http://sports-backstroke.com/">sports-backstroke
http://football-all.net/">football-all
http://sports-butterfly.com/">sports-butterfly
http://baseball-allin.com/">baseball-allin
http://sports-track.net/">sports-track
http://sports-jumping.com/">sports-jumping
http://sports-polevault.com/">sports-polevaultQC
http://softball-into.com/">softball-into
http://sports-winston.com/">sports-winston

hrer

4/14/2010 4:46:43 AM #

compound interest formula

Nice design! I like all of them. Something that actually relate to the inner and that's why I am here.

compound interest formula

4/14/2010 4:48:43 AM #

construction games

I have already started reading some of your articles. i found great articles here. I have  just added your blog to my bookmark sites. thanks for the sharing.

construction games

4/19/2010 2:45:14 PM #

Mayank Parmar

Here the device id is application specific, so it gives me different UID and it gives different UID to Mobi Control Manager (SOTI). And hence I am always confused.

Is there any way (other then read data from registry) so that I can have same device ID for application and Mobi Control the ?

Mayank Parmar

4/24/2010 8:02:13 PM #

Weight Loss Resources

Great site! Thanks for sharing!

Weight Loss Resources

4/30/2010 1:21:29 PM #

Top Penis Enhancement Pills

Great site and content1!!!

Top Penis Enhancement Pills

4/30/2010 1:22:46 PM #

Penis Enhancement Pills Reviews

Great site. I loved it very much!!!

Penis Enhancement Pills Reviews

4/30/2010 1:26:58 PM #

Top Penis Enhancement Patches

Great site

Top Penis Enhancement Patches

4/30/2010 1:27:37 PM #

Penis Enhancement Patches Review

Good site

Penis Enhancement Patches Review

4/30/2010 1:28:50 PM #

Penis Enlargement Devices Review

Greaet content and site

Penis Enlargement Devices Review

4/30/2010 1:29:28 PM #

Top Penis Enlargement Devices

Good site!!!

Top Penis Enlargement Devices

4/30/2010 1:30:23 PM #

Penis Enlargement Exercise

Good site great contnet

Penis Enlargement Exercise

4/30/2010 1:30:51 PM #

Penis Enlargement Exercise

Good cotnent

Penis Enlargement Exercise

5/3/2010 4:09:28 PM #

The Great American Store

I have no idea about mobile device id before read this post. but i have some information about getting windows mobile device id so thanks for post this information.

The Great American Store

5/4/2010 10:51:04 AM #

Website Surveys

Is it possible to  getting this ID on the device without programming?Other Devices for ex( Nokias and SonyEricssons) with “active sync” they use the IMEA code. Which is clever but not used by Microsoft.

Website Surveys

Comments are closed